etc/TODO: Update bidi-related items.
[emacs.git] / doc / misc / texinfo.tex
blob3298298bb9d4eab87e64993796b93242d5bc591d
1 % texinfo.tex -- TeX macros to handle Texinfo files.
2 %
3 % Load plain if necessary, i.e., if running under initex.
4 \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
6 \def\texinfoversion{2011-09-23.09}
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 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 has been our intent since Texinfo was invented.)
29 % Please try the latest version of texinfo.tex before submitting bug
30 % reports; you can get the latest version from:
31 % http://www.gnu.org/software/texinfo/ (the Texinfo home page), or
32 % ftp://tug.org/tex/texinfo.tex
33 % (and all CTAN mirrors, see http://www.ctan.org).
34 % The texinfo.tex in any given distribution could well be out
35 % of date, so if that's what you're using, please check.
37 % Send bug reports to bug-texinfo@gnu.org. Please include including a
38 % complete document in each bug report with which we can reproduce the
39 % problem. Patches are, of course, greatly appreciated.
41 % To process a Texinfo manual with TeX, it's most reliable to use the
42 % texi2dvi shell script that comes with the distribution. For a simple
43 % manual foo.texi, however, you can get away with this:
44 % tex foo.texi
45 % texindex foo.??
46 % tex foo.texi
47 % tex foo.texi
48 % dvips foo.dvi -o # or whatever; this makes foo.ps.
49 % The extra TeX runs get the cross-reference information correct.
50 % Sometimes one run after texindex suffices, and sometimes you need more
51 % than two; texi2dvi does it as many times as necessary.
53 % It is possible to adapt texinfo.tex for other languages, to some
54 % extent. You can get the existing language-specific files from the
55 % full Texinfo distribution.
57 % The GNU Texinfo home page is http://www.gnu.org/software/texinfo.
60 \message{Loading texinfo [version \texinfoversion]:}
62 % If in a .fmt file, print the version number
63 % and turn on active characters that we couldn't do earlier because
64 % they might have appeared in the input file name.
65 \everyjob{\message{[Texinfo version \texinfoversion]}%
66 \catcode`+=\active \catcode`\_=\active}
68 \chardef\other=12
70 % We never want plain's \outer definition of \+ in Texinfo.
71 % For @tex, we can use \tabalign.
72 \let\+ = \relax
74 % Save some plain tex macros whose names we will redefine.
75 \let\ptexb=\b
76 \let\ptexbullet=\bullet
77 \let\ptexc=\c
78 \let\ptexcomma=\,
79 \let\ptexdot=\.
80 \let\ptexdots=\dots
81 \let\ptexend=\end
82 \let\ptexequiv=\equiv
83 \let\ptexexclam=\!
84 \let\ptexfootnote=\footnote
85 \let\ptexgtr=>
86 \let\ptexhat=^
87 \let\ptexi=\i
88 \let\ptexindent=\indent
89 \let\ptexinsert=\insert
90 \let\ptexlbrace=\{
91 \let\ptexless=<
92 \let\ptexnewwrite\newwrite
93 \let\ptexnoindent=\noindent
94 \let\ptexplus=+
95 \let\ptexraggedright=\raggedright
96 \let\ptexrbrace=\}
97 \let\ptexslash=\/
98 \let\ptexstar=\*
99 \let\ptext=\t
100 \let\ptextop=\top
101 {\catcode`\'=\active \global\let\ptexquoteright'}% active in plain's math mode
103 % If this character appears in an error message or help string, it
104 % starts a new line in the output.
105 \newlinechar = `^^J
107 % Use TeX 3.0's \inputlineno to get the line number, for better error
108 % messages, but if we're using an old version of TeX, don't do anything.
110 \ifx\inputlineno\thisisundefined
111 \let\linenumber = \empty % Pre-3.0.
112 \else
113 \def\linenumber{l.\the\inputlineno:\space}
116 % Set up fixed words for English if not already set.
117 \ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi
118 \ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi
119 \ifx\putwordfile\undefined \gdef\putwordfile{file}\fi
120 \ifx\putwordin\undefined \gdef\putwordin{in}\fi
121 \ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi
122 \ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi
123 \ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi
124 \ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi
125 \ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi
126 \ifx\putwordNoTitle\undefined \gdef\putwordNoTitle{No Title}\fi
127 \ifx\putwordof\undefined \gdef\putwordof{of}\fi
128 \ifx\putwordon\undefined \gdef\putwordon{on}\fi
129 \ifx\putwordpage\undefined \gdef\putwordpage{page}\fi
130 \ifx\putwordsection\undefined \gdef\putwordsection{section}\fi
131 \ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi
132 \ifx\putwordsee\undefined \gdef\putwordsee{see}\fi
133 \ifx\putwordSee\undefined \gdef\putwordSee{See}\fi
134 \ifx\putwordShortTOC\undefined \gdef\putwordShortTOC{Short Contents}\fi
135 \ifx\putwordTOC\undefined \gdef\putwordTOC{Table of Contents}\fi
137 \ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi
138 \ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi
139 \ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi
140 \ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi
141 \ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi
142 \ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi
143 \ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi
144 \ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi
145 \ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi
146 \ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi
147 \ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi
148 \ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi
150 \ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro}\fi
151 \ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi
152 \ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi
153 \ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi
154 \ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi
156 % Since the category of space is not known, we have to be careful.
157 \chardef\spacecat = 10
158 \def\spaceisspace{\catcode`\ =\spacecat}
160 % sometimes characters are active, so we need control sequences.
161 \chardef\ampChar = `\&
162 \chardef\colonChar = `\:
163 \chardef\commaChar = `\,
164 \chardef\dashChar = `\-
165 \chardef\dotChar = `\.
166 \chardef\exclamChar= `\!
167 \chardef\hashChar = `\#
168 \chardef\lquoteChar= `\`
169 \chardef\questChar = `\?
170 \chardef\rquoteChar= `\'
171 \chardef\semiChar = `\;
172 \chardef\slashChar = `\/
173 \chardef\underChar = `\_
175 % Ignore a token.
177 \def\gobble#1{}
179 % The following is used inside several \edef's.
180 \def\makecsname#1{\expandafter\noexpand\csname#1\endcsname}
182 % Hyphenation fixes.
183 \hyphenation{
184 Flor-i-da Ghost-script Ghost-view Mac-OS Post-Script
185 ap-pen-dix bit-map bit-maps
186 data-base data-bases eshell fall-ing half-way long-est man-u-script
187 man-u-scripts mini-buf-fer mini-buf-fers over-view par-a-digm
188 par-a-digms rath-er rec-tan-gu-lar ro-bot-ics se-vere-ly set-up spa-ces
189 spell-ing spell-ings
190 stand-alone strong-est time-stamp time-stamps which-ever white-space
191 wide-spread wrap-around
194 % Margin to add to right of even pages, to left of odd pages.
195 \newdimen\bindingoffset
196 \newdimen\normaloffset
197 \newdimen\pagewidth \newdimen\pageheight
199 % For a final copy, take out the rectangles
200 % that mark overfull boxes (in case you have decided
201 % that the text looks ok even though it passes the margin).
203 \def\finalout{\overfullrule=0pt }
205 % Sometimes it is convenient to have everything in the transcript file
206 % and nothing on the terminal. We don't just call \tracingall here,
207 % since that produces some useless output on the terminal. We also make
208 % some effort to order the tracing commands to reduce output in the log
209 % file; cf. trace.sty in LaTeX.
211 \def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%
212 \def\loggingall{%
213 \tracingstats2
214 \tracingpages1
215 \tracinglostchars2 % 2 gives us more in etex
216 \tracingparagraphs1
217 \tracingoutput1
218 \tracingmacros2
219 \tracingrestores1
220 \showboxbreadth\maxdimen \showboxdepth\maxdimen
221 \ifx\eTeXversion\thisisundefined\else % etex gives us more logging
222 \tracingscantokens1
223 \tracingifs1
224 \tracinggroups1
225 \tracingnesting2
226 \tracingassigns1
228 \tracingcommands3 % 3 gives us more in etex
229 \errorcontextlines16
232 % add check for \lastpenalty to plain's definitions. If the last thing
233 % we did was a \nobreak, we don't want to insert more space.
235 \def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount
236 \removelastskip\penalty-50\smallskip\fi\fi}
237 \def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount
238 \removelastskip\penalty-100\medskip\fi\fi}
239 \def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount
240 \removelastskip\penalty-200\bigskip\fi\fi}
242 % Do @cropmarks to get crop marks.
244 \newif\ifcropmarks
245 \let\cropmarks = \cropmarkstrue
247 % Dimensions to add cropmarks at corners.
248 % Added by P. A. MacKay, 12 Nov. 1986
250 \newdimen\outerhsize \newdimen\outervsize % set by the paper size routines
251 \newdimen\cornerlong \cornerlong=1pc
252 \newdimen\cornerthick \cornerthick=.3pt
253 \newdimen\topandbottommargin \topandbottommargin=.75in
255 % Output a mark which sets \thischapter, \thissection and \thiscolor.
256 % We dump everything together because we only have one kind of mark.
257 % This works because we only use \botmark / \topmark, not \firstmark.
259 % A mark contains a subexpression of the \ifcase ... \fi construct.
260 % \get*marks macros below extract the needed part using \ifcase.
262 % Another complication is to let the user choose whether \thischapter
263 % (\thissection) refers to the chapter (section) in effect at the top
264 % of a page, or that at the bottom of a page. The solution is
265 % described on page 260 of The TeXbook. It involves outputting two
266 % marks for the sectioning macros, one before the section break, and
267 % one after. I won't pretend I can describe this better than DEK...
268 \def\domark{%
269 \toks0=\expandafter{\lastchapterdefs}%
270 \toks2=\expandafter{\lastsectiondefs}%
271 \toks4=\expandafter{\prevchapterdefs}%
272 \toks6=\expandafter{\prevsectiondefs}%
273 \toks8=\expandafter{\lastcolordefs}%
274 \mark{%
275 \the\toks0 \the\toks2
276 \noexpand\or \the\toks4 \the\toks6
277 \noexpand\else \the\toks8
280 % \topmark doesn't work for the very first chapter (after the title
281 % page or the contents), so we use \firstmark there -- this gets us
282 % the mark with the chapter defs, unless the user sneaks in, e.g.,
283 % @setcolor (or @url, or @link, etc.) between @contents and the very
284 % first @chapter.
285 \def\gettopheadingmarks{%
286 \ifcase0\topmark\fi
287 \ifx\thischapter\empty \ifcase0\firstmark\fi \fi
289 \def\getbottomheadingmarks{\ifcase1\botmark\fi}
290 \def\getcolormarks{\ifcase2\topmark\fi}
292 % Avoid "undefined control sequence" errors.
293 \def\lastchapterdefs{}
294 \def\lastsectiondefs{}
295 \def\prevchapterdefs{}
296 \def\prevsectiondefs{}
297 \def\lastcolordefs{}
299 % Main output routine.
300 \chardef\PAGE = 255
301 \output = {\onepageout{\pagecontents\PAGE}}
303 \newbox\headlinebox
304 \newbox\footlinebox
306 % \onepageout takes a vbox as an argument. Note that \pagecontents
307 % does insertions, but you have to call it yourself.
308 \def\onepageout#1{%
309 \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi
311 \ifodd\pageno \advance\hoffset by \bindingoffset
312 \else \advance\hoffset by -\bindingoffset\fi
314 % Do this outside of the \shipout so @code etc. will be expanded in
315 % the headline as they should be, not taken literally (outputting ''code).
316 \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi
317 \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}%
318 \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi
319 \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}%
322 % Have to do this stuff outside the \shipout because we want it to
323 % take effect in \write's, yet the group defined by the \vbox ends
324 % before the \shipout runs.
326 \indexdummies % don't expand commands in the output.
327 \normalturnoffactive % \ in index entries must not stay \, e.g., if
328 % the page break happens to be in the middle of an example.
329 % We don't want .vr (or whatever) entries like this:
330 % \entry{{\tt \indexbackslash }acronym}{32}{\code {\acronym}}
331 % "\acronym" won't work when it's read back in;
332 % it needs to be
333 % {\code {{\tt \backslashcurfont }acronym}
334 \shipout\vbox{%
335 % Do this early so pdf references go to the beginning of the page.
336 \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi
338 \ifcropmarks \vbox to \outervsize\bgroup
339 \hsize = \outerhsize
340 \vskip-\topandbottommargin
341 \vtop to0pt{%
342 \line{\ewtop\hfil\ewtop}%
343 \nointerlineskip
344 \line{%
345 \vbox{\moveleft\cornerthick\nstop}%
346 \hfill
347 \vbox{\moveright\cornerthick\nstop}%
349 \vss}%
350 \vskip\topandbottommargin
351 \line\bgroup
352 \hfil % center the page within the outer (page) hsize.
353 \ifodd\pageno\hskip\bindingoffset\fi
354 \vbox\bgroup
357 \unvbox\headlinebox
358 \pagebody{#1}%
359 \ifdim\ht\footlinebox > 0pt
360 % Only leave this space if the footline is nonempty.
361 % (We lessened \vsize for it in \oddfootingyyy.)
362 % The \baselineskip=24pt in plain's \makefootline has no effect.
363 \vskip 24pt
364 \unvbox\footlinebox
367 \ifcropmarks
368 \egroup % end of \vbox\bgroup
369 \hfil\egroup % end of (centering) \line\bgroup
370 \vskip\topandbottommargin plus1fill minus1fill
371 \boxmaxdepth = \cornerthick
372 \vbox to0pt{\vss
373 \line{%
374 \vbox{\moveleft\cornerthick\nsbot}%
375 \hfill
376 \vbox{\moveright\cornerthick\nsbot}%
378 \nointerlineskip
379 \line{\ewbot\hfil\ewbot}%
381 \egroup % \vbox from first cropmarks clause
383 }% end of \shipout\vbox
384 }% end of group with \indexdummies
385 \advancepageno
386 \ifnum\outputpenalty>-20000 \else\dosupereject\fi
389 \newinsert\margin \dimen\margin=\maxdimen
391 \def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}}
392 {\catcode`\@ =11
393 \gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
394 % marginal hacks, juha@viisa.uucp (Juha Takala)
395 \ifvoid\margin\else % marginal info is present
396 \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi
397 \dimen@=\dp#1\relax \unvbox#1\relax
398 \ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
399 \ifr@ggedbottom \kern-\dimen@ \vfil \fi}
402 % Here are the rules for the cropmarks. Note that they are
403 % offset so that the space between them is truly \outerhsize or \outervsize
404 % (P. A. MacKay, 12 November, 1986)
406 \def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong}
407 \def\nstop{\vbox
408 {\hrule height\cornerthick depth\cornerlong width\cornerthick}}
409 \def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong}
410 \def\nsbot{\vbox
411 {\hrule height\cornerlong depth\cornerthick width\cornerthick}}
413 % Parse an argument, then pass it to #1. The argument is the rest of
414 % the input line (except we remove a trailing comment). #1 should be a
415 % macro which expects an ordinary undelimited TeX argument.
417 \def\parsearg{\parseargusing{}}
418 \def\parseargusing#1#2{%
419 \def\argtorun{#2}%
420 \begingroup
421 \obeylines
422 \spaceisspace
424 \parseargline\empty% Insert the \empty token, see \finishparsearg below.
427 {\obeylines %
428 \gdef\parseargline#1^^M{%
429 \endgroup % End of the group started in \parsearg.
430 \argremovecomment #1\comment\ArgTerm%
434 % First remove any @comment, then any @c comment.
435 \def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm}
436 \def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm}
438 % Each occurrence of `\^^M' or `<space>\^^M' is replaced by a single space.
440 % \argremovec might leave us with trailing space, e.g.,
441 % @end itemize @c foo
442 % This space token undergoes the same procedure and is eventually removed
443 % by \finishparsearg.
445 \def\argcheckspaces#1\^^M{\argcheckspacesX#1\^^M \^^M}
446 \def\argcheckspacesX#1 \^^M{\argcheckspacesY#1\^^M}
447 \def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{%
448 \def\temp{#3}%
449 \ifx\temp\empty
450 % Do not use \next, perhaps the caller of \parsearg uses it; reuse \temp:
451 \let\temp\finishparsearg
452 \else
453 \let\temp\argcheckspaces
455 % Put the space token in:
456 \temp#1 #3\ArgTerm
459 % If a _delimited_ argument is enclosed in braces, they get stripped; so
460 % to get _exactly_ the rest of the line, we had to prevent such situation.
461 % We prepended an \empty token at the very beginning and we expand it now,
462 % just before passing the control to \argtorun.
463 % (Similarly, we have to think about #3 of \argcheckspacesY above: it is
464 % either the null string, or it ends with \^^M---thus there is no danger
465 % that a pair of braces would be stripped.
467 % But first, we have to remove the trailing space token.
469 \def\finishparsearg#1 \ArgTerm{\expandafter\argtorun\expandafter{#1}}
471 % \parseargdef\foo{...}
472 % is roughly equivalent to
473 % \def\foo{\parsearg\Xfoo}
474 % \def\Xfoo#1{...}
476 % Actually, I use \csname\string\foo\endcsname, ie. \\foo, as it is my
477 % favourite TeX trick. --kasal, 16nov03
479 \def\parseargdef#1{%
480 \expandafter \doparseargdef \csname\string#1\endcsname #1%
482 \def\doparseargdef#1#2{%
483 \def#2{\parsearg#1}%
484 \def#1##1%
487 % Several utility definitions with active space:
489 \obeyspaces
490 \gdef\obeyedspace{ }
492 % Make each space character in the input produce a normal interword
493 % space in the output. Don't allow a line break at this space, as this
494 % is used only in environments like @example, where each line of input
495 % should produce a line of output anyway.
497 \gdef\sepspaces{\obeyspaces\let =\tie}
499 % If an index command is used in an @example environment, any spaces
500 % therein should become regular spaces in the raw index file, not the
501 % expansion of \tie (\leavevmode \penalty \@M \ ).
502 \gdef\unsepspaces{\let =\space}
506 \def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}
508 % Define the framework for environments in texinfo.tex. It's used like this:
510 % \envdef\foo{...}
511 % \def\Efoo{...}
513 % It's the responsibility of \envdef to insert \begingroup before the
514 % actual body; @end closes the group after calling \Efoo. \envdef also
515 % defines \thisenv, so the current environment is known; @end checks
516 % whether the environment name matches. The \checkenv macro can also be
517 % used to check whether the current environment is the one expected.
519 % Non-false conditionals (@iftex, @ifset) don't fit into this, so they
520 % are not treated as environments; they don't open a group. (The
521 % implementation of @end takes care not to call \endgroup in this
522 % special case.)
525 % At run-time, environments start with this:
526 \def\startenvironment#1{\begingroup\def\thisenv{#1}}
527 % initialize
528 \let\thisenv\empty
530 % ... but they get defined via ``\envdef\foo{...}'':
531 \long\def\envdef#1#2{\def#1{\startenvironment#1#2}}
532 \def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}}
534 % Check whether we're in the right environment:
535 \def\checkenv#1{%
536 \def\temp{#1}%
537 \ifx\thisenv\temp
538 \else
539 \badenverr
543 % Environment mismatch, #1 expected:
544 \def\badenverr{%
545 \errhelp = \EMsimple
546 \errmessage{This command can appear only \inenvironment\temp,
547 not \inenvironment\thisenv}%
549 \def\inenvironment#1{%
550 \ifx#1\empty
551 outside of any environment%
552 \else
553 in environment \expandafter\string#1%
557 % @end foo executes the definition of \Efoo.
558 % But first, it executes a specialized version of \checkenv
560 \parseargdef\end{%
561 \if 1\csname iscond.#1\endcsname
562 \else
563 % The general wording of \badenverr may not be ideal.
564 \expandafter\checkenv\csname#1\endcsname
565 \csname E#1\endcsname
566 \endgroup
570 \newhelp\EMsimple{Press RETURN to continue.}
573 % Be sure we're in horizontal mode when doing a tie, since we make space
574 % equivalent to this in @example-like environments. Otherwise, a space
575 % at the beginning of a line will start with \penalty -- and
576 % since \penalty is valid in vertical mode, we'd end up putting the
577 % penalty on the vertical list instead of in the new paragraph.
578 {\catcode`@ = 11
579 % Avoid using \@M directly, because that causes trouble
580 % if the definition is written into an index file.
581 \global\let\tiepenalty = \@M
582 \gdef\tie{\leavevmode\penalty\tiepenalty\ }
585 % @: forces normal size whitespace following.
586 \def\:{\spacefactor=1000 }
588 % @* forces a line break.
589 \def\*{\hfil\break\hbox{}\ignorespaces}
591 % @/ allows a line break.
592 \let\/=\allowbreak
594 % @. is an end-of-sentence period.
595 \def\.{.\spacefactor=\endofsentencespacefactor\space}
597 % @! is an end-of-sentence bang.
598 \def\!{!\spacefactor=\endofsentencespacefactor\space}
600 % @? is an end-of-sentence query.
601 \def\?{?\spacefactor=\endofsentencespacefactor\space}
603 % @frenchspacing on|off says whether to put extra space after punctuation.
605 \def\onword{on}
606 \def\offword{off}
608 \parseargdef\frenchspacing{%
609 \def\temp{#1}%
610 \ifx\temp\onword \plainfrenchspacing
611 \else\ifx\temp\offword \plainnonfrenchspacing
612 \else
613 \errhelp = \EMsimple
614 \errmessage{Unknown @frenchspacing option `\temp', must be on|off}%
615 \fi\fi
618 % @w prevents a word break. Without the \leavevmode, @w at the
619 % beginning of a paragraph, when TeX is still in vertical mode, would
620 % produce a whole line of output instead of starting the paragraph.
621 \def\w#1{\leavevmode\hbox{#1}}
623 % @group ... @end group forces ... to be all on one page, by enclosing
624 % it in a TeX vbox. We use \vtop instead of \vbox to construct the box
625 % to keep its height that of a normal line. According to the rules for
626 % \topskip (p.114 of the TeXbook), the glue inserted is
627 % max (\topskip - \ht (first item), 0). If that height is large,
628 % therefore, no glue is inserted, and the space between the headline and
629 % the text is small, which looks bad.
631 % Another complication is that the group might be very large. This can
632 % cause the glue on the previous page to be unduly stretched, because it
633 % does not have much material. In this case, it's better to add an
634 % explicit \vfill so that the extra space is at the bottom. The
635 % threshold for doing this is if the group is more than \vfilllimit
636 % percent of a page (\vfilllimit can be changed inside of @tex).
638 \newbox\groupbox
639 \def\vfilllimit{0.7}
641 \envdef\group{%
642 \ifnum\catcode`\^^M=\active \else
643 \errhelp = \groupinvalidhelp
644 \errmessage{@group invalid in context where filling is enabled}%
646 \startsavinginserts
648 \setbox\groupbox = \vtop\bgroup
649 % Do @comment since we are called inside an environment such as
650 % @example, where each end-of-line in the input causes an
651 % end-of-line in the output. We don't want the end-of-line after
652 % the `@group' to put extra space in the output. Since @group
653 % should appear on a line by itself (according to the Texinfo
654 % manual), we don't worry about eating any user text.
655 \comment
658 % The \vtop produces a box with normal height and large depth; thus, TeX puts
659 % \baselineskip glue before it, and (when the next line of text is done)
660 % \lineskip glue after it. Thus, space below is not quite equal to space
661 % above. But it's pretty close.
662 \def\Egroup{%
663 % To get correct interline space between the last line of the group
664 % and the first line afterwards, we have to propagate \prevdepth.
665 \endgraf % Not \par, as it may have been set to \lisppar.
666 \global\dimen1 = \prevdepth
667 \egroup % End the \vtop.
668 % \dimen0 is the vertical size of the group's box.
669 \dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox
670 % \dimen2 is how much space is left on the page (more or less).
671 \dimen2 = \pageheight \advance\dimen2 by -\pagetotal
672 % if the group doesn't fit on the current page, and it's a big big
673 % group, force a page break.
674 \ifdim \dimen0 > \dimen2
675 \ifdim \pagetotal < \vfilllimit\pageheight
676 \page
679 \box\groupbox
680 \prevdepth = \dimen1
681 \checkinserts
684 % TeX puts in an \escapechar (i.e., `@') at the beginning of the help
685 % message, so this ends up printing `@group can only ...'.
687 \newhelp\groupinvalidhelp{%
688 group can only be used in environments such as @example,^^J%
689 where each line of input produces a line of output.}
691 % @need space-in-mils
692 % forces a page break if there is not space-in-mils remaining.
694 \newdimen\mil \mil=0.001in
696 \parseargdef\need{%
697 % Ensure vertical mode, so we don't make a big box in the middle of a
698 % paragraph.
699 \par
701 % If the @need value is less than one line space, it's useless.
702 \dimen0 = #1\mil
703 \dimen2 = \ht\strutbox
704 \advance\dimen2 by \dp\strutbox
705 \ifdim\dimen0 > \dimen2
707 % Do a \strut just to make the height of this box be normal, so the
708 % normal leading is inserted relative to the preceding line.
709 % And a page break here is fine.
710 \vtop to #1\mil{\strut\vfil}%
712 % TeX does not even consider page breaks if a penalty added to the
713 % main vertical list is 10000 or more. But in order to see if the
714 % empty box we just added fits on the page, we must make it consider
715 % page breaks. On the other hand, we don't want to actually break the
716 % page after the empty box. So we use a penalty of 9999.
718 % There is an extremely small chance that TeX will actually break the
719 % page at this \penalty, if there are no other feasible breakpoints in
720 % sight. (If the user is using lots of big @group commands, which
721 % almost-but-not-quite fill up a page, TeX will have a hard time doing
722 % good page breaking, for example.) However, I could not construct an
723 % example where a page broke at this \penalty; if it happens in a real
724 % document, then we can reconsider our strategy.
725 \penalty9999
727 % Back up by the size of the box, whether we did a page break or not.
728 \kern -#1\mil
730 % Do not allow a page break right after this kern.
731 \nobreak
735 % @br forces paragraph break (and is undocumented).
737 \let\br = \par
739 % @page forces the start of a new page.
741 \def\page{\par\vfill\supereject}
743 % @exdent text....
744 % outputs text on separate line in roman font, starting at standard page margin
746 % This records the amount of indent in the innermost environment.
747 % That's how much \exdent should take out.
748 \newskip\exdentamount
750 % This defn is used inside fill environments such as @defun.
751 \parseargdef\exdent{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}
753 % This defn is used inside nofill environments such as @example.
754 \parseargdef\nofillexdent{{\advance \leftskip by -\exdentamount
755 \leftline{\hskip\leftskip{\rm#1}}}}
757 % @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current
758 % paragraph. For more general purposes, use the \margin insertion
759 % class. WHICH is `l' or `r'. Not documented, written for gawk manual.
761 \newskip\inmarginspacing \inmarginspacing=1cm
762 \def\strutdepth{\dp\strutbox}
764 \def\doinmargin#1#2{\strut\vadjust{%
765 \nobreak
766 \kern-\strutdepth
767 \vtop to \strutdepth{%
768 \baselineskip=\strutdepth
769 \vss
770 % if you have multiple lines of stuff to put here, you'll need to
771 % make the vbox yourself of the appropriate size.
772 \ifx#1l%
773 \llap{\ignorespaces #2\hskip\inmarginspacing}%
774 \else
775 \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}%
777 \null
780 \def\inleftmargin{\doinmargin l}
781 \def\inrightmargin{\doinmargin r}
783 % @inmargin{TEXT [, RIGHT-TEXT]}
784 % (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right;
785 % else use TEXT for both).
787 \def\inmargin#1{\parseinmargin #1,,\finish}
788 \def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing.
789 \setbox0 = \hbox{\ignorespaces #2}%
790 \ifdim\wd0 > 0pt
791 \def\lefttext{#1}% have both texts
792 \def\righttext{#2}%
793 \else
794 \def\lefttext{#1}% have only one text
795 \def\righttext{#1}%
798 \ifodd\pageno
799 \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin
800 \else
801 \def\temp{\inleftmargin\lefttext}%
803 \temp
806 % @| inserts a changebar to the left of the current line. It should
807 % surround any changed text. This approach does *not* work if the
808 % change spans more than two lines of output. To handle that, we would
809 % have adopt a much more difficult approach (putting marks into the main
810 % vertical list for the beginning and end of each change). This command
811 % is not documented, not supported, and doesn't work.
813 \def\|{%
814 % \vadjust can only be used in horizontal mode.
815 \leavevmode
817 % Append this vertical mode material after the current line in the output.
818 \vadjust{%
819 % We want to insert a rule with the height and depth of the current
820 % leading; that is exactly what \strutbox is supposed to record.
821 \vskip-\baselineskip
823 % \vadjust-items are inserted at the left edge of the type. So
824 % the \llap here moves out into the left-hand margin.
825 \llap{%
827 % For a thicker or thinner bar, change the `1pt'.
828 \vrule height\baselineskip width1pt
830 % This is the space between the bar and the text.
831 \hskip 12pt
836 % @include FILE -- \input text of FILE.
838 \def\include{\parseargusing\filenamecatcodes\includezzz}
839 \def\includezzz#1{%
840 \pushthisfilestack
841 \def\thisfile{#1}%
843 \makevalueexpandable % we want to expand any @value in FILE.
844 \turnoffactive % and allow special characters in the expansion
845 \indexnofonts % Allow `@@' and other weird things in file names.
846 \wlog{texinfo.tex: doing @include of #1^^J}%
847 \edef\temp{\noexpand\input #1 }%
849 % This trickery is to read FILE outside of a group, in case it makes
850 % definitions, etc.
851 \expandafter
852 }\temp
853 \popthisfilestack
855 \def\filenamecatcodes{%
856 \catcode`\\=\other
857 \catcode`~=\other
858 \catcode`^=\other
859 \catcode`_=\other
860 \catcode`|=\other
861 \catcode`<=\other
862 \catcode`>=\other
863 \catcode`+=\other
864 \catcode`-=\other
865 \catcode`\`=\other
866 \catcode`\'=\other
869 \def\pushthisfilestack{%
870 \expandafter\pushthisfilestackX\popthisfilestack\StackTerm
872 \def\pushthisfilestackX{%
873 \expandafter\pushthisfilestackY\thisfile\StackTerm
875 \def\pushthisfilestackY #1\StackTerm #2\StackTerm {%
876 \gdef\popthisfilestack{\gdef\thisfile{#1}\gdef\popthisfilestack{#2}}%
879 \def\popthisfilestack{\errthisfilestackempty}
880 \def\errthisfilestackempty{\errmessage{Internal error:
881 the stack of filenames is empty.}}
883 \def\thisfile{}
885 % @center line
886 % outputs that line, centered.
888 \parseargdef\center{%
889 \ifhmode
890 \let\next\centerH
891 \else
892 \let\next\centerV
894 \next{\hfil \ignorespaces#1\unskip \hfil}%
896 \def\centerH#1{%
898 \hfil\break
899 \advance\hsize by -\leftskip
900 \advance\hsize by -\rightskip
901 \line{#1}%
902 \break
905 \def\centerV#1{\line{\kern\leftskip #1\kern\rightskip}}
907 % @sp n outputs n lines of vertical space
909 \parseargdef\sp{\vskip #1\baselineskip}
911 % @comment ...line which is ignored...
912 % @c is the same as @comment
913 % @ignore ... @end ignore is another way to write a comment
915 \def\comment{\begingroup \catcode`\^^M=\other%
916 \catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%
917 \commentxxx}
918 {\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}}
920 \let\c=\comment
922 % @paragraphindent NCHARS
923 % We'll use ems for NCHARS, close enough.
924 % NCHARS can also be the word `asis' or `none'.
925 % We cannot feasibly implement @paragraphindent asis, though.
927 \def\asisword{asis} % no translation, these are keywords
928 \def\noneword{none}
930 \parseargdef\paragraphindent{%
931 \def\temp{#1}%
932 \ifx\temp\asisword
933 \else
934 \ifx\temp\noneword
935 \defaultparindent = 0pt
936 \else
937 \defaultparindent = #1em
940 \parindent = \defaultparindent
943 % @exampleindent NCHARS
944 % We'll use ems for NCHARS like @paragraphindent.
945 % It seems @exampleindent asis isn't necessary, but
946 % I preserve it to make it similar to @paragraphindent.
947 \parseargdef\exampleindent{%
948 \def\temp{#1}%
949 \ifx\temp\asisword
950 \else
951 \ifx\temp\noneword
952 \lispnarrowing = 0pt
953 \else
954 \lispnarrowing = #1em
959 % @firstparagraphindent WORD
960 % If WORD is `none', then suppress indentation of the first paragraph
961 % after a section heading. If WORD is `insert', then do indent at such
962 % paragraphs.
964 % The paragraph indentation is suppressed or not by calling
965 % \suppressfirstparagraphindent, which the sectioning commands do.
966 % We switch the definition of this back and forth according to WORD.
967 % By default, we suppress indentation.
969 \def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent}
970 \def\insertword{insert}
972 \parseargdef\firstparagraphindent{%
973 \def\temp{#1}%
974 \ifx\temp\noneword
975 \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent
976 \else\ifx\temp\insertword
977 \let\suppressfirstparagraphindent = \relax
978 \else
979 \errhelp = \EMsimple
980 \errmessage{Unknown @firstparagraphindent option `\temp'}%
981 \fi\fi
984 % Here is how we actually suppress indentation. Redefine \everypar to
985 % \kern backwards by \parindent, and then reset itself to empty.
987 % We also make \indent itself not actually do anything until the next
988 % paragraph.
990 \gdef\dosuppressfirstparagraphindent{%
991 \gdef\indent{%
992 \restorefirstparagraphindent
993 \indent
995 \gdef\noindent{%
996 \restorefirstparagraphindent
997 \noindent
999 \global\everypar = {%
1000 \kern -\parindent
1001 \restorefirstparagraphindent
1005 \gdef\restorefirstparagraphindent{%
1006 \global \let \indent = \ptexindent
1007 \global \let \noindent = \ptexnoindent
1008 \global \everypar = {}%
1012 % @refill is a no-op.
1013 \let\refill=\relax
1015 % If working on a large document in chapters, it is convenient to
1016 % be able to disable indexing, cross-referencing, and contents, for test runs.
1017 % This is done with @novalidate (before @setfilename).
1019 \newif\iflinks \linkstrue % by default we want the aux files.
1020 \let\novalidate = \linksfalse
1022 % @setfilename is done at the beginning of every texinfo file.
1023 % So open here the files we need to have open while reading the input.
1024 % This makes it possible to make a .fmt file for texinfo.
1025 \def\setfilename{%
1026 \fixbackslash % Turn off hack to swallow `\input texinfo'.
1027 \iflinks
1028 \tryauxfile
1029 % Open the new aux file. TeX will close it automatically at exit.
1030 \immediate\openout\auxfile=\jobname.aux
1031 \fi % \openindices needs to do some work in any case.
1032 \openindices
1033 \let\setfilename=\comment % Ignore extra @setfilename cmds.
1035 % If texinfo.cnf is present on the system, read it.
1036 % Useful for site-wide @afourpaper, etc.
1037 \openin 1 texinfo.cnf
1038 \ifeof 1 \else \input texinfo.cnf \fi
1039 \closein 1
1041 \comment % Ignore the actual filename.
1044 % Called from \setfilename.
1046 \def\openindices{%
1047 \newindex{cp}%
1048 \newcodeindex{fn}%
1049 \newcodeindex{vr}%
1050 \newcodeindex{tp}%
1051 \newcodeindex{ky}%
1052 \newcodeindex{pg}%
1055 % @bye.
1056 \outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
1059 \message{pdf,}
1060 % adobe `portable' document format
1061 \newcount\tempnum
1062 \newcount\lnkcount
1063 \newtoks\filename
1064 \newcount\filenamelength
1065 \newcount\pgn
1066 \newtoks\toksA
1067 \newtoks\toksB
1068 \newtoks\toksC
1069 \newtoks\toksD
1070 \newbox\boxA
1071 \newcount\countA
1072 \newif\ifpdf
1073 \newif\ifpdfmakepagedest
1075 % when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1
1076 % can be set). So we test for \relax and 0 as well as being undefined.
1077 \ifx\pdfoutput\thisisundefined
1078 \else
1079 \ifx\pdfoutput\relax
1080 \else
1081 \ifcase\pdfoutput
1082 \else
1083 \pdftrue
1088 % PDF uses PostScript string constants for the names of xref targets,
1089 % for display in the outlines, and in other places. Thus, we have to
1090 % double any backslashes. Otherwise, a name like "\node" will be
1091 % interpreted as a newline (\n), followed by o, d, e. Not good.
1092 % http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html
1093 % (and related messages, the final outcome is that it is up to the TeX
1094 % user to double the backslashes and otherwise make the string valid, so
1095 % that's what we do).
1097 % double active backslashes.
1099 {\catcode`\@=0 \catcode`\\=\active
1100 @gdef@activebackslashdouble{%
1101 @catcode`@\=@active
1102 @let\=@doublebackslash}
1105 % To handle parens, we must adopt a different approach, since parens are
1106 % not active characters. hyperref.dtx (which has the same problem as
1107 % us) handles it with this amazing macro to replace tokens, with minor
1108 % changes for Texinfo. It is included here under the GPL by permission
1109 % from the author, Heiko Oberdiek.
1111 % #1 is the tokens to replace.
1112 % #2 is the replacement.
1113 % #3 is the control sequence with the string.
1115 \def\HyPsdSubst#1#2#3{%
1116 \def\HyPsdReplace##1#1##2\END{%
1117 ##1%
1118 \ifx\\##2\\%
1119 \else
1121 \HyReturnAfterFi{%
1122 \HyPsdReplace##2\END
1126 \xdef#3{\expandafter\HyPsdReplace#3#1\END}%
1128 \long\def\HyReturnAfterFi#1\fi{\fi#1}
1130 % #1 is a control sequence in which to do the replacements.
1131 \def\backslashparens#1{%
1132 \xdef#1{#1}% redefine it as its expansion; the definition is simply
1133 % \lastnode when called from \setref -> \pdfmkdest.
1134 \HyPsdSubst{(}{\realbackslash(}{#1}%
1135 \HyPsdSubst{)}{\realbackslash)}{#1}%
1138 \newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images
1139 with PDF output, and none of those formats could be found. (.eps cannot
1140 be supported due to the design of the PDF format; use regular TeX (DVI
1141 output) for that.)}
1143 \ifpdf
1145 % Color manipulation macros based on pdfcolor.tex,
1146 % except using rgb instead of cmyk; the latter is said to render as a
1147 % very dark gray on-screen and a very dark halftone in print, instead
1148 % of actual black.
1149 \def\rgbDarkRed{0.50 0.09 0.12}
1150 \def\rgbBlack{0 0 0}
1152 % k sets the color for filling (usual text, etc.);
1153 % K sets the color for stroking (thin rules, e.g., normal _'s).
1154 \def\pdfsetcolor#1{\pdfliteral{#1 rg #1 RG}}
1156 % Set color, and create a mark which defines \thiscolor accordingly,
1157 % so that \makeheadline knows which color to restore.
1158 \def\setcolor#1{%
1159 \xdef\lastcolordefs{\gdef\noexpand\thiscolor{#1}}%
1160 \domark
1161 \pdfsetcolor{#1}%
1164 \def\maincolor{\rgbBlack}
1165 \pdfsetcolor{\maincolor}
1166 \edef\thiscolor{\maincolor}
1167 \def\lastcolordefs{}
1169 \def\makefootline{%
1170 \baselineskip24pt
1171 \line{\pdfsetcolor{\maincolor}\the\footline}%
1174 \def\makeheadline{%
1175 \vbox to 0pt{%
1176 \vskip-22.5pt
1177 \line{%
1178 \vbox to8.5pt{}%
1179 % Extract \thiscolor definition from the marks.
1180 \getcolormarks
1181 % Typeset the headline with \maincolor, then restore the color.
1182 \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}%
1184 \vss
1186 \nointerlineskip
1190 \pdfcatalog{/PageMode /UseOutlines}
1192 % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto).
1193 \def\dopdfimage#1#2#3{%
1194 \def\imagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}%
1195 \def\imageheight{#3}\setbox2 = \hbox{\ignorespaces #3}%
1197 % pdftex (and the PDF format) support .png, .jpg, .pdf (among
1198 % others). Let's try in that order.
1199 \let\pdfimgext=\empty
1200 \begingroup
1201 \openin 1 #1.png \ifeof 1
1202 \openin 1 #1.jpg \ifeof 1
1203 \openin 1 #1.jpeg \ifeof 1
1204 \openin 1 #1.JPG \ifeof 1
1205 \openin 1 #1.pdf \ifeof 1
1206 \openin 1 #1.PDF \ifeof 1
1207 \errhelp = \nopdfimagehelp
1208 \errmessage{Could not find image file #1 for pdf}%
1209 \else \gdef\pdfimgext{PDF}%
1211 \else \gdef\pdfimgext{pdf}%
1213 \else \gdef\pdfimgext{JPG}%
1215 \else \gdef\pdfimgext{jpeg}%
1217 \else \gdef\pdfimgext{jpg}%
1219 \else \gdef\pdfimgext{png}%
1221 \closein 1
1222 \endgroup
1224 % without \immediate, ancient pdftex seg faults when the same image is
1225 % included twice. (Version 3.14159-pre-1.0-unofficial-20010704.)
1226 \ifnum\pdftexversion < 14
1227 \immediate\pdfimage
1228 \else
1229 \immediate\pdfximage
1231 \ifdim \wd0 >0pt width \imagewidth \fi
1232 \ifdim \wd2 >0pt height \imageheight \fi
1233 \ifnum\pdftexversion<13
1234 #1.\pdfimgext
1235 \else
1236 {#1.\pdfimgext}%
1238 \ifnum\pdftexversion < 14 \else
1239 \pdfrefximage \pdflastximage
1240 \fi}
1242 \def\pdfmkdest#1{{%
1243 % We have to set dummies so commands such as @code, and characters
1244 % such as \, aren't expanded when present in a section title.
1245 \indexnofonts
1246 \turnoffactive
1247 \activebackslashdouble
1248 \makevalueexpandable
1249 \def\pdfdestname{#1}%
1250 \backslashparens\pdfdestname
1251 \safewhatsit{\pdfdest name{\pdfdestname} xyz}%
1254 % used to mark target names; must be expandable.
1255 \def\pdfmkpgn#1{#1}
1257 % by default, use a color that is dark enough to print on paper as
1258 % nearly black, but still distinguishable for online viewing.
1259 \def\urlcolor{\rgbDarkRed}
1260 \def\linkcolor{\rgbDarkRed}
1261 \def\endlink{\setcolor{\maincolor}\pdfendlink}
1263 % Adding outlines to PDF; macros for calculating structure of outlines
1264 % come from Petr Olsak
1265 \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0%
1266 \else \csname#1\endcsname \fi}
1267 \def\advancenumber#1{\tempnum=\expnumber{#1}\relax
1268 \advance\tempnum by 1
1269 \expandafter\xdef\csname#1\endcsname{\the\tempnum}}
1271 % #1 is the section text, which is what will be displayed in the
1272 % outline by the pdf viewer. #2 is the pdf expression for the number
1273 % of subentries (or empty, for subsubsections). #3 is the node text,
1274 % which might be empty if this toc entry had no corresponding node.
1275 % #4 is the page number
1277 \def\dopdfoutline#1#2#3#4{%
1278 % Generate a link to the node text if that exists; else, use the
1279 % page number. We could generate a destination for the section
1280 % text in the case where a section has no node, but it doesn't
1281 % seem worth the trouble, since most documents are normally structured.
1282 \def\pdfoutlinedest{#3}%
1283 \ifx\pdfoutlinedest\empty
1284 \def\pdfoutlinedest{#4}%
1285 \else
1286 % Doubled backslashes in the name.
1287 {\activebackslashdouble \xdef\pdfoutlinedest{#3}%
1288 \backslashparens\pdfoutlinedest}%
1291 % Also double the backslashes in the display string.
1292 {\activebackslashdouble \xdef\pdfoutlinetext{#1}%
1293 \backslashparens\pdfoutlinetext}%
1295 \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{\pdfoutlinetext}%
1298 \def\pdfmakeoutlines{%
1299 \begingroup
1300 % Thanh's hack / proper braces in bookmarks
1301 \edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace
1302 \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace
1304 % Read toc silently, to get counts of subentries for \pdfoutline.
1305 \def\partentry##1##2##3##4{}% ignore parts in the outlines
1306 \def\numchapentry##1##2##3##4{%
1307 \def\thischapnum{##2}%
1308 \def\thissecnum{0}%
1309 \def\thissubsecnum{0}%
1311 \def\numsecentry##1##2##3##4{%
1312 \advancenumber{chap\thischapnum}%
1313 \def\thissecnum{##2}%
1314 \def\thissubsecnum{0}%
1316 \def\numsubsecentry##1##2##3##4{%
1317 \advancenumber{sec\thissecnum}%
1318 \def\thissubsecnum{##2}%
1320 \def\numsubsubsecentry##1##2##3##4{%
1321 \advancenumber{subsec\thissubsecnum}%
1323 \def\thischapnum{0}%
1324 \def\thissecnum{0}%
1325 \def\thissubsecnum{0}%
1327 % use \def rather than \let here because we redefine \chapentry et
1328 % al. a second time, below.
1329 \def\appentry{\numchapentry}%
1330 \def\appsecentry{\numsecentry}%
1331 \def\appsubsecentry{\numsubsecentry}%
1332 \def\appsubsubsecentry{\numsubsubsecentry}%
1333 \def\unnchapentry{\numchapentry}%
1334 \def\unnsecentry{\numsecentry}%
1335 \def\unnsubsecentry{\numsubsecentry}%
1336 \def\unnsubsubsecentry{\numsubsubsecentry}%
1337 \readdatafile{toc}%
1339 % Read toc second time, this time actually producing the outlines.
1340 % The `-' means take the \expnumber as the absolute number of
1341 % subentries, which we calculated on our first read of the .toc above.
1343 % We use the node names as the destinations.
1344 \def\numchapentry##1##2##3##4{%
1345 \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}%
1346 \def\numsecentry##1##2##3##4{%
1347 \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}%
1348 \def\numsubsecentry##1##2##3##4{%
1349 \dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}%
1350 \def\numsubsubsecentry##1##2##3##4{% count is always zero
1351 \dopdfoutline{##1}{}{##3}{##4}}%
1353 % PDF outlines are displayed using system fonts, instead of
1354 % document fonts. Therefore we cannot use special characters,
1355 % since the encoding is unknown. For example, the eogonek from
1356 % Latin 2 (0xea) gets translated to a | character. Info from
1357 % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100.
1359 % xx to do this right, we have to translate 8-bit characters to
1360 % their "best" equivalent, based on the @documentencoding. Right
1361 % now, I guess we'll just let the pdf reader have its way.
1362 \indexnofonts
1363 \setupdatafile
1364 \catcode`\\=\active \otherbackslash
1365 \input \tocreadfilename
1366 \endgroup
1369 \def\skipspaces#1{\def\PP{#1}\def\D{|}%
1370 \ifx\PP\D\let\nextsp\relax
1371 \else\let\nextsp\skipspaces
1372 \ifx\p\space\else\addtokens{\filename}{\PP}%
1373 \advance\filenamelength by 1
1376 \nextsp}
1377 \def\getfilename#1{\filenamelength=0\expandafter\skipspaces#1|\relax}
1378 \ifnum\pdftexversion < 14
1379 \let \startlink \pdfannotlink
1380 \else
1381 \let \startlink \pdfstartlink
1383 % make a live url in pdf output.
1384 \def\pdfurl#1{%
1385 \begingroup
1386 % it seems we really need yet another set of dummies; have not
1387 % tried to figure out what each command should do in the context
1388 % of @url. for now, just make @/ a no-op, that's the only one
1389 % people have actually reported a problem with.
1391 \normalturnoffactive
1392 \def\@{@}%
1393 \let\/=\empty
1394 \makevalueexpandable
1395 % do we want to go so far as to use \indexnofonts instead of just
1396 % special-casing \var here?
1397 \def\var##1{##1}%
1399 \leavevmode\setcolor{\urlcolor}%
1400 \startlink attr{/Border [0 0 0]}%
1401 user{/Subtype /Link /A << /S /URI /URI (#1) >>}%
1402 \endgroup}
1403 \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}}
1404 \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
1405 \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks}
1406 \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}}
1407 \def\maketoks{%
1408 \expandafter\poptoks\the\toksA|ENDTOKS|\relax
1409 \ifx\first0\adn0
1410 \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3
1411 \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6
1412 \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9
1413 \else
1414 \ifnum0=\countA\else\makelink\fi
1415 \ifx\first.\let\next=\done\else
1416 \let\next=\maketoks
1417 \addtokens{\toksB}{\the\toksD}
1418 \ifx\first,\addtokens{\toksB}{\space}\fi
1420 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
1421 \next}
1422 \def\makelink{\addtokens{\toksB}%
1423 {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0}
1424 \def\pdflink#1{%
1425 \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}}
1426 \setcolor{\linkcolor}#1\endlink}
1427 \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
1428 \else
1429 % non-pdf mode
1430 \let\pdfmkdest = \gobble
1431 \let\pdfurl = \gobble
1432 \let\endlink = \relax
1433 \let\setcolor = \gobble
1434 \let\pdfsetcolor = \gobble
1435 \let\pdfmakeoutlines = \relax
1436 \fi % \ifx\pdfoutput
1439 \message{fonts,}
1441 % Change the current font style to #1, remembering it in \curfontstyle.
1442 % For now, we do not accumulate font styles: @b{@i{foo}} prints foo in
1443 % italics, not bold italics.
1445 \def\setfontstyle#1{%
1446 \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd.
1447 \csname ten#1\endcsname % change the current font
1450 % Select #1 fonts with the current style.
1452 \def\selectfonts#1{\csname #1fonts\endcsname \csname\curfontstyle\endcsname}
1454 \def\rm{\fam=0 \setfontstyle{rm}}
1455 \def\it{\fam=\itfam \setfontstyle{it}}
1456 \def\sl{\fam=\slfam \setfontstyle{sl}}
1457 \def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf}
1458 \def\tt{\fam=\ttfam \setfontstyle{tt}}
1460 % Unfortunately, we have to override this for titles and the like, since
1461 % in those cases "rm" is bold. Sigh.
1462 \def\rmisbold{\rm\def\curfontstyle{bf}}
1464 % Texinfo sort of supports the sans serif font style, which plain TeX does not.
1465 % So we set up a \sf.
1466 \newfam\sffam
1467 \def\sf{\fam=\sffam \setfontstyle{sf}}
1468 \let\li = \sf % Sometimes we call it \li, not \sf.
1470 % We don't need math for this font style.
1471 \def\ttsl{\setfontstyle{ttsl}}
1474 % Default leading.
1475 \newdimen\textleading \textleading = 13.2pt
1477 % Set the baselineskip to #1, and the lineskip and strut size
1478 % correspondingly. There is no deep meaning behind these magic numbers
1479 % used as factors; they just match (closely enough) what Knuth defined.
1481 \def\lineskipfactor{.08333}
1482 \def\strutheightpercent{.70833}
1483 \def\strutdepthpercent {.29167}
1485 % can get a sort of poor man's double spacing by redefining this.
1486 \def\baselinefactor{1}
1488 \def\setleading#1{%
1489 \dimen0 = #1\relax
1490 \normalbaselineskip = \baselinefactor\dimen0
1491 \normallineskip = \lineskipfactor\normalbaselineskip
1492 \normalbaselines
1493 \setbox\strutbox =\hbox{%
1494 \vrule width0pt height\strutheightpercent\baselineskip
1495 depth \strutdepthpercent \baselineskip
1499 % PDF CMaps. See also LaTeX's t1.cmap.
1501 % do nothing with this by default.
1502 \expandafter\let\csname cmapOT1\endcsname\gobble
1503 \expandafter\let\csname cmapOT1IT\endcsname\gobble
1504 \expandafter\let\csname cmapOT1TT\endcsname\gobble
1506 % if we are producing pdf, and we have \pdffontattr, then define cmaps.
1507 % (\pdffontattr was introduced many years ago, but people still run
1508 % older pdftex's; it's easy to conditionalize, so we do.)
1509 \ifpdf \ifx\pdffontattr\thisisundefined \else
1510 \begingroup
1511 \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
1512 \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
1513 %%DocumentNeededResources: ProcSet (CIDInit)
1514 %%IncludeResource: ProcSet (CIDInit)
1515 %%BeginResource: CMap (TeX-OT1-0)
1516 %%Title: (TeX-OT1-0 TeX OT1 0)
1517 %%Version: 1.000
1518 %%EndComments
1519 /CIDInit /ProcSet findresource begin
1520 12 dict begin
1521 begincmap
1522 /CIDSystemInfo
1523 << /Registry (TeX)
1524 /Ordering (OT1)
1525 /Supplement 0
1526 >> def
1527 /CMapName /TeX-OT1-0 def
1528 /CMapType 2 def
1529 1 begincodespacerange
1530 <00> <7F>
1531 endcodespacerange
1532 8 beginbfrange
1533 <00> <01> <0393>
1534 <09> <0A> <03A8>
1535 <23> <26> <0023>
1536 <28> <3B> <0028>
1537 <3F> <5B> <003F>
1538 <5D> <5E> <005D>
1539 <61> <7A> <0061>
1540 <7B> <7C> <2013>
1541 endbfrange
1542 40 beginbfchar
1543 <02> <0398>
1544 <03> <039B>
1545 <04> <039E>
1546 <05> <03A0>
1547 <06> <03A3>
1548 <07> <03D2>
1549 <08> <03A6>
1550 <0B> <00660066>
1551 <0C> <00660069>
1552 <0D> <0066006C>
1553 <0E> <006600660069>
1554 <0F> <00660066006C>
1555 <10> <0131>
1556 <11> <0237>
1557 <12> <0060>
1558 <13> <00B4>
1559 <14> <02C7>
1560 <15> <02D8>
1561 <16> <00AF>
1562 <17> <02DA>
1563 <18> <00B8>
1564 <19> <00DF>
1565 <1A> <00E6>
1566 <1B> <0153>
1567 <1C> <00F8>
1568 <1D> <00C6>
1569 <1E> <0152>
1570 <1F> <00D8>
1571 <21> <0021>
1572 <22> <201D>
1573 <27> <2019>
1574 <3C> <00A1>
1575 <3D> <003D>
1576 <3E> <00BF>
1577 <5C> <201C>
1578 <5F> <02D9>
1579 <60> <2018>
1580 <7D> <02DD>
1581 <7E> <007E>
1582 <7F> <00A8>
1583 endbfchar
1584 endcmap
1585 CMapName currentdict /CMap defineresource pop
1588 %%EndResource
1589 %%EOF
1590 }\endgroup
1591 \expandafter\edef\csname cmapOT1\endcsname#1{%
1592 \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
1595 % \cmapOT1IT
1596 \begingroup
1597 \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
1598 \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
1599 %%DocumentNeededResources: ProcSet (CIDInit)
1600 %%IncludeResource: ProcSet (CIDInit)
1601 %%BeginResource: CMap (TeX-OT1IT-0)
1602 %%Title: (TeX-OT1IT-0 TeX OT1IT 0)
1603 %%Version: 1.000
1604 %%EndComments
1605 /CIDInit /ProcSet findresource begin
1606 12 dict begin
1607 begincmap
1608 /CIDSystemInfo
1609 << /Registry (TeX)
1610 /Ordering (OT1IT)
1611 /Supplement 0
1612 >> def
1613 /CMapName /TeX-OT1IT-0 def
1614 /CMapType 2 def
1615 1 begincodespacerange
1616 <00> <7F>
1617 endcodespacerange
1618 8 beginbfrange
1619 <00> <01> <0393>
1620 <09> <0A> <03A8>
1621 <25> <26> <0025>
1622 <28> <3B> <0028>
1623 <3F> <5B> <003F>
1624 <5D> <5E> <005D>
1625 <61> <7A> <0061>
1626 <7B> <7C> <2013>
1627 endbfrange
1628 42 beginbfchar
1629 <02> <0398>
1630 <03> <039B>
1631 <04> <039E>
1632 <05> <03A0>
1633 <06> <03A3>
1634 <07> <03D2>
1635 <08> <03A6>
1636 <0B> <00660066>
1637 <0C> <00660069>
1638 <0D> <0066006C>
1639 <0E> <006600660069>
1640 <0F> <00660066006C>
1641 <10> <0131>
1642 <11> <0237>
1643 <12> <0060>
1644 <13> <00B4>
1645 <14> <02C7>
1646 <15> <02D8>
1647 <16> <00AF>
1648 <17> <02DA>
1649 <18> <00B8>
1650 <19> <00DF>
1651 <1A> <00E6>
1652 <1B> <0153>
1653 <1C> <00F8>
1654 <1D> <00C6>
1655 <1E> <0152>
1656 <1F> <00D8>
1657 <21> <0021>
1658 <22> <201D>
1659 <23> <0023>
1660 <24> <00A3>
1661 <27> <2019>
1662 <3C> <00A1>
1663 <3D> <003D>
1664 <3E> <00BF>
1665 <5C> <201C>
1666 <5F> <02D9>
1667 <60> <2018>
1668 <7D> <02DD>
1669 <7E> <007E>
1670 <7F> <00A8>
1671 endbfchar
1672 endcmap
1673 CMapName currentdict /CMap defineresource pop
1676 %%EndResource
1677 %%EOF
1678 }\endgroup
1679 \expandafter\edef\csname cmapOT1IT\endcsname#1{%
1680 \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
1683 % \cmapOT1TT
1684 \begingroup
1685 \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
1686 \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
1687 %%DocumentNeededResources: ProcSet (CIDInit)
1688 %%IncludeResource: ProcSet (CIDInit)
1689 %%BeginResource: CMap (TeX-OT1TT-0)
1690 %%Title: (TeX-OT1TT-0 TeX OT1TT 0)
1691 %%Version: 1.000
1692 %%EndComments
1693 /CIDInit /ProcSet findresource begin
1694 12 dict begin
1695 begincmap
1696 /CIDSystemInfo
1697 << /Registry (TeX)
1698 /Ordering (OT1TT)
1699 /Supplement 0
1700 >> def
1701 /CMapName /TeX-OT1TT-0 def
1702 /CMapType 2 def
1703 1 begincodespacerange
1704 <00> <7F>
1705 endcodespacerange
1706 5 beginbfrange
1707 <00> <01> <0393>
1708 <09> <0A> <03A8>
1709 <21> <26> <0021>
1710 <28> <5F> <0028>
1711 <61> <7E> <0061>
1712 endbfrange
1713 32 beginbfchar
1714 <02> <0398>
1715 <03> <039B>
1716 <04> <039E>
1717 <05> <03A0>
1718 <06> <03A3>
1719 <07> <03D2>
1720 <08> <03A6>
1721 <0B> <2191>
1722 <0C> <2193>
1723 <0D> <0027>
1724 <0E> <00A1>
1725 <0F> <00BF>
1726 <10> <0131>
1727 <11> <0237>
1728 <12> <0060>
1729 <13> <00B4>
1730 <14> <02C7>
1731 <15> <02D8>
1732 <16> <00AF>
1733 <17> <02DA>
1734 <18> <00B8>
1735 <19> <00DF>
1736 <1A> <00E6>
1737 <1B> <0153>
1738 <1C> <00F8>
1739 <1D> <00C6>
1740 <1E> <0152>
1741 <1F> <00D8>
1742 <20> <2423>
1743 <27> <2019>
1744 <60> <2018>
1745 <7F> <00A8>
1746 endbfchar
1747 endcmap
1748 CMapName currentdict /CMap defineresource pop
1751 %%EndResource
1752 %%EOF
1753 }\endgroup
1754 \expandafter\edef\csname cmapOT1TT\endcsname#1{%
1755 \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
1757 \fi\fi
1760 % Set the font macro #1 to the font named #2, adding on the
1761 % specified font prefix (normally `cm').
1762 % #3 is the font's design size, #4 is a scale factor, #5 is the CMap
1763 % encoding (currently only OT1, OT1IT and OT1TT are allowed, pass
1764 % empty to omit).
1765 \def\setfont#1#2#3#4#5{%
1766 \font#1=\fontprefix#2#3 scaled #4
1767 \csname cmap#5\endcsname#1%
1769 % This is what gets called when #5 of \setfont is empty.
1770 \let\cmap\gobble
1771 % emacs-page end of cmaps
1773 % Use cm as the default font prefix.
1774 % To specify the font prefix, you must define \fontprefix
1775 % before you read in texinfo.tex.
1776 \ifx\fontprefix\thisisundefined
1777 \def\fontprefix{cm}
1779 % Support font families that don't use the same naming scheme as CM.
1780 \def\rmshape{r}
1781 \def\rmbshape{bx} %where the normal face is bold
1782 \def\bfshape{b}
1783 \def\bxshape{bx}
1784 \def\ttshape{tt}
1785 \def\ttbshape{tt}
1786 \def\ttslshape{sltt}
1787 \def\itshape{ti}
1788 \def\itbshape{bxti}
1789 \def\slshape{sl}
1790 \def\slbshape{bxsl}
1791 \def\sfshape{ss}
1792 \def\sfbshape{ss}
1793 \def\scshape{csc}
1794 \def\scbshape{csc}
1796 % Definitions for a main text size of 11pt. This is the default in
1797 % Texinfo.
1799 \def\definetextfontsizexi{%
1800 % Text fonts (11.2pt, magstep1).
1801 \def\textnominalsize{11pt}
1802 \edef\mainmagstep{\magstephalf}
1803 \setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
1804 \setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
1805 \setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
1806 \setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
1807 \setfont\textsl\slshape{10}{\mainmagstep}{OT1}
1808 \setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
1809 \setfont\textsc\scshape{10}{\mainmagstep}{OT1}
1810 \setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
1811 \font\texti=cmmi10 scaled \mainmagstep
1812 \font\textsy=cmsy10 scaled \mainmagstep
1813 \def\textecsize{1095}
1815 % A few fonts for @defun names and args.
1816 \setfont\defbf\bfshape{10}{\magstep1}{OT1}
1817 \setfont\deftt\ttshape{10}{\magstep1}{OT1TT}
1818 \setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT}
1819 \def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf}
1821 % Fonts for indices, footnotes, small examples (9pt).
1822 \def\smallnominalsize{9pt}
1823 \setfont\smallrm\rmshape{9}{1000}{OT1}
1824 \setfont\smalltt\ttshape{9}{1000}{OT1TT}
1825 \setfont\smallbf\bfshape{10}{900}{OT1}
1826 \setfont\smallit\itshape{9}{1000}{OT1IT}
1827 \setfont\smallsl\slshape{9}{1000}{OT1}
1828 \setfont\smallsf\sfshape{9}{1000}{OT1}
1829 \setfont\smallsc\scshape{10}{900}{OT1}
1830 \setfont\smallttsl\ttslshape{10}{900}{OT1TT}
1831 \font\smalli=cmmi9
1832 \font\smallsy=cmsy9
1833 \def\smallecsize{0900}
1835 % Fonts for small examples (8pt).
1836 \def\smallernominalsize{8pt}
1837 \setfont\smallerrm\rmshape{8}{1000}{OT1}
1838 \setfont\smallertt\ttshape{8}{1000}{OT1TT}
1839 \setfont\smallerbf\bfshape{10}{800}{OT1}
1840 \setfont\smallerit\itshape{8}{1000}{OT1IT}
1841 \setfont\smallersl\slshape{8}{1000}{OT1}
1842 \setfont\smallersf\sfshape{8}{1000}{OT1}
1843 \setfont\smallersc\scshape{10}{800}{OT1}
1844 \setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
1845 \font\smalleri=cmmi8
1846 \font\smallersy=cmsy8
1847 \def\smallerecsize{0800}
1849 % Fonts for title page (20.4pt):
1850 \def\titlenominalsize{20pt}
1851 \setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
1852 \setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
1853 \setfont\titlesl\slbshape{10}{\magstep4}{OT1}
1854 \setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
1855 \setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
1856 \setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
1857 \let\titlebf=\titlerm
1858 \setfont\titlesc\scbshape{10}{\magstep4}{OT1}
1859 \font\titlei=cmmi12 scaled \magstep3
1860 \font\titlesy=cmsy10 scaled \magstep4
1861 \def\titleecsize{2074}
1863 % Chapter (and unnumbered) fonts (17.28pt).
1864 \def\chapnominalsize{17pt}
1865 \setfont\chaprm\rmbshape{12}{\magstep2}{OT1}
1866 \setfont\chapit\itbshape{10}{\magstep3}{OT1IT}
1867 \setfont\chapsl\slbshape{10}{\magstep3}{OT1}
1868 \setfont\chaptt\ttbshape{12}{\magstep2}{OT1TT}
1869 \setfont\chapttsl\ttslshape{10}{\magstep3}{OT1TT}
1870 \setfont\chapsf\sfbshape{17}{1000}{OT1}
1871 \let\chapbf=\chaprm
1872 \setfont\chapsc\scbshape{10}{\magstep3}{OT1}
1873 \font\chapi=cmmi12 scaled \magstep2
1874 \font\chapsy=cmsy10 scaled \magstep3
1875 \def\chapecsize{1728}
1877 % Section fonts (14.4pt).
1878 \def\secnominalsize{14pt}
1879 \setfont\secrm\rmbshape{12}{\magstep1}{OT1}
1880 \setfont\secit\itbshape{10}{\magstep2}{OT1IT}
1881 \setfont\secsl\slbshape{10}{\magstep2}{OT1}
1882 \setfont\sectt\ttbshape{12}{\magstep1}{OT1TT}
1883 \setfont\secttsl\ttslshape{10}{\magstep2}{OT1TT}
1884 \setfont\secsf\sfbshape{12}{\magstep1}{OT1}
1885 \let\secbf\secrm
1886 \setfont\secsc\scbshape{10}{\magstep2}{OT1}
1887 \font\seci=cmmi12 scaled \magstep1
1888 \font\secsy=cmsy10 scaled \magstep2
1889 \def\sececsize{1440}
1891 % Subsection fonts (13.15pt).
1892 \def\ssecnominalsize{13pt}
1893 \setfont\ssecrm\rmbshape{12}{\magstephalf}{OT1}
1894 \setfont\ssecit\itbshape{10}{1315}{OT1IT}
1895 \setfont\ssecsl\slbshape{10}{1315}{OT1}
1896 \setfont\ssectt\ttbshape{12}{\magstephalf}{OT1TT}
1897 \setfont\ssecttsl\ttslshape{10}{1315}{OT1TT}
1898 \setfont\ssecsf\sfbshape{12}{\magstephalf}{OT1}
1899 \let\ssecbf\ssecrm
1900 \setfont\ssecsc\scbshape{10}{1315}{OT1}
1901 \font\sseci=cmmi12 scaled \magstephalf
1902 \font\ssecsy=cmsy10 scaled 1315
1903 \def\ssececsize{1200}
1905 % Reduced fonts for @acro in text (10pt).
1906 \def\reducednominalsize{10pt}
1907 \setfont\reducedrm\rmshape{10}{1000}{OT1}
1908 \setfont\reducedtt\ttshape{10}{1000}{OT1TT}
1909 \setfont\reducedbf\bfshape{10}{1000}{OT1}
1910 \setfont\reducedit\itshape{10}{1000}{OT1IT}
1911 \setfont\reducedsl\slshape{10}{1000}{OT1}
1912 \setfont\reducedsf\sfshape{10}{1000}{OT1}
1913 \setfont\reducedsc\scshape{10}{1000}{OT1}
1914 \setfont\reducedttsl\ttslshape{10}{1000}{OT1TT}
1915 \font\reducedi=cmmi10
1916 \font\reducedsy=cmsy10
1917 \def\reducedecsize{1000}
1919 \textleading = 13.2pt % line spacing for 11pt CM
1920 \textfonts % reset the current fonts
1922 } % end of 11pt text font size definitions
1925 % Definitions to make the main text be 10pt Computer Modern, with
1926 % section, chapter, etc., sizes following suit. This is for the GNU
1927 % Press printing of the Emacs 22 manual. Maybe other manuals in the
1928 % future. Used with @smallbook, which sets the leading to 12pt.
1930 \def\definetextfontsizex{%
1931 % Text fonts (10pt).
1932 \def\textnominalsize{10pt}
1933 \edef\mainmagstep{1000}
1934 \setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
1935 \setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
1936 \setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
1937 \setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
1938 \setfont\textsl\slshape{10}{\mainmagstep}{OT1}
1939 \setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
1940 \setfont\textsc\scshape{10}{\mainmagstep}{OT1}
1941 \setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
1942 \font\texti=cmmi10 scaled \mainmagstep
1943 \font\textsy=cmsy10 scaled \mainmagstep
1944 \def\textecsize{1000}
1946 % A few fonts for @defun names and args.
1947 \setfont\defbf\bfshape{10}{\magstephalf}{OT1}
1948 \setfont\deftt\ttshape{10}{\magstephalf}{OT1TT}
1949 \setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT}
1950 \def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf}
1952 % Fonts for indices, footnotes, small examples (9pt).
1953 \def\smallnominalsize{9pt}
1954 \setfont\smallrm\rmshape{9}{1000}{OT1}
1955 \setfont\smalltt\ttshape{9}{1000}{OT1TT}
1956 \setfont\smallbf\bfshape{10}{900}{OT1}
1957 \setfont\smallit\itshape{9}{1000}{OT1IT}
1958 \setfont\smallsl\slshape{9}{1000}{OT1}
1959 \setfont\smallsf\sfshape{9}{1000}{OT1}
1960 \setfont\smallsc\scshape{10}{900}{OT1}
1961 \setfont\smallttsl\ttslshape{10}{900}{OT1TT}
1962 \font\smalli=cmmi9
1963 \font\smallsy=cmsy9
1964 \def\smallecsize{0900}
1966 % Fonts for small examples (8pt).
1967 \def\smallernominalsize{8pt}
1968 \setfont\smallerrm\rmshape{8}{1000}{OT1}
1969 \setfont\smallertt\ttshape{8}{1000}{OT1TT}
1970 \setfont\smallerbf\bfshape{10}{800}{OT1}
1971 \setfont\smallerit\itshape{8}{1000}{OT1IT}
1972 \setfont\smallersl\slshape{8}{1000}{OT1}
1973 \setfont\smallersf\sfshape{8}{1000}{OT1}
1974 \setfont\smallersc\scshape{10}{800}{OT1}
1975 \setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
1976 \font\smalleri=cmmi8
1977 \font\smallersy=cmsy8
1978 \def\smallerecsize{0800}
1980 % Fonts for title page (20.4pt):
1981 \def\titlenominalsize{20pt}
1982 \setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
1983 \setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
1984 \setfont\titlesl\slbshape{10}{\magstep4}{OT1}
1985 \setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
1986 \setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
1987 \setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
1988 \let\titlebf=\titlerm
1989 \setfont\titlesc\scbshape{10}{\magstep4}{OT1}
1990 \font\titlei=cmmi12 scaled \magstep3
1991 \font\titlesy=cmsy10 scaled \magstep4
1992 \def\titleecsize{2074}
1994 % Chapter fonts (14.4pt).
1995 \def\chapnominalsize{14pt}
1996 \setfont\chaprm\rmbshape{12}{\magstep1}{OT1}
1997 \setfont\chapit\itbshape{10}{\magstep2}{OT1IT}
1998 \setfont\chapsl\slbshape{10}{\magstep2}{OT1}
1999 \setfont\chaptt\ttbshape{12}{\magstep1}{OT1TT}
2000 \setfont\chapttsl\ttslshape{10}{\magstep2}{OT1TT}
2001 \setfont\chapsf\sfbshape{12}{\magstep1}{OT1}
2002 \let\chapbf\chaprm
2003 \setfont\chapsc\scbshape{10}{\magstep2}{OT1}
2004 \font\chapi=cmmi12 scaled \magstep1
2005 \font\chapsy=cmsy10 scaled \magstep2
2006 \def\chapecsize{1440}
2008 % Section fonts (12pt).
2009 \def\secnominalsize{12pt}
2010 \setfont\secrm\rmbshape{12}{1000}{OT1}
2011 \setfont\secit\itbshape{10}{\magstep1}{OT1IT}
2012 \setfont\secsl\slbshape{10}{\magstep1}{OT1}
2013 \setfont\sectt\ttbshape{12}{1000}{OT1TT}
2014 \setfont\secttsl\ttslshape{10}{\magstep1}{OT1TT}
2015 \setfont\secsf\sfbshape{12}{1000}{OT1}
2016 \let\secbf\secrm
2017 \setfont\secsc\scbshape{10}{\magstep1}{OT1}
2018 \font\seci=cmmi12
2019 \font\secsy=cmsy10 scaled \magstep1
2020 \def\sececsize{1200}
2022 % Subsection fonts (10pt).
2023 \def\ssecnominalsize{10pt}
2024 \setfont\ssecrm\rmbshape{10}{1000}{OT1}
2025 \setfont\ssecit\itbshape{10}{1000}{OT1IT}
2026 \setfont\ssecsl\slbshape{10}{1000}{OT1}
2027 \setfont\ssectt\ttbshape{10}{1000}{OT1TT}
2028 \setfont\ssecttsl\ttslshape{10}{1000}{OT1TT}
2029 \setfont\ssecsf\sfbshape{10}{1000}{OT1}
2030 \let\ssecbf\ssecrm
2031 \setfont\ssecsc\scbshape{10}{1000}{OT1}
2032 \font\sseci=cmmi10
2033 \font\ssecsy=cmsy10
2034 \def\ssececsize{1000}
2036 % Reduced fonts for @acro in text (9pt).
2037 \def\reducednominalsize{9pt}
2038 \setfont\reducedrm\rmshape{9}{1000}{OT1}
2039 \setfont\reducedtt\ttshape{9}{1000}{OT1TT}
2040 \setfont\reducedbf\bfshape{10}{900}{OT1}
2041 \setfont\reducedit\itshape{9}{1000}{OT1IT}
2042 \setfont\reducedsl\slshape{9}{1000}{OT1}
2043 \setfont\reducedsf\sfshape{9}{1000}{OT1}
2044 \setfont\reducedsc\scshape{10}{900}{OT1}
2045 \setfont\reducedttsl\ttslshape{10}{900}{OT1TT}
2046 \font\reducedi=cmmi9
2047 \font\reducedsy=cmsy9
2048 \def\reducedecsize{0900}
2050 \divide\parskip by 2 % reduce space between paragraphs
2051 \textleading = 12pt % line spacing for 10pt CM
2052 \textfonts % reset the current fonts
2054 } % end of 10pt text font size definitions
2057 % We provide the user-level command
2058 % @fonttextsize 10
2059 % (or 11) to redefine the text font size. pt is assumed.
2061 \def\xiword{11}
2062 \def\xword{10}
2063 \def\xwordpt{10pt}
2065 \parseargdef\fonttextsize{%
2066 \def\textsizearg{#1}%
2067 %\wlog{doing @fonttextsize \textsizearg}%
2069 % Set \globaldefs so that documents can use this inside @tex, since
2070 % makeinfo 4.8 does not support it, but we need it nonetheless.
2072 \begingroup \globaldefs=1
2073 \ifx\textsizearg\xword \definetextfontsizex
2074 \else \ifx\textsizearg\xiword \definetextfontsizexi
2075 \else
2076 \errhelp=\EMsimple
2077 \errmessage{@fonttextsize only supports `10' or `11', not `\textsizearg'}
2078 \fi\fi
2079 \endgroup
2083 % In order for the font changes to affect most math symbols and letters,
2084 % we have to define the \textfont of the standard families. Since
2085 % texinfo doesn't allow for producing subscripts and superscripts except
2086 % in the main text, we don't bother to reset \scriptfont and
2087 % \scriptscriptfont (which would also require loading a lot more fonts).
2089 \def\resetmathfonts{%
2090 \textfont0=\tenrm \textfont1=\teni \textfont2=\tensy
2091 \textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf
2092 \textfont\ttfam=\tentt \textfont\sffam=\tensf
2095 % The font-changing commands redefine the meanings of \tenSTYLE, instead
2096 % of just \STYLE. We do this because \STYLE needs to also set the
2097 % current \fam for math mode. Our \STYLE (e.g., \rm) commands hardwire
2098 % \tenSTYLE to set the current font.
2100 % Each font-changing command also sets the names \lsize (one size lower)
2101 % and \lllsize (three sizes lower). These relative commands are used in
2102 % the LaTeX logo and acronyms.
2104 % This all needs generalizing, badly.
2106 \def\textfonts{%
2107 \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl
2108 \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
2109 \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy
2110 \let\tenttsl=\textttsl
2111 \def\curfontsize{text}%
2112 \def\lsize{reduced}\def\lllsize{smaller}%
2113 \resetmathfonts \setleading{\textleading}}
2114 \def\titlefonts{%
2115 \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl
2116 \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc
2117 \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy
2118 \let\tenttsl=\titlettsl
2119 \def\curfontsize{title}%
2120 \def\lsize{chap}\def\lllsize{subsec}%
2121 \resetmathfonts \setleading{27pt}}
2122 \def\titlefont#1{{\titlefonts\rmisbold #1}}
2123 \def\chapfonts{%
2124 \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
2125 \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
2126 \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy
2127 \let\tenttsl=\chapttsl
2128 \def\curfontsize{chap}%
2129 \def\lsize{sec}\def\lllsize{text}%
2130 \resetmathfonts \setleading{19pt}}
2131 \def\secfonts{%
2132 \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl
2133 \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc
2134 \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy
2135 \let\tenttsl=\secttsl
2136 \def\curfontsize{sec}%
2137 \def\lsize{subsec}\def\lllsize{reduced}%
2138 \resetmathfonts \setleading{16pt}}
2139 \def\subsecfonts{%
2140 \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl
2141 \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc
2142 \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy
2143 \let\tenttsl=\ssecttsl
2144 \def\curfontsize{ssec}%
2145 \def\lsize{text}\def\lllsize{small}%
2146 \resetmathfonts \setleading{15pt}}
2147 \let\subsubsecfonts = \subsecfonts
2148 \def\reducedfonts{%
2149 \let\tenrm=\reducedrm \let\tenit=\reducedit \let\tensl=\reducedsl
2150 \let\tenbf=\reducedbf \let\tentt=\reducedtt \let\reducedcaps=\reducedsc
2151 \let\tensf=\reducedsf \let\teni=\reducedi \let\tensy=\reducedsy
2152 \let\tenttsl=\reducedttsl
2153 \def\curfontsize{reduced}%
2154 \def\lsize{small}\def\lllsize{smaller}%
2155 \resetmathfonts \setleading{10.5pt}}
2156 \def\smallfonts{%
2157 \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl
2158 \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc
2159 \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy
2160 \let\tenttsl=\smallttsl
2161 \def\curfontsize{small}%
2162 \def\lsize{smaller}\def\lllsize{smaller}%
2163 \resetmathfonts \setleading{10.5pt}}
2164 \def\smallerfonts{%
2165 \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl
2166 \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc
2167 \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy
2168 \let\tenttsl=\smallerttsl
2169 \def\curfontsize{smaller}%
2170 \def\lsize{smaller}\def\lllsize{smaller}%
2171 \resetmathfonts \setleading{9.5pt}}
2173 % Fonts for short table of contents.
2174 \setfont\shortcontrm\rmshape{12}{1000}{OT1}
2175 \setfont\shortcontbf\bfshape{10}{\magstep1}{OT1} % no cmb12
2176 \setfont\shortcontsl\slshape{12}{1000}{OT1}
2177 \setfont\shortconttt\ttshape{12}{1000}{OT1TT}
2179 % Define these just so they can be easily changed for other fonts.
2180 \def\angleleft{$\langle$}
2181 \def\angleright{$\rangle$}
2183 % Set the fonts to use with the @small... environments.
2184 \let\smallexamplefonts = \smallfonts
2186 % About \smallexamplefonts. If we use \smallfonts (9pt), @smallexample
2187 % can fit this many characters:
2188 % 8.5x11=86 smallbook=72 a4=90 a5=69
2189 % If we use \scriptfonts (8pt), then we can fit this many characters:
2190 % 8.5x11=90+ smallbook=80 a4=90+ a5=77
2191 % For me, subjectively, the few extra characters that fit aren't worth
2192 % the additional smallness of 8pt. So I'm making the default 9pt.
2194 % By the way, for comparison, here's what fits with @example (10pt):
2195 % 8.5x11=71 smallbook=60 a4=75 a5=58
2196 % --karl, 24jan03.
2198 % Set up the default fonts, so we can use them for creating boxes.
2200 \definetextfontsizexi
2203 \message{markup,}
2205 % Check if we are currently using a typewriter font. Since all the
2206 % Computer Modern typewriter fonts have zero interword stretch (and
2207 % shrink), and it is reasonable to expect all typewriter fonts to have
2208 % this property, we can check that font parameter.
2210 \def\ifmonospace{\ifdim\fontdimen3\font=0pt }
2212 % Markup style infrastructure. \defmarkupstylesetup\INITMACRO will
2213 % define and register \INITMACRO to be called on markup style changes.
2214 % \INITMACRO can check \currentmarkupstyle for the innermost
2215 % style and the set of \ifmarkupSTYLE switches for all styles
2216 % currently in effect.
2217 \newif\ifmarkupvar
2218 \newif\ifmarkupsamp
2219 \newif\ifmarkupkey
2220 %\newif\ifmarkupfile % @file == @samp.
2221 %\newif\ifmarkupoption % @option == @samp.
2222 \newif\ifmarkupcode
2223 \newif\ifmarkupkbd
2224 %\newif\ifmarkupenv % @env == @code.
2225 %\newif\ifmarkupcommand % @command == @code.
2226 \newif\ifmarkuptex % @tex (and part of @math, for now).
2227 \newif\ifmarkupexample
2228 \newif\ifmarkupverb
2229 \newif\ifmarkupverbatim
2231 \let\currentmarkupstyle\empty
2233 \def\setupmarkupstyle#1{%
2234 \csname markup#1true\endcsname
2235 \def\currentmarkupstyle{#1}%
2236 \markupstylesetup
2239 \let\markupstylesetup\empty
2241 \def\defmarkupstylesetup#1{%
2242 \expandafter\def\expandafter\markupstylesetup
2243 \expandafter{\markupstylesetup #1}%
2244 \def#1%
2247 % Markup style setup for left and right quotes.
2248 \defmarkupstylesetup\markupsetuplq{%
2249 \expandafter\let\expandafter \temp
2250 \csname markupsetuplq\currentmarkupstyle\endcsname
2251 \ifx\temp\relax \markupsetuplqdefault \else \temp \fi
2254 \defmarkupstylesetup\markupsetuprq{%
2255 \expandafter\let\expandafter \temp
2256 \csname markupsetuprq\currentmarkupstyle\endcsname
2257 \ifx\temp\relax \markupsetuprqdefault \else \temp \fi
2261 \catcode`\'=\active
2262 \catcode`\`=\active
2264 \gdef\markupsetuplqdefault{\let`\lq}
2265 \gdef\markupsetuprqdefault{\let'\rq}
2267 \gdef\markupsetcodequoteleft{\let`\codequoteleft}
2268 \gdef\markupsetcodequoteright{\let'\codequoteright}
2270 \gdef\markupsetnoligaturesquoteleft{\let`\noligaturesquoteleft}
2273 \let\markupsetuplqcode \markupsetcodequoteleft
2274 \let\markupsetuprqcode \markupsetcodequoteright
2276 \let\markupsetuplqexample \markupsetcodequoteleft
2277 \let\markupsetuprqexample \markupsetcodequoteright
2279 \let\markupsetuplqsamp \markupsetcodequoteleft
2280 \let\markupsetuprqsamp \markupsetcodequoteright
2282 \let\markupsetuplqverb \markupsetcodequoteleft
2283 \let\markupsetuprqverb \markupsetcodequoteright
2285 \let\markupsetuplqverbatim \markupsetcodequoteleft
2286 \let\markupsetuprqverbatim \markupsetcodequoteright
2288 \let\markupsetuplqkbd \markupsetnoligaturesquoteleft
2290 % Allow an option to not use regular directed right quote/apostrophe
2291 % (char 0x27), but instead the undirected quote from cmtt (char 0x0d).
2292 % The undirected quote is ugly, so don't make it the default, but it
2293 % works for pasting with more pdf viewers (at least evince), the
2294 % lilypond developers report. xpdf does work with the regular 0x27.
2296 \def\codequoteright{%
2297 \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax
2298 \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax
2300 \else \char'15 \fi
2301 \else \char'15 \fi
2304 % and a similar option for the left quote char vs. a grave accent.
2305 % Modern fonts display ASCII 0x60 as a grave accent, so some people like
2306 % the code environments to do likewise.
2308 \def\codequoteleft{%
2309 \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax
2310 \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax
2311 % [Knuth] pp. 380,381,391
2312 % \relax disables Spanish ligatures ?` and !` of \tt font.
2313 \relax`%
2314 \else \char'22 \fi
2315 \else \char'22 \fi
2318 % Commands to set the quote options.
2320 \parseargdef\codequoteundirected{%
2321 \def\temp{#1}%
2322 \ifx\temp\onword
2323 \expandafter\let\csname SETtxicodequoteundirected\endcsname
2324 = t%
2325 \else\ifx\temp\offword
2326 \expandafter\let\csname SETtxicodequoteundirected\endcsname
2327 = \relax
2328 \else
2329 \errhelp = \EMsimple
2330 \errmessage{Unknown @codequoteundirected value `\temp', must be on|off}%
2331 \fi\fi
2334 \parseargdef\codequotebacktick{%
2335 \def\temp{#1}%
2336 \ifx\temp\onword
2337 \expandafter\let\csname SETtxicodequotebacktick\endcsname
2338 = t%
2339 \else\ifx\temp\offword
2340 \expandafter\let\csname SETtxicodequotebacktick\endcsname
2341 = \relax
2342 \else
2343 \errhelp = \EMsimple
2344 \errmessage{Unknown @codequotebacktick value `\temp', must be on|off}%
2345 \fi\fi
2348 % [Knuth] pp. 380,381,391, disable Spanish ligatures ?` and !` of \tt font.
2349 \def\noligaturesquoteleft{\relax\lq}
2351 % Count depth in font-changes, for error checks
2352 \newcount\fontdepth \fontdepth=0
2354 % Font commands.
2356 % #1 is the font command (\sl or \it), #2 is the text to slant.
2357 % If we are in a monospaced environment, however, 1) always use \ttsl,
2358 % and 2) do not add an italic correction.
2359 \def\dosmartslant#1#2{%
2360 \ifusingtt
2361 {{\ttsl #2}\let\next=\relax}%
2362 {\def\next{{#1#2}\futurelet\next\smartitaliccorrection}}%
2363 \next
2365 \def\smartslanted{\dosmartslant\sl}
2366 \def\smartitalic{\dosmartslant\it}
2368 % Output an italic correction unless \next (presumed to be the following
2369 % character) is such as not to need one.
2370 \def\smartitaliccorrection{%
2371 \ifx\next,%
2372 \else\ifx\next-%
2373 \else\ifx\next.%
2374 \else\ptexslash
2375 \fi\fi\fi}
2377 % like \smartslanted except unconditionally uses \ttsl, and no ic.
2378 % @var is set to this for defun arguments.
2379 \def\ttslanted#1{{\ttsl #1}}
2381 % @cite is like \smartslanted except unconditionally use \sl. We never want
2382 % ttsl for book titles, do we?
2383 \def\cite#1{{\sl #1}\futurelet\next\smartitaliccorrection}
2385 \let\i=\smartitalic
2386 \let\slanted=\smartslanted
2387 \def\var#1{\smartslanted{#1}}
2388 \let\dfn=\smartslanted
2389 \let\emph=\smartitalic
2391 % Explicit font changes: @r, @sc, undocumented @ii.
2392 \def\r#1{{\rm #1}} % roman font
2393 \def\sc#1{{\smallcaps#1}} % smallcaps font
2394 \def\ii#1{{\it #1}} % italic font
2396 % @b, explicit bold. Also @strong.
2397 \def\b#1{{\bf #1}}
2398 \let\strong=\b
2400 % @sansserif, explicit sans.
2401 \def\sansserif#1{{\sf #1}}
2403 % We can't just use \exhyphenpenalty, because that only has effect at
2404 % the end of a paragraph. Restore normal hyphenation at the end of the
2405 % group within which \nohyphenation is presumably called.
2407 \def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation}
2408 \def\restorehyphenation{\hyphenchar\font = `- }
2410 % Set sfcode to normal for the chars that usually have another value.
2411 % Can't use plain's \frenchspacing because it uses the `\x notation, and
2412 % sometimes \x has an active definition that messes things up.
2414 \catcode`@=11
2415 \def\plainfrenchspacing{%
2416 \sfcode\dotChar =\@m \sfcode\questChar=\@m \sfcode\exclamChar=\@m
2417 \sfcode\colonChar=\@m \sfcode\semiChar =\@m \sfcode\commaChar =\@m
2418 \def\endofsentencespacefactor{1000}% for @. and friends
2420 \def\plainnonfrenchspacing{%
2421 \sfcode`\.3000\sfcode`\?3000\sfcode`\!3000
2422 \sfcode`\:2000\sfcode`\;1500\sfcode`\,1250
2423 \def\endofsentencespacefactor{3000}% for @. and friends
2425 \catcode`@=\other
2426 \def\endofsentencespacefactor{3000}% default
2428 % @t, explicit typewriter.
2429 \def\t#1{%
2430 {\tt \rawbackslash \plainfrenchspacing #1}%
2431 \null
2434 % @samp.
2435 \def\samp#1{{\setupmarkupstyle{samp}\lq\tclose{#1}\rq\null}}
2437 % definition of @key that produces a lozenge. Doesn't adjust to text size.
2438 %\setfont\keyrm\rmshape{8}{1000}{OT1}
2439 %\font\keysy=cmsy9
2440 %\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{%
2441 % \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
2442 % \vbox{\hrule\kern-0.4pt
2443 % \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
2444 % \kern-0.4pt\hrule}%
2445 % \kern-.06em\raise0.4pt\hbox{\angleright}}}}
2447 % definition of @key with no lozenge. If the current font is already
2448 % monospace, don't change it; that way, we respect @kbdinputstyle. But
2449 % if it isn't monospace, then use \tt.
2451 \def\key#1{{\setupmarkupstyle{key}%
2452 \nohyphenation
2453 \ifmonospace\else\tt\fi
2454 #1}\null}
2456 % ctrl is no longer a Texinfo command.
2457 \def\ctrl #1{{\tt \rawbackslash \hat}#1}
2459 % @file, @option are the same as @samp.
2460 \let\file=\samp
2461 \let\option=\samp
2463 % @code is a modification of @t,
2464 % which makes spaces the same size as normal in the surrounding text.
2465 \def\tclose#1{%
2467 % Change normal interword space to be same as for the current font.
2468 \spaceskip = \fontdimen2\font
2470 % Switch to typewriter.
2473 % But `\ ' produces the large typewriter interword space.
2474 \def\ {{\spaceskip = 0pt{} }}%
2476 % Turn off hyphenation.
2477 \nohyphenation
2479 \rawbackslash
2480 \plainfrenchspacing
2483 \null
2486 % We *must* turn on hyphenation at `-' and `_' in @code.
2487 % Otherwise, it is too hard to avoid overfull hboxes
2488 % in the Emacs manual, the Library manual, etc.
2490 % Unfortunately, TeX uses one parameter (\hyphenchar) to control
2491 % both hyphenation at - and hyphenation within words.
2492 % We must therefore turn them both off (\tclose does that)
2493 % and arrange explicitly to hyphenate at a dash.
2494 % -- rms.
2496 \catcode`\-=\active \catcode`\_=\active
2497 \catcode`\'=\active \catcode`\`=\active
2498 \global\let'=\rq \global\let`=\lq % default definitions
2500 \global\def\code{\begingroup
2501 \setupmarkupstyle{code}%
2502 % The following should really be moved into \setupmarkupstyle handlers.
2503 \catcode\dashChar=\active \catcode\underChar=\active
2504 \ifallowcodebreaks
2505 \let-\codedash
2506 \let_\codeunder
2507 \else
2508 \let-\realdash
2509 \let_\realunder
2511 \codex
2515 \def\codex #1{\tclose{#1}\endgroup}
2517 \def\realdash{-}
2518 \def\codedash{-\discretionary{}{}{}}
2519 \def\codeunder{%
2520 % this is all so @math{@code{var_name}+1} can work. In math mode, _
2521 % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.)
2522 % will therefore expand the active definition of _, which is us
2523 % (inside @code that is), therefore an endless loop.
2524 \ifusingtt{\ifmmode
2525 \mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_.
2526 \else\normalunderscore \fi
2527 \discretionary{}{}{}}%
2528 {\_}%
2531 % An additional complication: the above will allow breaks after, e.g.,
2532 % each of the four underscores in __typeof__. This is undesirable in
2533 % some manuals, especially if they don't have long identifiers in
2534 % general. @allowcodebreaks provides a way to control this.
2536 \newif\ifallowcodebreaks \allowcodebreakstrue
2538 \def\keywordtrue{true}
2539 \def\keywordfalse{false}
2541 \parseargdef\allowcodebreaks{%
2542 \def\txiarg{#1}%
2543 \ifx\txiarg\keywordtrue
2544 \allowcodebreakstrue
2545 \else\ifx\txiarg\keywordfalse
2546 \allowcodebreaksfalse
2547 \else
2548 \errhelp = \EMsimple
2549 \errmessage{Unknown @allowcodebreaks option `\txiarg', must be true|false}%
2550 \fi\fi
2553 % @uref (abbreviation for `urlref') takes an optional (comma-separated)
2554 % second argument specifying the text to display and an optional third
2555 % arg as text to display instead of (rather than in addition to) the url
2556 % itself. First (mandatory) arg is the url.
2557 % (This \urefnobreak definition isn't used now, leaving it for a while
2558 % for comparison.)
2559 \def\urefnobreak#1{\dourefnobreak #1,,,\finish}
2560 \def\dourefnobreak#1,#2,#3,#4\finish{\begingroup
2561 \unsepspaces
2562 \pdfurl{#1}%
2563 \setbox0 = \hbox{\ignorespaces #3}%
2564 \ifdim\wd0 > 0pt
2565 \unhbox0 % third arg given, show only that
2566 \else
2567 \setbox0 = \hbox{\ignorespaces #2}%
2568 \ifdim\wd0 > 0pt
2569 \ifpdf
2570 \unhbox0 % PDF: 2nd arg given, show only it
2571 \else
2572 \unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url
2574 \else
2575 \code{#1}% only url given, so show it
2578 \endlink
2579 \endgroup}
2581 % This \urefbreak definition is the active one.
2582 \def\urefbreak{\begingroup \urefcatcodes \dourefbreak}
2583 \let\uref=\urefbreak
2584 \def\dourefbreak#1{\urefbreakfinish #1,,,\finish}
2585 \def\urefbreakfinish#1,#2,#3,#4\finish{% doesn't work in @example
2586 \unsepspaces
2587 \pdfurl{#1}%
2588 \setbox0 = \hbox{\ignorespaces #3}%
2589 \ifdim\wd0 > 0pt
2590 \unhbox0 % third arg given, show only that
2591 \else
2592 \setbox0 = \hbox{\ignorespaces #2}%
2593 \ifdim\wd0 > 0pt
2594 \ifpdf
2595 \unhbox0 % PDF: 2nd arg given, show only it
2596 \else
2597 \unhbox0\ (\urefcode{#1})% DVI: 2nd arg given, show both it and url
2599 \else
2600 \urefcode{#1}% only url given, so show it
2603 \endlink
2604 \endgroup}
2606 % Allow line breaks around only a few characters (only).
2607 \def\urefcatcodes{%
2608 \catcode\ampChar=\active \catcode\dotChar=\active
2609 \catcode\hashChar=\active \catcode\questChar=\active
2610 \catcode\slashChar=\active
2613 \urefcatcodes
2615 \global\def\urefcode{\begingroup
2616 \setupmarkupstyle{code}%
2617 \urefcatcodes
2618 \let&\urefcodeamp
2619 \let.\urefcodedot
2620 \let#\urefcodehash
2621 \let?\urefcodequest
2622 \let/\urefcodeslash
2623 \codex
2626 % By default, they are just regular characters.
2627 \global\def&{\normalamp}
2628 \global\def.{\normaldot}
2629 \global\def#{\normalhash}
2630 \global\def?{\normalquest}
2631 \global\def/{\normalslash}
2634 % we put a little stretch before and after the breakable chars, to help
2635 % line breaking of long url's. The unequal skips make look better in
2636 % cmtt at least, especially for dots.
2637 \def\urefprestretch{\urefprebreak \hskip0pt plus.13em }
2638 \def\urefpoststretch{\urefpostbreak \hskip0pt plus.1em }
2640 \def\urefcodeamp{\urefprestretch \&\urefpoststretch}
2641 \def\urefcodedot{\urefprestretch .\urefpoststretch}
2642 \def\urefcodehash{\urefprestretch \#\urefpoststretch}
2643 \def\urefcodequest{\urefprestretch ?\urefpoststretch}
2644 \def\urefcodeslash{\futurelet\next\urefcodeslashfinish}
2646 \catcode`\/=\active
2647 \global\def\urefcodeslashfinish{%
2648 \urefprestretch \slashChar
2649 % Allow line break only after the final / in a sequence of
2650 % slashes, to avoid line break between the slashes in http://.
2651 \ifx\next/\else \urefpoststretch \fi
2655 % One more complication: by default we'll break after the special
2656 % characters, but some people like to break before the special chars, so
2657 % allow that. Also allow no breaking at all, for manual control.
2659 \parseargdef\urefbreakstyle{%
2660 \def\txiarg{#1}%
2661 \ifx\txiarg\wordnone
2662 \def\urefprebreak{\nobreak}\def\urefpostbreak{\nobreak}
2663 \else\ifx\txiarg\wordbefore
2664 \def\urefprebreak{\allowbreak}\def\urefpostbreak{\nobreak}
2665 \else\ifx\txiarg\wordafter
2666 \def\urefprebreak{\nobreak}\def\urefpostbreak{\allowbreak}
2667 \else
2668 \errhelp = \EMsimple
2669 \errmessage{Unknown @urefbreakstyle setting `\txiarg'}%
2670 \fi\fi\fi
2672 \def\wordafter{after}
2673 \def\wordbefore{before}
2674 \def\wordnone{none}
2676 \urefbreakstyle after
2678 % @url synonym for @uref, since that's how everyone uses it.
2680 \let\url=\uref
2682 % rms does not like angle brackets --karl, 17may97.
2683 % So now @email is just like @uref, unless we are pdf.
2685 %\def\email#1{\angleleft{\tt #1}\angleright}
2686 \ifpdf
2687 \def\email#1{\doemail#1,,\finish}
2688 \def\doemail#1,#2,#3\finish{\begingroup
2689 \unsepspaces
2690 \pdfurl{mailto:#1}%
2691 \setbox0 = \hbox{\ignorespaces #2}%
2692 \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi
2693 \endlink
2694 \endgroup}
2695 \else
2696 \let\email=\uref
2699 % @kbd is like @code, except that if the argument is just one @key command,
2700 % then @kbd has no effect.
2701 \def\kbd#1{{\setupmarkupstyle{kbd}\def\look{#1}\expandafter\kbdfoo\look??\par}}
2703 % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
2704 % `example' (@kbd uses ttsl only inside of @example and friends),
2705 % or `code' (@kbd uses normal tty font always).
2706 \parseargdef\kbdinputstyle{%
2707 \def\txiarg{#1}%
2708 \ifx\txiarg\worddistinct
2709 \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
2710 \else\ifx\txiarg\wordexample
2711 \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
2712 \else\ifx\txiarg\wordcode
2713 \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
2714 \else
2715 \errhelp = \EMsimple
2716 \errmessage{Unknown @kbdinputstyle setting `\txiarg'}%
2717 \fi\fi\fi
2719 \def\worddistinct{distinct}
2720 \def\wordexample{example}
2721 \def\wordcode{code}
2723 % Default is `distinct'.
2724 \kbdinputstyle distinct
2726 \def\xkey{\key}
2727 \def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}%
2728 \ifx\one\xkey\ifx\threex\three \key{#2}%
2729 \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi
2730 \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi}
2732 % For @indicateurl, @env, @command quotes seem unnecessary, so use \code.
2733 \let\indicateurl=\code
2734 \let\env=\code
2735 \let\command=\code
2737 % @clicksequence{File @click{} Open ...}
2738 \def\clicksequence#1{\begingroup #1\endgroup}
2740 % @clickstyle @arrow (by default)
2741 \parseargdef\clickstyle{\def\click{#1}}
2742 \def\click{\arrow}
2744 % Typeset a dimension, e.g., `in' or `pt'. The only reason for the
2745 % argument is to make the input look right: @dmn{pt} instead of @dmn{}pt.
2747 \def\dmn#1{\thinspace #1}
2749 % @l was never documented to mean ``switch to the Lisp font'',
2750 % and it is not used as such in any manual I can find. We need it for
2751 % Polish suppressed-l. --karl, 22sep96.
2752 %\def\l#1{{\li #1}\null}
2754 % @acronym for "FBI", "NATO", and the like.
2755 % We print this one point size smaller, since it's intended for
2756 % all-uppercase.
2758 \def\acronym#1{\doacronym #1,,\finish}
2759 \def\doacronym#1,#2,#3\finish{%
2760 {\selectfonts\lsize #1}%
2761 \def\temp{#2}%
2762 \ifx\temp\empty \else
2763 \space ({\unsepspaces \ignorespaces \temp \unskip})%
2767 % @abbr for "Comput. J." and the like.
2768 % No font change, but don't do end-of-sentence spacing.
2770 \def\abbr#1{\doabbr #1,,\finish}
2771 \def\doabbr#1,#2,#3\finish{%
2772 {\plainfrenchspacing #1}%
2773 \def\temp{#2}%
2774 \ifx\temp\empty \else
2775 \space ({\unsepspaces \ignorespaces \temp \unskip})%
2779 % @asis just yields its argument. Used with @table, for example.
2781 \def\asis#1{#1}
2783 % @math outputs its argument in math mode.
2785 % One complication: _ usually means subscripts, but it could also mean
2786 % an actual _ character, as in @math{@var{some_variable} + 1}. So make
2787 % _ active, and distinguish by seeing if the current family is \slfam,
2788 % which is what @var uses.
2790 \catcode`\_ = \active
2791 \gdef\mathunderscore{%
2792 \catcode`\_=\active
2793 \def_{\ifnum\fam=\slfam \_\else\sb\fi}%
2796 % Another complication: we want \\ (and @\) to output a math (or tt) \.
2797 % FYI, plain.tex uses \\ as a temporary control sequence (for no
2798 % particular reason), but this is not advertised and we don't care.
2800 % The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.
2801 \def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi}
2803 \def\math{%
2804 \tex
2805 \mathunderscore
2806 \let\\ = \mathbackslash
2807 \mathactive
2808 % make the texinfo accent commands work in math mode
2809 \let\"=\ddot
2810 \let\'=\acute
2811 \let\==\bar
2812 \let\^=\hat
2813 \let\`=\grave
2814 \let\u=\breve
2815 \let\v=\check
2816 \let\~=\tilde
2817 \let\dotaccent=\dot
2818 $\finishmath
2820 \def\finishmath#1{#1$\endgroup} % Close the group opened by \tex.
2822 % Some active characters (such as <) are spaced differently in math.
2823 % We have to reset their definitions in case the @math was an argument
2824 % to a command which sets the catcodes (such as @item or @section).
2827 \catcode`^ = \active
2828 \catcode`< = \active
2829 \catcode`> = \active
2830 \catcode`+ = \active
2831 \catcode`' = \active
2832 \gdef\mathactive{%
2833 \let^ = \ptexhat
2834 \let< = \ptexless
2835 \let> = \ptexgtr
2836 \let+ = \ptexplus
2837 \let' = \ptexquoteright
2842 \message{glyphs,}
2843 % and logos.
2845 % @@ prints an @.
2846 \def\@{\char64 }
2848 % Used to generate quoted braces. Unless we're in typewriter, use
2849 % \ecfont because the CM text fonts do not have braces, and we don't
2850 % want to switch into math.
2851 \def\mylbrace{{\ifmonospace\else\ecfont\fi \char123}}
2852 \def\myrbrace{{\ifmonospace\else\ecfont\fi \char125}}
2853 \let\{=\mylbrace
2854 \let\}=\myrbrace
2855 \begingroup
2856 % Definitions to produce \{ and \} commands for indices,
2857 % and @{ and @} for the aux/toc files.
2858 \catcode`\{ = \other \catcode`\} = \other
2859 \catcode`\[ = 1 \catcode`\] = 2
2860 \catcode`\! = 0 \catcode`\\ = \other
2861 !gdef!lbracecmd[\{]%
2862 !gdef!rbracecmd[\}]%
2863 !gdef!lbraceatcmd[@{]%
2864 !gdef!rbraceatcmd[@}]%
2865 !endgroup
2867 % @comma{} to avoid , parsing problems.
2868 \let\comma = ,
2870 % Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
2871 % Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H.
2872 \let\, = \ptexc
2873 \let\dotaccent = \ptexdot
2874 \def\ringaccent#1{{\accent23 #1}}
2875 \let\tieaccent = \ptext
2876 \let\ubaraccent = \ptexb
2877 \let\udotaccent = \d
2879 % Other special characters: @questiondown @exclamdown @ordf @ordm
2880 % Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
2881 \def\questiondown{?`}
2882 \def\exclamdown{!`}
2883 \def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}}
2884 \def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}}
2886 % Dotless i and dotless j, used for accents.
2887 \def\imacro{i}
2888 \def\jmacro{j}
2889 \def\dotless#1{%
2890 \def\temp{#1}%
2891 \ifx\temp\imacro \ifmmode\imath \else\ptexi \fi
2892 \else\ifx\temp\jmacro \ifmmode\jmath \else\j \fi
2893 \else \errmessage{@dotless can be used only with i or j}%
2894 \fi\fi
2897 % The \TeX{} logo, as in plain, but resetting the spacing so that a
2898 % period following counts as ending a sentence. (Idea found in latex.)
2900 \edef\TeX{\TeX \spacefactor=1000 }
2902 % @LaTeX{} logo. Not quite the same results as the definition in
2903 % latex.ltx, since we use a different font for the raised A; it's most
2904 % convenient for us to use an explicitly smaller font, rather than using
2905 % the \scriptstyle font (since we don't reset \scriptstyle and
2906 % \scriptscriptstyle).
2908 \def\LaTeX{%
2909 L\kern-.36em
2910 {\setbox0=\hbox{T}%
2911 \vbox to \ht0{\hbox{%
2912 \ifx\textnominalsize\xwordpt
2913 % for 10pt running text, \lllsize (8pt) is too small for the A in LaTeX.
2914 % Revert to plain's \scriptsize, which is 7pt.
2915 \count255=\the\fam $\fam\count255 \scriptstyle A$%
2916 \else
2917 % For 11pt, we can use our lllsize.
2918 \selectfonts\lllsize A%
2921 \vss
2923 \kern-.15em
2924 \TeX
2927 % Some math mode symbols.
2928 \def\bullet{$\ptexbullet$}
2929 \def\geq{\ifmmode \ge\else $\ge$\fi}
2930 \def\leq{\ifmmode \le\else $\le$\fi}
2931 \def\minus{\ifmmode -\else $-$\fi}
2933 % @dots{} outputs an ellipsis using the current font.
2934 % We do .5em per period so that it has the same spacing in the cm
2935 % typewriter fonts as three actual period characters; on the other hand,
2936 % in other typewriter fonts three periods are wider than 1.5em. So do
2937 % whichever is larger.
2939 \def\dots{%
2940 \leavevmode
2941 \setbox0=\hbox{...}% get width of three periods
2942 \ifdim\wd0 > 1.5em
2943 \dimen0 = \wd0
2944 \else
2945 \dimen0 = 1.5em
2947 \hbox to \dimen0{%
2948 \hskip 0pt plus.25fil
2949 .\hskip 0pt plus1fil
2950 .\hskip 0pt plus1fil
2951 .\hskip 0pt plus.5fil
2955 % @enddots{} is an end-of-sentence ellipsis.
2957 \def\enddots{%
2958 \dots
2959 \spacefactor=\endofsentencespacefactor
2962 % @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
2964 % Since these characters are used in examples, they should be an even number of
2965 % \tt widths. Each \tt character is 1en, so two makes it 1em.
2967 \def\point{$\star$}
2968 \def\arrow{\leavevmode\raise.05ex\hbox to 1em{\hfil$\rightarrow$\hfil}}
2969 \def\result{\leavevmode\raise.05ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}
2970 \def\expansion{\leavevmode\hbox to 1em{\hfil$\mapsto$\hfil}}
2971 \def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}}
2972 \def\equiv{\leavevmode\hbox to 1em{\hfil$\ptexequiv$\hfil}}
2974 % The @error{} command.
2975 % Adapted from the TeXbook's \boxit.
2977 \newbox\errorbox
2979 {\tentt \global\dimen0 = 3em}% Width of the box.
2980 \dimen2 = .55pt % Thickness of rules
2981 % The text. (`r' is open on the right, `e' somewhat less so on the left.)
2982 \setbox0 = \hbox{\kern-.75pt \reducedsf error\kern-1.5pt}
2984 \setbox\errorbox=\hbox to \dimen0{\hfil
2985 \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
2986 \advance\hsize by -2\dimen2 % Rules.
2987 \vbox{%
2988 \hrule height\dimen2
2989 \hbox{\vrule width\dimen2 \kern3pt % Space to left of text.
2990 \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below.
2991 \kern3pt\vrule width\dimen2}% Space to right.
2992 \hrule height\dimen2}
2993 \hfil}
2995 \def\error{\leavevmode\lower.7ex\copy\errorbox}
2997 % @pounds{} is a sterling sign, which Knuth put in the CM italic font.
2999 \def\pounds{{\it\$}}
3001 % @euro{} comes from a separate font, depending on the current style.
3002 % We use the free feym* fonts from the eurosym package by Henrik
3003 % Theiling, which support regular, slanted, bold and bold slanted (and
3004 % "outlined" (blackboard board, sort of) versions, which we don't need).
3005 % It is available from http://www.ctan.org/tex-archive/fonts/eurosym.
3007 % Although only regular is the truly official Euro symbol, we ignore
3008 % that. The Euro is designed to be slightly taller than the regular
3009 % font height.
3011 % feymr - regular
3012 % feymo - slanted
3013 % feybr - bold
3014 % feybo - bold slanted
3016 % There is no good (free) typewriter version, to my knowledge.
3017 % A feymr10 euro is ~7.3pt wide, while a normal cmtt10 char is ~5.25pt wide.
3018 % Hmm.
3020 % Also doesn't work in math. Do we need to do math with euro symbols?
3021 % Hope not.
3024 \def\euro{{\eurofont e}}
3025 \def\eurofont{%
3026 % We set the font at each command, rather than predefining it in
3027 % \textfonts and the other font-switching commands, so that
3028 % installations which never need the symbol don't have to have the
3029 % font installed.
3031 % There is only one designed size (nominal 10pt), so we always scale
3032 % that to the current nominal size.
3034 % By the way, simply using "at 1em" works for cmr10 and the like, but
3035 % does not work for cmbx10 and other extended/shrunken fonts.
3037 \def\eurosize{\csname\curfontsize nominalsize\endcsname}%
3039 \ifx\curfontstyle\bfstylename
3040 % bold:
3041 \font\thiseurofont = \ifusingit{feybo10}{feybr10} at \eurosize
3042 \else
3043 % regular:
3044 \font\thiseurofont = \ifusingit{feymo10}{feymr10} at \eurosize
3046 \thiseurofont
3049 % Glyphs from the EC fonts. We don't use \let for the aliases, because
3050 % sometimes we redefine the original macro, and the alias should reflect
3051 % the redefinition.
3053 % Use LaTeX names for the Icelandic letters.
3054 \def\DH{{\ecfont \char"D0}} % Eth
3055 \def\dh{{\ecfont \char"F0}} % eth
3056 \def\TH{{\ecfont \char"DE}} % Thorn
3057 \def\th{{\ecfont \char"FE}} % thorn
3059 \def\guillemetleft{{\ecfont \char"13}}
3060 \def\guillemotleft{\guillemetleft}
3061 \def\guillemetright{{\ecfont \char"14}}
3062 \def\guillemotright{\guillemetright}
3063 \def\guilsinglleft{{\ecfont \char"0E}}
3064 \def\guilsinglright{{\ecfont \char"0F}}
3065 \def\quotedblbase{{\ecfont \char"12}}
3066 \def\quotesinglbase{{\ecfont \char"0D}}
3068 % This positioning is not perfect (see the ogonek LaTeX package), but
3069 % we have the precomposed glyphs for the most common cases. We put the
3070 % tests to use those glyphs in the single \ogonek macro so we have fewer
3071 % dummy definitions to worry about for index entries, etc.
3073 % ogonek is also used with other letters in Lithuanian (IOU), but using
3074 % the precomposed glyphs for those is not so easy since they aren't in
3075 % the same EC font.
3076 \def\ogonek#1{{%
3077 \def\temp{#1}%
3078 \ifx\temp\macrocharA\Aogonek
3079 \else\ifx\temp\macrochara\aogonek
3080 \else\ifx\temp\macrocharE\Eogonek
3081 \else\ifx\temp\macrochare\eogonek
3082 \else
3083 \ecfont \setbox0=\hbox{#1}%
3084 \ifdim\ht0=1ex\accent"0C #1%
3085 \else\ooalign{\unhbox0\crcr\hidewidth\char"0C \hidewidth}%
3087 \fi\fi\fi\fi
3090 \def\Aogonek{{\ecfont \char"81}}\def\macrocharA{A}
3091 \def\aogonek{{\ecfont \char"A1}}\def\macrochara{a}
3092 \def\Eogonek{{\ecfont \char"86}}\def\macrocharE{E}
3093 \def\eogonek{{\ecfont \char"A6}}\def\macrochare{e}
3095 % Use the ec* fonts (cm-super in outline format) for non-CM glyphs.
3096 \def\ecfont{%
3097 % We can't distinguish serif/sans and italic/slanted, but this
3098 % is used for crude hacks anyway (like adding French and German
3099 % quotes to documents typeset with CM, where we lose kerning), so
3100 % hopefully nobody will notice/care.
3101 \edef\ecsize{\csname\curfontsize ecsize\endcsname}%
3102 \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}%
3103 \ifx\curfontstyle\bfstylename
3104 % bold:
3105 \font\thisecfont = ecb\ifusingit{i}{x}\ecsize \space at \nominalsize
3106 \else
3107 % regular:
3108 \font\thisecfont = ec\ifusingit{ti}{rm}\ecsize \space at \nominalsize
3110 \thisecfont
3113 % @registeredsymbol - R in a circle. The font for the R should really
3114 % be smaller yet, but lllsize is the best we can do for now.
3115 % Adapted from the plain.tex definition of \copyright.
3117 \def\registeredsymbol{%
3118 $^{{\ooalign{\hfil\raise.07ex\hbox{\selectfonts\lllsize R}%
3119 \hfil\crcr\Orb}}%
3123 % @textdegree - the normal degrees sign.
3125 \def\textdegree{$^\circ$}
3127 % Laurent Siebenmann reports \Orb undefined with:
3128 % Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38
3129 % so we'll define it if necessary.
3131 \ifx\Orb\thisisundefined
3132 \def\Orb{\mathhexbox20D}
3135 % Quotes.
3136 \chardef\quotedblleft="5C
3137 \chardef\quotedblright=`\"
3138 \chardef\quoteleft=`\`
3139 \chardef\quoteright=`\'
3142 \message{page headings,}
3144 \newskip\titlepagetopglue \titlepagetopglue = 1.5in
3145 \newskip\titlepagebottomglue \titlepagebottomglue = 2pc
3147 % First the title page. Must do @settitle before @titlepage.
3148 \newif\ifseenauthor
3149 \newif\iffinishedtitlepage
3151 % Do an implicit @contents or @shortcontents after @end titlepage if the
3152 % user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage.
3154 \newif\ifsetcontentsaftertitlepage
3155 \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue
3156 \newif\ifsetshortcontentsaftertitlepage
3157 \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue
3159 \parseargdef\shorttitlepage{%
3160 \begingroup \hbox{}\vskip 1.5in \chaprm \centerline{#1}%
3161 \endgroup\page\hbox{}\page}
3163 \envdef\titlepage{%
3164 % Open one extra group, as we want to close it in the middle of \Etitlepage.
3165 \begingroup
3166 \parindent=0pt \textfonts
3167 % Leave some space at the very top of the page.
3168 \vglue\titlepagetopglue
3169 % No rule at page bottom unless we print one at the top with @title.
3170 \finishedtitlepagetrue
3172 % Most title ``pages'' are actually two pages long, with space
3173 % at the top of the second. We don't want the ragged left on the second.
3174 \let\oldpage = \page
3175 \def\page{%
3176 \iffinishedtitlepage\else
3177 \finishtitlepage
3179 \let\page = \oldpage
3180 \page
3181 \null
3185 \def\Etitlepage{%
3186 \iffinishedtitlepage\else
3187 \finishtitlepage
3189 % It is important to do the page break before ending the group,
3190 % because the headline and footline are only empty inside the group.
3191 % If we use the new definition of \page, we always get a blank page
3192 % after the title page, which we certainly don't want.
3193 \oldpage
3194 \endgroup
3196 % Need this before the \...aftertitlepage checks so that if they are
3197 % in effect the toc pages will come out with page numbers.
3198 \HEADINGSon
3200 % If they want short, they certainly want long too.
3201 \ifsetshortcontentsaftertitlepage
3202 \shortcontents
3203 \contents
3204 \global\let\shortcontents = \relax
3205 \global\let\contents = \relax
3208 \ifsetcontentsaftertitlepage
3209 \contents
3210 \global\let\contents = \relax
3211 \global\let\shortcontents = \relax
3215 \def\finishtitlepage{%
3216 \vskip4pt \hrule height 2pt width \hsize
3217 \vskip\titlepagebottomglue
3218 \finishedtitlepagetrue
3221 % Macros to be used within @titlepage:
3223 \let\subtitlerm=\tenrm
3224 \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}
3226 \parseargdef\title{%
3227 \checkenv\titlepage
3228 \leftline{\titlefonts\rmisbold #1}
3229 % print a rule at the page bottom also.
3230 \finishedtitlepagefalse
3231 \vskip4pt \hrule height 4pt width \hsize \vskip4pt
3234 \parseargdef\subtitle{%
3235 \checkenv\titlepage
3236 {\subtitlefont \rightline{#1}}%
3239 % @author should come last, but may come many times.
3240 % It can also be used inside @quotation.
3242 \parseargdef\author{%
3243 \def\temp{\quotation}%
3244 \ifx\thisenv\temp
3245 \def\quotationauthor{#1}% printed in \Equotation.
3246 \else
3247 \checkenv\titlepage
3248 \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi
3249 {\secfonts\rmisbold \leftline{#1}}%
3254 % Set up page headings and footings.
3256 \let\thispage=\folio
3258 \newtoks\evenheadline % headline on even pages
3259 \newtoks\oddheadline % headline on odd pages
3260 \newtoks\evenfootline % footline on even pages
3261 \newtoks\oddfootline % footline on odd pages
3263 % Now make TeX use those variables
3264 \headline={{\textfonts\rm \ifodd\pageno \the\oddheadline
3265 \else \the\evenheadline \fi}}
3266 \footline={{\textfonts\rm \ifodd\pageno \the\oddfootline
3267 \else \the\evenfootline \fi}\HEADINGShook}
3268 \let\HEADINGShook=\relax
3270 % Commands to set those variables.
3271 % For example, this is what @headings on does
3272 % @evenheading @thistitle|@thispage|@thischapter
3273 % @oddheading @thischapter|@thispage|@thistitle
3274 % @evenfooting @thisfile||
3275 % @oddfooting ||@thisfile
3278 \def\evenheading{\parsearg\evenheadingxxx}
3279 \def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish}
3280 \def\evenheadingyyy #1\|#2\|#3\|#4\finish{%
3281 \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
3283 \def\oddheading{\parsearg\oddheadingxxx}
3284 \def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish}
3285 \def\oddheadingyyy #1\|#2\|#3\|#4\finish{%
3286 \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
3288 \parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}%
3290 \def\evenfooting{\parsearg\evenfootingxxx}
3291 \def\evenfootingxxx #1{\evenfootingyyy #1\|\|\|\|\finish}
3292 \def\evenfootingyyy #1\|#2\|#3\|#4\finish{%
3293 \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
3295 \def\oddfooting{\parsearg\oddfootingxxx}
3296 \def\oddfootingxxx #1{\oddfootingyyy #1\|\|\|\|\finish}
3297 \def\oddfootingyyy #1\|#2\|#3\|#4\finish{%
3298 \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}%
3300 % Leave some space for the footline. Hopefully ok to assume
3301 % @evenfooting will not be used by itself.
3302 \global\advance\pageheight by -12pt
3303 \global\advance\vsize by -12pt
3306 \parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}}
3308 % @evenheadingmarks top \thischapter <- chapter at the top of a page
3309 % @evenheadingmarks bottom \thischapter <- chapter at the bottom of a page
3311 % The same set of arguments for:
3313 % @oddheadingmarks
3314 % @evenfootingmarks
3315 % @oddfootingmarks
3316 % @everyheadingmarks
3317 % @everyfootingmarks
3319 \def\evenheadingmarks{\headingmarks{even}{heading}}
3320 \def\oddheadingmarks{\headingmarks{odd}{heading}}
3321 \def\evenfootingmarks{\headingmarks{even}{footing}}
3322 \def\oddfootingmarks{\headingmarks{odd}{footing}}
3323 \def\everyheadingmarks#1 {\headingmarks{even}{heading}{#1}
3324 \headingmarks{odd}{heading}{#1} }
3325 \def\everyfootingmarks#1 {\headingmarks{even}{footing}{#1}
3326 \headingmarks{odd}{footing}{#1} }
3327 % #1 = even/odd, #2 = heading/footing, #3 = top/bottom.
3328 \def\headingmarks#1#2#3 {%
3329 \expandafter\let\expandafter\temp \csname get#3headingmarks\endcsname
3330 \global\expandafter\let\csname get#1#2marks\endcsname \temp
3333 \everyheadingmarks bottom
3334 \everyfootingmarks bottom
3336 % @headings double turns headings on for double-sided printing.
3337 % @headings single turns headings on for single-sided printing.
3338 % @headings off turns them off.
3339 % @headings on same as @headings double, retained for compatibility.
3340 % @headings after turns on double-sided headings after this page.
3341 % @headings doubleafter turns on double-sided headings after this page.
3342 % @headings singleafter turns on single-sided headings after this page.
3343 % By default, they are off at the start of a document,
3344 % and turned `on' after @end titlepage.
3346 \def\headings #1 {\csname HEADINGS#1\endcsname}
3348 \def\headingsoff{% non-global headings elimination
3349 \evenheadline={\hfil}\evenfootline={\hfil}%
3350 \oddheadline={\hfil}\oddfootline={\hfil}%
3353 \def\HEADINGSoff{{\globaldefs=1 \headingsoff}} % global setting
3354 \HEADINGSoff % it's the default
3356 % When we turn headings on, set the page number to 1.
3357 % For double-sided printing, put current file name in lower left corner,
3358 % chapter name on inside top of right hand pages, document
3359 % title on inside top of left hand pages, and page numbers on outside top
3360 % edge of all pages.
3361 \def\HEADINGSdouble{%
3362 \global\pageno=1
3363 \global\evenfootline={\hfil}
3364 \global\oddfootline={\hfil}
3365 \global\evenheadline={\line{\folio\hfil\thistitle}}
3366 \global\oddheadline={\line{\thischapter\hfil\folio}}
3367 \global\let\contentsalignmacro = \chapoddpage
3369 \let\contentsalignmacro = \chappager
3371 % For single-sided printing, chapter title goes across top left of page,
3372 % page number on top right.
3373 \def\HEADINGSsingle{%
3374 \global\pageno=1
3375 \global\evenfootline={\hfil}
3376 \global\oddfootline={\hfil}
3377 \global\evenheadline={\line{\thischapter\hfil\folio}}
3378 \global\oddheadline={\line{\thischapter\hfil\folio}}
3379 \global\let\contentsalignmacro = \chappager
3381 \def\HEADINGSon{\HEADINGSdouble}
3383 \def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex}
3384 \let\HEADINGSdoubleafter=\HEADINGSafter
3385 \def\HEADINGSdoublex{%
3386 \global\evenfootline={\hfil}
3387 \global\oddfootline={\hfil}
3388 \global\evenheadline={\line{\folio\hfil\thistitle}}
3389 \global\oddheadline={\line{\thischapter\hfil\folio}}
3390 \global\let\contentsalignmacro = \chapoddpage
3393 \def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex}
3394 \def\HEADINGSsinglex{%
3395 \global\evenfootline={\hfil}
3396 \global\oddfootline={\hfil}
3397 \global\evenheadline={\line{\thischapter\hfil\folio}}
3398 \global\oddheadline={\line{\thischapter\hfil\folio}}
3399 \global\let\contentsalignmacro = \chappager
3402 % Subroutines used in generating headings
3403 % This produces Day Month Year style of output.
3404 % Only define if not already defined, in case a txi-??.tex file has set
3405 % up a different format (e.g., txi-cs.tex does this).
3406 \ifx\today\thisisundefined
3407 \def\today{%
3408 \number\day\space
3409 \ifcase\month
3410 \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr
3411 \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug
3412 \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec
3414 \space\number\year}
3417 % @settitle line... specifies the title of the document, for headings.
3418 % It generates no output of its own.
3419 \def\thistitle{\putwordNoTitle}
3420 \def\settitle{\parsearg{\gdef\thistitle}}
3423 \message{tables,}
3424 % Tables -- @table, @ftable, @vtable, @item(x).
3426 % default indentation of table text
3427 \newdimen\tableindent \tableindent=.8in
3428 % default indentation of @itemize and @enumerate text
3429 \newdimen\itemindent \itemindent=.3in
3430 % margin between end of table item and start of table text.
3431 \newdimen\itemmargin \itemmargin=.1in
3433 % used internally for \itemindent minus \itemmargin
3434 \newdimen\itemmax
3436 % Note @table, @ftable, and @vtable define @item, @itemx, etc., with
3437 % these defs.
3438 % They also define \itemindex
3439 % to index the item name in whatever manner is desired (perhaps none).
3441 \newif\ifitemxneedsnegativevskip
3443 \def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi}
3445 \def\internalBitem{\smallbreak \parsearg\itemzzz}
3446 \def\internalBitemx{\itemxpar \parsearg\itemzzz}
3448 \def\itemzzz #1{\begingroup %
3449 \advance\hsize by -\rightskip
3450 \advance\hsize by -\tableindent
3451 \setbox0=\hbox{\itemindicate{#1}}%
3452 \itemindex{#1}%
3453 \nobreak % This prevents a break before @itemx.
3455 % If the item text does not fit in the space we have, put it on a line
3456 % by itself, and do not allow a page break either before or after that
3457 % line. We do not start a paragraph here because then if the next
3458 % command is, e.g., @kindex, the whatsit would get put into the
3459 % horizontal list on a line by itself, resulting in extra blank space.
3460 \ifdim \wd0>\itemmax
3462 % Make this a paragraph so we get the \parskip glue and wrapping,
3463 % but leave it ragged-right.
3464 \begingroup
3465 \advance\leftskip by-\tableindent
3466 \advance\hsize by\tableindent
3467 \advance\rightskip by0pt plus1fil\relax
3468 \leavevmode\unhbox0\par
3469 \endgroup
3471 % We're going to be starting a paragraph, but we don't want the
3472 % \parskip glue -- logically it's part of the @item we just started.
3473 \nobreak \vskip-\parskip
3475 % Stop a page break at the \parskip glue coming up. However, if
3476 % what follows is an environment such as @example, there will be no
3477 % \parskip glue; then the negative vskip we just inserted would
3478 % cause the example and the item to crash together. So we use this
3479 % bizarre value of 10001 as a signal to \aboveenvbreak to insert
3480 % \parskip glue after all. Section titles are handled this way also.
3482 \penalty 10001
3483 \endgroup
3484 \itemxneedsnegativevskipfalse
3485 \else
3486 % The item text fits into the space. Start a paragraph, so that the
3487 % following text (if any) will end up on the same line.
3488 \noindent
3489 % Do this with kerns and \unhbox so that if there is a footnote in
3490 % the item text, it can migrate to the main vertical list and
3491 % eventually be printed.
3492 \nobreak\kern-\tableindent
3493 \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0
3494 \unhbox0
3495 \nobreak\kern\dimen0
3496 \endgroup
3497 \itemxneedsnegativevskiptrue
3501 \def\item{\errmessage{@item while not in a list environment}}
3502 \def\itemx{\errmessage{@itemx while not in a list environment}}
3504 % @table, @ftable, @vtable.
3505 \envdef\table{%
3506 \let\itemindex\gobble
3507 \tablecheck{table}%
3509 \envdef\ftable{%
3510 \def\itemindex ##1{\doind {fn}{\code{##1}}}%
3511 \tablecheck{ftable}%
3513 \envdef\vtable{%
3514 \def\itemindex ##1{\doind {vr}{\code{##1}}}%
3515 \tablecheck{vtable}%
3517 \def\tablecheck#1{%
3518 \ifnum \the\catcode`\^^M=\active
3519 \endgroup
3520 \errmessage{This command won't work in this context; perhaps the problem is
3521 that we are \inenvironment\thisenv}%
3522 \def\next{\doignore{#1}}%
3523 \else
3524 \let\next\tablex
3526 \next
3528 \def\tablex#1{%
3529 \def\itemindicate{#1}%
3530 \parsearg\tabley
3532 \def\tabley#1{%
3534 \makevalueexpandable
3535 \edef\temp{\noexpand\tablez #1\space\space\space}%
3536 \expandafter
3537 }\temp \endtablez
3539 \def\tablez #1 #2 #3 #4\endtablez{%
3540 \aboveenvbreak
3541 \ifnum 0#1>0 \advance \leftskip by #1\mil \fi
3542 \ifnum 0#2>0 \tableindent=#2\mil \fi
3543 \ifnum 0#3>0 \advance \rightskip by #3\mil \fi
3544 \itemmax=\tableindent
3545 \advance \itemmax by -\itemmargin
3546 \advance \leftskip by \tableindent
3547 \exdentamount=\tableindent
3548 \parindent = 0pt
3549 \parskip = \smallskipamount
3550 \ifdim \parskip=0pt \parskip=2pt \fi
3551 \let\item = \internalBitem
3552 \let\itemx = \internalBitemx
3554 \def\Etable{\endgraf\afterenvbreak}
3555 \let\Eftable\Etable
3556 \let\Evtable\Etable
3557 \let\Eitemize\Etable
3558 \let\Eenumerate\Etable
3560 % This is the counter used by @enumerate, which is really @itemize
3562 \newcount \itemno
3564 \envdef\itemize{\parsearg\doitemize}
3566 \def\doitemize#1{%
3567 \aboveenvbreak
3568 \itemmax=\itemindent
3569 \advance\itemmax by -\itemmargin
3570 \advance\leftskip by \itemindent
3571 \exdentamount=\itemindent
3572 \parindent=0pt
3573 \parskip=\smallskipamount
3574 \ifdim\parskip=0pt \parskip=2pt \fi
3576 % Try typesetting the item mark that if the document erroneously says
3577 % something like @itemize @samp (intending @table), there's an error
3578 % right away at the @itemize. It's not the best error message in the
3579 % world, but it's better than leaving it to the @item. This means if
3580 % the user wants an empty mark, they have to say @w{} not just @w.
3581 \def\itemcontents{#1}%
3582 \setbox0 = \hbox{\itemcontents}%
3584 % @itemize with no arg is equivalent to @itemize @bullet.
3585 \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi
3587 \let\item=\itemizeitem
3590 % Definition of @item while inside @itemize and @enumerate.
3592 \def\itemizeitem{%
3593 \advance\itemno by 1 % for enumerations
3594 {\let\par=\endgraf \smallbreak}% reasonable place to break
3596 % If the document has an @itemize directly after a section title, a
3597 % \nobreak will be last on the list, and \sectionheading will have
3598 % done a \vskip-\parskip. In that case, we don't want to zero
3599 % parskip, or the item text will crash with the heading. On the
3600 % other hand, when there is normal text preceding the item (as there
3601 % usually is), we do want to zero parskip, or there would be too much
3602 % space. In that case, we won't have a \nobreak before. At least
3603 % that's the theory.
3604 \ifnum\lastpenalty<10000 \parskip=0in \fi
3605 \noindent
3606 \hbox to 0pt{\hss \itemcontents \kern\itemmargin}%
3608 \vadjust{\penalty 1200}}% not good to break after first line of item.
3609 \flushcr
3612 % \splitoff TOKENS\endmark defines \first to be the first token in
3613 % TOKENS, and \rest to be the remainder.
3615 \def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
3617 % Allow an optional argument of an uppercase letter, lowercase letter,
3618 % or number, to specify the first label in the enumerated list. No
3619 % argument is the same as `1'.
3621 \envparseargdef\enumerate{\enumeratey #1 \endenumeratey}
3622 \def\enumeratey #1 #2\endenumeratey{%
3623 % If we were given no argument, pretend we were given `1'.
3624 \def\thearg{#1}%
3625 \ifx\thearg\empty \def\thearg{1}\fi
3627 % Detect if the argument is a single token. If so, it might be a
3628 % letter. Otherwise, the only valid thing it can be is a number.
3629 % (We will always have one token, because of the test we just made.
3630 % This is a good thing, since \splitoff doesn't work given nothing at
3631 % all -- the first parameter is undelimited.)
3632 \expandafter\splitoff\thearg\endmark
3633 \ifx\rest\empty
3634 % Only one token in the argument. It could still be anything.
3635 % A ``lowercase letter'' is one whose \lccode is nonzero.
3636 % An ``uppercase letter'' is one whose \lccode is both nonzero, and
3637 % not equal to itself.
3638 % Otherwise, we assume it's a number.
3640 % We need the \relax at the end of the \ifnum lines to stop TeX from
3641 % continuing to look for a <number>.
3643 \ifnum\lccode\expandafter`\thearg=0\relax
3644 \numericenumerate % a number (we hope)
3645 \else
3646 % It's a letter.
3647 \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax
3648 \lowercaseenumerate % lowercase letter
3649 \else
3650 \uppercaseenumerate % uppercase letter
3653 \else
3654 % Multiple tokens in the argument. We hope it's a number.
3655 \numericenumerate
3659 % An @enumerate whose labels are integers. The starting integer is
3660 % given in \thearg.
3662 \def\numericenumerate{%
3663 \itemno = \thearg
3664 \startenumeration{\the\itemno}%
3667 % The starting (lowercase) letter is in \thearg.
3668 \def\lowercaseenumerate{%
3669 \itemno = \expandafter`\thearg
3670 \startenumeration{%
3671 % Be sure we're not beyond the end of the alphabet.
3672 \ifnum\itemno=0
3673 \errmessage{No more lowercase letters in @enumerate; get a bigger
3674 alphabet}%
3676 \char\lccode\itemno
3680 % The starting (uppercase) letter is in \thearg.
3681 \def\uppercaseenumerate{%
3682 \itemno = \expandafter`\thearg
3683 \startenumeration{%
3684 % Be sure we're not beyond the end of the alphabet.
3685 \ifnum\itemno=0
3686 \errmessage{No more uppercase letters in @enumerate; get a bigger
3687 alphabet}
3689 \char\uccode\itemno
3693 % Call \doitemize, adding a period to the first argument and supplying the
3694 % common last two arguments. Also subtract one from the initial value in
3695 % \itemno, since @item increments \itemno.
3697 \def\startenumeration#1{%
3698 \advance\itemno by -1
3699 \doitemize{#1.}\flushcr
3702 % @alphaenumerate and @capsenumerate are abbreviations for giving an arg
3703 % to @enumerate.
3705 \def\alphaenumerate{\enumerate{a}}
3706 \def\capsenumerate{\enumerate{A}}
3707 \def\Ealphaenumerate{\Eenumerate}
3708 \def\Ecapsenumerate{\Eenumerate}
3711 % @multitable macros
3712 % Amy Hendrickson, 8/18/94, 3/6/96
3714 % @multitable ... @end multitable will make as many columns as desired.
3715 % Contents of each column will wrap at width given in preamble. Width
3716 % can be specified either with sample text given in a template line,
3717 % or in percent of \hsize, the current width of text on page.
3719 % Table can continue over pages but will only break between lines.
3721 % To make preamble:
3723 % Either define widths of columns in terms of percent of \hsize:
3724 % @multitable @columnfractions .25 .3 .45
3725 % @item ...
3727 % Numbers following @columnfractions are the percent of the total
3728 % current hsize to be used for each column. You may use as many
3729 % columns as desired.
3732 % Or use a template:
3733 % @multitable {Column 1 template} {Column 2 template} {Column 3 template}
3734 % @item ...
3735 % using the widest term desired in each column.
3737 % Each new table line starts with @item, each subsequent new column
3738 % starts with @tab. Empty columns may be produced by supplying @tab's
3739 % with nothing between them for as many times as empty columns are needed,
3740 % ie, @tab@tab@tab will produce two empty columns.
3742 % @item, @tab do not need to be on their own lines, but it will not hurt
3743 % if they are.
3745 % Sample multitable:
3747 % @multitable {Column 1 template} {Column 2 template} {Column 3 template}
3748 % @item first col stuff @tab second col stuff @tab third col
3749 % @item
3750 % first col stuff
3751 % @tab
3752 % second col stuff
3753 % @tab
3754 % third col
3755 % @item first col stuff @tab second col stuff
3756 % @tab Many paragraphs of text may be used in any column.
3758 % They will wrap at the width determined by the template.
3759 % @item@tab@tab This will be in third column.
3760 % @end multitable
3762 % Default dimensions may be reset by user.
3763 % @multitableparskip is vertical space between paragraphs in table.
3764 % @multitableparindent is paragraph indent in table.
3765 % @multitablecolmargin is horizontal space to be left between columns.
3766 % @multitablelinespace is space to leave between table items, baseline
3767 % to baseline.
3768 % 0pt means it depends on current normal line spacing.
3770 \newskip\multitableparskip
3771 \newskip\multitableparindent
3772 \newdimen\multitablecolspace
3773 \newskip\multitablelinespace
3774 \multitableparskip=0pt
3775 \multitableparindent=6pt
3776 \multitablecolspace=12pt
3777 \multitablelinespace=0pt
3779 % Macros used to set up halign preamble:
3781 \let\endsetuptable\relax
3782 \def\xendsetuptable{\endsetuptable}
3783 \let\columnfractions\relax
3784 \def\xcolumnfractions{\columnfractions}
3785 \newif\ifsetpercent
3787 % #1 is the @columnfraction, usually a decimal number like .5, but might
3788 % be just 1. We just use it, whatever it is.
3790 \def\pickupwholefraction#1 {%
3791 \global\advance\colcount by 1
3792 \expandafter\xdef\csname col\the\colcount\endcsname{#1\hsize}%
3793 \setuptable
3796 \newcount\colcount
3797 \def\setuptable#1{%
3798 \def\firstarg{#1}%
3799 \ifx\firstarg\xendsetuptable
3800 \let\go = \relax
3801 \else
3802 \ifx\firstarg\xcolumnfractions
3803 \global\setpercenttrue
3804 \else
3805 \ifsetpercent
3806 \let\go\pickupwholefraction
3807 \else
3808 \global\advance\colcount by 1
3809 \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a
3810 % separator; typically that is always in the input, anyway.
3811 \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
3814 \ifx\go\pickupwholefraction
3815 % Put the argument back for the \pickupwholefraction call, so
3816 % we'll always have a period there to be parsed.
3817 \def\go{\pickupwholefraction#1}%
3818 \else
3819 \let\go = \setuptable
3820 \fi%
3825 % multitable-only commands.
3827 % @headitem starts a heading row, which we typeset in bold.
3828 % Assignments have to be global since we are inside the implicit group
3829 % of an alignment entry. \everycr resets \everytab so we don't have to
3830 % undo it ourselves.
3831 \def\headitemfont{\b}% for people to use in the template row; not changeable
3832 \def\headitem{%
3833 \checkenv\multitable
3834 \crcr
3835 \global\everytab={\bf}% can't use \headitemfont since the parsing differs
3836 \the\everytab % for the first item
3839 % A \tab used to include \hskip1sp. But then the space in a template
3840 % line is not enough. That is bad. So let's go back to just `&' until
3841 % we again encounter the problem the 1sp was intended to solve.
3842 % --karl, nathan@acm.org, 20apr99.
3843 \def\tab{\checkenv\multitable &\the\everytab}%
3845 % @multitable ... @end multitable definitions:
3847 \newtoks\everytab % insert after every tab.
3849 \envdef\multitable{%
3850 \vskip\parskip
3851 \startsavinginserts
3853 % @item within a multitable starts a normal row.
3854 % We use \def instead of \let so that if one of the multitable entries
3855 % contains an @itemize, we don't choke on the \item (seen as \crcr aka
3856 % \endtemplate) expanding \doitemize.
3857 \def\item{\crcr}%
3859 \tolerance=9500
3860 \hbadness=9500
3861 \setmultitablespacing
3862 \parskip=\multitableparskip
3863 \parindent=\multitableparindent
3864 \overfullrule=0pt
3865 \global\colcount=0
3867 \everycr = {%
3868 \noalign{%
3869 \global\everytab={}%
3870 \global\colcount=0 % Reset the column counter.
3871 % Check for saved footnotes, etc.
3872 \checkinserts
3873 % Keeps underfull box messages off when table breaks over pages.
3874 %\filbreak
3875 % Maybe so, but it also creates really weird page breaks when the
3876 % table breaks over pages. Wouldn't \vfil be better? Wait until the
3877 % problem manifests itself, so it can be fixed for real --karl.
3881 \parsearg\domultitable
3883 \def\domultitable#1{%
3884 % To parse everything between @multitable and @item:
3885 \setuptable#1 \endsetuptable
3887 % This preamble sets up a generic column definition, which will
3888 % be used as many times as user calls for columns.
3889 % \vtop will set a single line and will also let text wrap and
3890 % continue for many paragraphs if desired.
3891 \halign\bgroup &%
3892 \global\advance\colcount by 1
3893 \multistrut
3894 \vtop{%
3895 % Use the current \colcount to find the correct column width:
3896 \hsize=\expandafter\csname col\the\colcount\endcsname
3898 % In order to keep entries from bumping into each other
3899 % we will add a \leftskip of \multitablecolspace to all columns after
3900 % the first one.
3902 % If a template has been used, we will add \multitablecolspace
3903 % to the width of each template entry.
3905 % If the user has set preamble in terms of percent of \hsize we will
3906 % use that dimension as the width of the column, and the \leftskip
3907 % will keep entries from bumping into each other. Table will start at
3908 % left margin and final column will justify at right margin.
3910 % Make sure we don't inherit \rightskip from the outer environment.
3911 \rightskip=0pt
3912 \ifnum\colcount=1
3913 % The first column will be indented with the surrounding text.
3914 \advance\hsize by\leftskip
3915 \else
3916 \ifsetpercent \else
3917 % If user has not set preamble in terms of percent of \hsize
3918 % we will advance \hsize by \multitablecolspace.
3919 \advance\hsize by \multitablecolspace
3921 % In either case we will make \leftskip=\multitablecolspace:
3922 \leftskip=\multitablecolspace
3924 % Ignoring space at the beginning and end avoids an occasional spurious
3925 % blank line, when TeX decides to break the line at the space before the
3926 % box from the multistrut, so the strut ends up on a line by itself.
3927 % For example:
3928 % @multitable @columnfractions .11 .89
3929 % @item @code{#}
3930 % @tab Legal holiday which is valid in major parts of the whole country.
3931 % Is automatically provided with highlighting sequences respectively
3932 % marking characters.
3933 \noindent\ignorespaces##\unskip\multistrut
3934 }\cr
3936 \def\Emultitable{%
3937 \crcr
3938 \egroup % end the \halign
3939 \global\setpercentfalse
3942 \def\setmultitablespacing{%
3943 \def\multistrut{\strut}% just use the standard line spacing
3945 % Compute \multitablelinespace (if not defined by user) for use in
3946 % \multitableparskip calculation. We used define \multistrut based on
3947 % this, but (ironically) that caused the spacing to be off.
3948 % See bug-texinfo report from Werner Lemberg, 31 Oct 2004 12:52:20 +0100.
3949 \ifdim\multitablelinespace=0pt
3950 \setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip
3951 \global\advance\multitablelinespace by-\ht0
3953 % Test to see if parskip is larger than space between lines of
3954 % table. If not, do nothing.
3955 % If so, set to same dimension as multitablelinespace.
3956 \ifdim\multitableparskip>\multitablelinespace
3957 \global\multitableparskip=\multitablelinespace
3958 \global\advance\multitableparskip-7pt % to keep parskip somewhat smaller
3959 % than skip between lines in the table.
3960 \fi%
3961 \ifdim\multitableparskip=0pt
3962 \global\multitableparskip=\multitablelinespace
3963 \global\advance\multitableparskip-7pt % to keep parskip somewhat smaller
3964 % than skip between lines in the table.
3965 \fi}
3968 \message{conditionals,}
3970 % @iftex, @ifnotdocbook, @ifnothtml, @ifnotinfo, @ifnotplaintext,
3971 % @ifnotxml always succeed. They currently do nothing; we don't
3972 % attempt to check whether the conditionals are properly nested. But we
3973 % have to remember that they are conditionals, so that @end doesn't
3974 % attempt to close an environment group.
3976 \def\makecond#1{%
3977 \expandafter\let\csname #1\endcsname = \relax
3978 \expandafter\let\csname iscond.#1\endcsname = 1
3980 \makecond{iftex}
3981 \makecond{ifnotdocbook}
3982 \makecond{ifnothtml}
3983 \makecond{ifnotinfo}
3984 \makecond{ifnotplaintext}
3985 \makecond{ifnotxml}
3987 % Ignore @ignore, @ifhtml, @ifinfo, and the like.
3989 \def\direntry{\doignore{direntry}}
3990 \def\documentdescription{\doignore{documentdescription}}
3991 \def\docbook{\doignore{docbook}}
3992 \def\html{\doignore{html}}
3993 \def\ifdocbook{\doignore{ifdocbook}}
3994 \def\ifhtml{\doignore{ifhtml}}
3995 \def\ifinfo{\doignore{ifinfo}}
3996 \def\ifnottex{\doignore{ifnottex}}
3997 \def\ifplaintext{\doignore{ifplaintext}}
3998 \def\ifxml{\doignore{ifxml}}
3999 \def\ignore{\doignore{ignore}}
4000 \def\menu{\doignore{menu}}
4001 \def\xml{\doignore{xml}}
4003 % Ignore text until a line `@end #1', keeping track of nested conditionals.
4005 % A count to remember the depth of nesting.
4006 \newcount\doignorecount
4008 \def\doignore#1{\begingroup
4009 % Scan in ``verbatim'' mode:
4010 \obeylines
4011 \catcode`\@ = \other
4012 \catcode`\{ = \other
4013 \catcode`\} = \other
4015 % Make sure that spaces turn into tokens that match what \doignoretext wants.
4016 \spaceisspace
4018 % Count number of #1's that we've seen.
4019 \doignorecount = 0
4021 % Swallow text until we reach the matching `@end #1'.
4022 \dodoignore{#1}%
4025 { \catcode`_=11 % We want to use \_STOP_ which cannot appear in texinfo source.
4026 \obeylines %
4028 \gdef\dodoignore#1{%
4029 % #1 contains the command name as a string, e.g., `ifinfo'.
4031 % Define a command to find the next `@end #1'.
4032 \long\def\doignoretext##1^^M@end #1{%
4033 \doignoretextyyy##1^^M@#1\_STOP_}%
4035 % And this command to find another #1 command, at the beginning of a
4036 % line. (Otherwise, we would consider a line `@c @ifset', for
4037 % example, to count as an @ifset for nesting.)
4038 \long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}%
4040 % And now expand that command.
4041 \doignoretext ^^M%
4045 \def\doignoreyyy#1{%
4046 \def\temp{#1}%
4047 \ifx\temp\empty % Nothing found.
4048 \let\next\doignoretextzzz
4049 \else % Found a nested condition, ...
4050 \advance\doignorecount by 1
4051 \let\next\doignoretextyyy % ..., look for another.
4052 % If we're here, #1 ends with ^^M\ifinfo (for example).
4054 \next #1% the token \_STOP_ is present just after this macro.
4057 % We have to swallow the remaining "\_STOP_".
4059 \def\doignoretextzzz#1{%
4060 \ifnum\doignorecount = 0 % We have just found the outermost @end.
4061 \let\next\enddoignore
4062 \else % Still inside a nested condition.
4063 \advance\doignorecount by -1
4064 \let\next\doignoretext % Look for the next @end.
4066 \next
4069 % Finish off ignored text.
4070 { \obeylines%
4071 % Ignore anything after the last `@end #1'; this matters in verbatim
4072 % environments, where otherwise the newline after an ignored conditional
4073 % would result in a blank line in the output.
4074 \gdef\enddoignore#1^^M{\endgroup\ignorespaces}%
4078 % @set VAR sets the variable VAR to an empty value.
4079 % @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
4081 % Since we want to separate VAR from REST-OF-LINE (which might be
4082 % empty), we can't just use \parsearg; we have to insert a space of our
4083 % own to delimit the rest of the line, and then take it out again if we
4084 % didn't need it.
4085 % We rely on the fact that \parsearg sets \catcode`\ =10.
4087 \parseargdef\set{\setyyy#1 \endsetyyy}
4088 \def\setyyy#1 #2\endsetyyy{%
4090 \makevalueexpandable
4091 \def\temp{#2}%
4092 \edef\next{\gdef\makecsname{SET#1}}%
4093 \ifx\temp\empty
4094 \next{}%
4095 \else
4096 \setzzz#2\endsetzzz
4100 % Remove the trailing space \setxxx inserted.
4101 \def\setzzz#1 \endsetzzz{\next{#1}}
4103 % @clear VAR clears (i.e., unsets) the variable VAR.
4105 \parseargdef\clear{%
4107 \makevalueexpandable
4108 \global\expandafter\let\csname SET#1\endcsname=\relax
4112 % @value{foo} gets the text saved in variable foo.
4113 \def\value{\begingroup\makevalueexpandable\valuexxx}
4114 \def\valuexxx#1{\expandablevalue{#1}\endgroup}
4116 \catcode`\- = \active \catcode`\_ = \active
4118 \gdef\makevalueexpandable{%
4119 \let\value = \expandablevalue
4120 % We don't want these characters active, ...
4121 \catcode`\-=\other \catcode`\_=\other
4122 % ..., but we might end up with active ones in the argument if
4123 % we're called from @code, as @code{@value{foo-bar_}}, though.
4124 % So \let them to their normal equivalents.
4125 \let-\realdash \let_\normalunderscore
4129 % We have this subroutine so that we can handle at least some @value's
4130 % properly in indexes (we call \makevalueexpandable in \indexdummies).
4131 % The command has to be fully expandable (if the variable is set), since
4132 % the result winds up in the index file. This means that if the
4133 % variable's value contains other Texinfo commands, it's almost certain
4134 % it will fail (although perhaps we could fix that with sufficient work
4135 % to do a one-level expansion on the result, instead of complete).
4137 \def\expandablevalue#1{%
4138 \expandafter\ifx\csname SET#1\endcsname\relax
4139 {[No value for ``#1'']}%
4140 \message{Variable `#1', used in @value, is not set.}%
4141 \else
4142 \csname SET#1\endcsname
4146 % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
4147 % with @set.
4149 % To get special treatment of `@end ifset,' call \makeond and the redefine.
4151 \makecond{ifset}
4152 \def\ifset{\parsearg{\doifset{\let\next=\ifsetfail}}}
4153 \def\doifset#1#2{%
4155 \makevalueexpandable
4156 \let\next=\empty
4157 \expandafter\ifx\csname SET#2\endcsname\relax
4158 #1% If not set, redefine \next.
4160 \expandafter
4161 }\next
4163 \def\ifsetfail{\doignore{ifset}}
4165 % @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been
4166 % defined with @set, or has been undefined with @clear.
4168 % The `\else' inside the `\doifset' parameter is a trick to reuse the
4169 % above code: if the variable is not set, do nothing, if it is set,
4170 % then redefine \next to \ifclearfail.
4172 \makecond{ifclear}
4173 \def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}}
4174 \def\ifclearfail{\doignore{ifclear}}
4176 % @dircategory CATEGORY -- specify a category of the dir file
4177 % which this file should belong to. Ignore this in TeX.
4178 \let\dircategory=\comment
4180 % @defininfoenclose.
4181 \let\definfoenclose=\comment
4184 \message{indexing,}
4185 % Index generation facilities
4187 % Define \newwrite to be identical to plain tex's \newwrite
4188 % except not \outer, so it can be used within macros and \if's.
4189 \edef\newwrite{\makecsname{ptexnewwrite}}
4191 % \newindex {foo} defines an index named foo.
4192 % It automatically defines \fooindex such that
4193 % \fooindex ...rest of line... puts an entry in the index foo.
4194 % It also defines \fooindfile to be the number of the output channel for
4195 % the file that accumulates this index. The file's extension is foo.
4196 % The name of an index should be no more than 2 characters long
4197 % for the sake of vms.
4199 \def\newindex#1{%
4200 \iflinks
4201 \expandafter\newwrite \csname#1indfile\endcsname
4202 \openout \csname#1indfile\endcsname \jobname.#1 % Open the file
4204 \expandafter\xdef\csname#1index\endcsname{% % Define @#1index
4205 \noexpand\doindex{#1}}
4208 % @defindex foo == \newindex{foo}
4210 \def\defindex{\parsearg\newindex}
4212 % Define @defcodeindex, like @defindex except put all entries in @code.
4214 \def\defcodeindex{\parsearg\newcodeindex}
4216 \def\newcodeindex#1{%
4217 \iflinks
4218 \expandafter\newwrite \csname#1indfile\endcsname
4219 \openout \csname#1indfile\endcsname \jobname.#1
4221 \expandafter\xdef\csname#1index\endcsname{%
4222 \noexpand\docodeindex{#1}}%
4226 % @synindex foo bar makes index foo feed into index bar.
4227 % Do this instead of @defindex foo if you don't want it as a separate index.
4229 % @syncodeindex foo bar similar, but put all entries made for index foo
4230 % inside @code.
4232 \def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}}
4233 \def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}}
4235 % #1 is \doindex or \docodeindex, #2 the index getting redefined (foo),
4236 % #3 the target index (bar).
4237 \def\dosynindex#1#2#3{%
4238 % Only do \closeout if we haven't already done it, else we'll end up
4239 % closing the target index.
4240 \expandafter \ifx\csname donesynindex#2\endcsname \relax
4241 % The \closeout helps reduce unnecessary open files; the limit on the
4242 % Acorn RISC OS is a mere 16 files.
4243 \expandafter\closeout\csname#2indfile\endcsname
4244 \expandafter\let\csname donesynindex#2\endcsname = 1
4246 % redefine \fooindfile:
4247 \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname
4248 \expandafter\let\csname#2indfile\endcsname=\temp
4249 % redefine \fooindex:
4250 \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}%
4253 % Define \doindex, the driver for all \fooindex macros.
4254 % Argument #1 is generated by the calling \fooindex macro,
4255 % and it is "foo", the name of the index.
4257 % \doindex just uses \parsearg; it calls \doind for the actual work.
4258 % This is because \doind is more useful to call from other macros.
4260 % There is also \dosubind {index}{topic}{subtopic}
4261 % which makes an entry in a two-level index such as the operation index.
4263 \def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer}
4264 \def\singleindexer #1{\doind{\indexname}{#1}}
4266 % like the previous two, but they put @code around the argument.
4267 \def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
4268 \def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
4270 % Take care of Texinfo commands that can appear in an index entry.
4271 % Since there are some commands we want to expand, and others we don't,
4272 % we have to laboriously prevent expansion for those that we don't.
4274 \def\indexdummies{%
4275 \escapechar = `\\ % use backslash in output files.
4276 \def\@{@}% change to @@ when we switch to @ as escape char in index files.
4277 \def\ {\realbackslash\space }%
4279 % Need these unexpandable (because we define \tt as a dummy)
4280 % definitions when @{ or @} appear in index entry text. Also, more
4281 % complicated, when \tex is in effect and \{ is a \delimiter again.
4282 % We can't use \lbracecmd and \rbracecmd because texindex assumes
4283 % braces and backslashes are used only as delimiters. Perhaps we
4284 % should define @lbrace and @rbrace commands a la @comma.
4285 \def\{{{\tt\char123}}%
4286 \def\}{{\tt\char125}}%
4288 % I don't entirely understand this, but when an index entry is
4289 % generated from a macro call, the \endinput which \scanmacro inserts
4290 % causes processing to be prematurely terminated. This is,
4291 % apparently, because \indexsorttmp is fully expanded, and \endinput
4292 % is an expandable command. The redefinition below makes \endinput
4293 % disappear altogether for that purpose -- although logging shows that
4294 % processing continues to some further point. On the other hand, it
4295 % seems \endinput does not hurt in the printed index arg, since that
4296 % is still getting written without apparent harm.
4298 % Sample source (mac-idx3.tex, reported by Graham Percival to
4299 % help-texinfo, 22may06):
4300 % @macro funindex {WORD}
4301 % @findex xyz
4302 % @end macro
4303 % ...
4304 % @funindex commtest
4306 % The above is not enough to reproduce the bug, but it gives the flavor.
4308 % Sample whatsit resulting:
4309 % .@write3{\entry{xyz}{@folio }{@code {xyz@endinput }}}
4311 % So:
4312 \let\endinput = \empty
4314 % Do the redefinitions.
4315 \commondummies
4318 % For the aux and toc files, @ is the escape character. So we want to
4319 % redefine everything using @ as the escape character (instead of
4320 % \realbackslash, still used for index files). When everything uses @,
4321 % this will be simpler.
4323 \def\atdummies{%
4324 \def\@{@@}%
4325 \def\ {@ }%
4326 \let\{ = \lbraceatcmd
4327 \let\} = \rbraceatcmd
4329 % Do the redefinitions.
4330 \commondummies
4331 \otherbackslash
4334 % Called from \indexdummies and \atdummies.
4336 \def\commondummies{%
4338 % \definedummyword defines \#1 as \string\#1\space, thus effectively
4339 % preventing its expansion. This is used only for control words,
4340 % not control letters, because the \space would be incorrect for
4341 % control characters, but is needed to separate the control word
4342 % from whatever follows.
4344 % For control letters, we have \definedummyletter, which omits the
4345 % space.
4347 % These can be used both for control words that take an argument and
4348 % those that do not. If it is followed by {arg} in the input, then
4349 % that will dutifully get written to the index (or wherever).
4351 \def\definedummyword ##1{\def##1{\string##1\space}}%
4352 \def\definedummyletter##1{\def##1{\string##1}}%
4353 \let\definedummyaccent\definedummyletter
4355 \commondummiesnofonts
4357 \definedummyletter\_%
4358 \definedummyletter\-%
4360 % Non-English letters.
4361 \definedummyword\AA
4362 \definedummyword\AE
4363 \definedummyword\DH
4364 \definedummyword\L
4365 \definedummyword\O
4366 \definedummyword\OE
4367 \definedummyword\TH
4368 \definedummyword\aa
4369 \definedummyword\ae
4370 \definedummyword\dh
4371 \definedummyword\exclamdown
4372 \definedummyword\l
4373 \definedummyword\o
4374 \definedummyword\oe
4375 \definedummyword\ordf
4376 \definedummyword\ordm
4377 \definedummyword\questiondown
4378 \definedummyword\ss
4379 \definedummyword\th
4381 % Although these internal commands shouldn't show up, sometimes they do.
4382 \definedummyword\bf
4383 \definedummyword\gtr
4384 \definedummyword\hat
4385 \definedummyword\less
4386 \definedummyword\sf
4387 \definedummyword\sl
4388 \definedummyword\tclose
4389 \definedummyword\tt
4391 \definedummyword\LaTeX
4392 \definedummyword\TeX
4394 % Assorted special characters.
4395 \definedummyword\arrow
4396 \definedummyword\bullet
4397 \definedummyword\comma
4398 \definedummyword\copyright
4399 \definedummyword\registeredsymbol
4400 \definedummyword\dots
4401 \definedummyword\enddots
4402 \definedummyword\entrybreak
4403 \definedummyword\equiv
4404 \definedummyword\error
4405 \definedummyword\euro
4406 \definedummyword\expansion
4407 \definedummyword\geq
4408 \definedummyword\guillemetleft
4409 \definedummyword\guillemetright
4410 \definedummyword\guilsinglleft
4411 \definedummyword\guilsinglright
4412 \definedummyword\leq
4413 \definedummyword\minus
4414 \definedummyword\ogonek
4415 \definedummyword\pounds
4416 \definedummyword\point
4417 \definedummyword\print
4418 \definedummyword\quotedblbase
4419 \definedummyword\quotedblleft
4420 \definedummyword\quotedblright
4421 \definedummyword\quoteleft
4422 \definedummyword\quoteright
4423 \definedummyword\quotesinglbase
4424 \definedummyword\result
4425 \definedummyword\textdegree
4427 % We want to disable all macros so that they are not expanded by \write.
4428 \macrolist
4430 \normalturnoffactive
4432 % Handle some cases of @value -- where it does not contain any
4433 % (non-fully-expandable) commands.
4434 \makevalueexpandable
4437 % \commondummiesnofonts: common to \commondummies and \indexnofonts.
4439 \def\commondummiesnofonts{%
4440 % Control letters and accents.
4441 \definedummyletter\!%
4442 \definedummyaccent\"%
4443 \definedummyaccent\'%
4444 \definedummyletter\*%
4445 \definedummyaccent\,%
4446 \definedummyletter\.%
4447 \definedummyletter\/%
4448 \definedummyletter\:%
4449 \definedummyaccent\=%
4450 \definedummyletter\?%
4451 \definedummyaccent\^%
4452 \definedummyaccent\`%
4453 \definedummyaccent\~%
4454 \definedummyword\u
4455 \definedummyword\v
4456 \definedummyword\H
4457 \definedummyword\dotaccent
4458 \definedummyword\ogonek
4459 \definedummyword\ringaccent
4460 \definedummyword\tieaccent
4461 \definedummyword\ubaraccent
4462 \definedummyword\udotaccent
4463 \definedummyword\dotless
4465 % Texinfo font commands.
4466 \definedummyword\b
4467 \definedummyword\i
4468 \definedummyword\r
4469 \definedummyword\sansserif
4470 \definedummyword\sc
4471 \definedummyword\slanted
4472 \definedummyword\t
4474 % Commands that take arguments.
4475 \definedummyword\acronym
4476 \definedummyword\cite
4477 \definedummyword\code
4478 \definedummyword\command
4479 \definedummyword\dfn
4480 \definedummyword\dmn
4481 \definedummyword\email
4482 \definedummyword\emph
4483 \definedummyword\env
4484 \definedummyword\file
4485 \definedummyword\indicateurl
4486 \definedummyword\kbd
4487 \definedummyword\key
4488 \definedummyword\math
4489 \definedummyword\option
4490 \definedummyword\pxref
4491 \definedummyword\ref
4492 \definedummyword\samp
4493 \definedummyword\strong
4494 \definedummyword\tie
4495 \definedummyword\uref
4496 \definedummyword\url
4497 \definedummyword\var
4498 \definedummyword\verb
4499 \definedummyword\w
4500 \definedummyword\xref
4503 % \indexnofonts is used when outputting the strings to sort the index
4504 % by, and when constructing control sequence names. It eliminates all
4505 % control sequences and just writes whatever the best ASCII sort string
4506 % would be for a given command (usually its argument).
4508 \def\indexnofonts{%
4509 % Accent commands should become @asis.
4510 \def\definedummyaccent##1{\let##1\asis}%
4511 % We can just ignore other control letters.
4512 \def\definedummyletter##1{\let##1\empty}%
4513 % All control words become @asis by default; overrides below.
4514 \let\definedummyword\definedummyaccent
4516 \commondummiesnofonts
4518 % Don't no-op \tt, since it isn't a user-level command
4519 % and is used in the definitions of the active chars like <, >, |, etc.
4520 % Likewise with the other plain tex font commands.
4521 %\let\tt=\asis
4523 \def\ { }%
4524 \def\@{@}%
4525 \def\_{\normalunderscore}%
4526 \def\-{}% @- shouldn't affect sorting
4528 % Unfortunately, texindex is not prepared to handle braces in the
4529 % content at all. So for index sorting, we map @{ and @} to strings
4530 % starting with |, since that ASCII character is between ASCII { and }.
4531 \def\{{|a}%
4532 \def\}{|b}%
4534 % Non-English letters.
4535 \def\AA{AA}%
4536 \def\AE{AE}%
4537 \def\DH{DZZ}%
4538 \def\L{L}%
4539 \def\OE{OE}%
4540 \def\O{O}%
4541 \def\TH{ZZZ}%
4542 \def\aa{aa}%
4543 \def\ae{ae}%
4544 \def\dh{dzz}%
4545 \def\exclamdown{!}%
4546 \def\l{l}%
4547 \def\oe{oe}%
4548 \def\ordf{a}%
4549 \def\ordm{o}%
4550 \def\o{o}%
4551 \def\questiondown{?}%
4552 \def\ss{ss}%
4553 \def\th{zzz}%
4555 \def\LaTeX{LaTeX}%
4556 \def\TeX{TeX}%
4558 % Assorted special characters.
4559 % (The following {} will end up in the sort string, but that's ok.)
4560 \def\arrow{->}%
4561 \def\bullet{bullet}%
4562 \def\comma{,}%
4563 \def\copyright{copyright}%
4564 \def\dots{...}%
4565 \def\enddots{...}%
4566 \def\equiv{==}%
4567 \def\error{error}%
4568 \def\euro{euro}%
4569 \def\expansion{==>}%
4570 \def\geq{>=}%
4571 \def\guillemetleft{<<}%
4572 \def\guillemetright{>>}%
4573 \def\guilsinglleft{<}%
4574 \def\guilsinglright{>}%
4575 \def\leq{<=}%
4576 \def\minus{-}%
4577 \def\point{.}%
4578 \def\pounds{pounds}%
4579 \def\print{-|}%
4580 \def\quotedblbase{"}%
4581 \def\quotedblleft{"}%
4582 \def\quotedblright{"}%
4583 \def\quoteleft{`}%
4584 \def\quoteright{'}%
4585 \def\quotesinglbase{,}%
4586 \def\registeredsymbol{R}%
4587 \def\result{=>}%
4588 \def\textdegree{o}%
4590 \expandafter\ifx\csname SETtxiindexlquoteignore\endcsname\relax
4591 \else \indexlquoteignore \fi
4593 % We need to get rid of all macros, leaving only the arguments (if present).
4594 % Of course this is not nearly correct, but it is the best we can do for now.
4595 % makeinfo does not expand macros in the argument to @deffn, which ends up
4596 % writing an index entry, and texindex isn't prepared for an index sort entry
4597 % that starts with \.
4599 % Since macro invocations are followed by braces, we can just redefine them
4600 % to take a single TeX argument. The case of a macro invocation that
4601 % goes to end-of-line is not handled.
4603 \macrolist
4606 % Undocumented (for FSFS 2nd ed.): @set txiindexlquoteignore makes us
4607 % ignore left quotes in the sort term.
4608 {\catcode`\`=\active
4609 \gdef\indexlquoteignore{\let`=\empty}}
4611 \let\indexbackslash=0 %overridden during \printindex.
4612 \let\SETmarginindex=\relax % put index entries in margin (undocumented)?
4614 % Most index entries go through here, but \dosubind is the general case.
4615 % #1 is the index name, #2 is the entry text.
4616 \def\doind#1#2{\dosubind{#1}{#2}{}}
4618 % Workhorse for all \fooindexes.
4619 % #1 is name of index, #2 is stuff to put there, #3 is subentry --
4620 % empty if called from \doind, as we usually are (the main exception
4621 % is with most defuns, which call us directly).
4623 \def\dosubind#1#2#3{%
4624 \iflinks
4626 % Store the main index entry text (including the third arg).
4627 \toks0 = {#2}%
4628 % If third arg is present, precede it with a space.
4629 \def\thirdarg{#3}%
4630 \ifx\thirdarg\empty \else
4631 \toks0 = \expandafter{\the\toks0 \space #3}%
4634 \edef\writeto{\csname#1indfile\endcsname}%
4636 \safewhatsit\dosubindwrite
4641 % Write the entry in \toks0 to the index file:
4643 \def\dosubindwrite{%
4644 % Put the index entry in the margin if desired.
4645 \ifx\SETmarginindex\relax\else
4646 \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}%
4649 % Remember, we are within a group.
4650 \indexdummies % Must do this here, since \bf, etc expand at this stage
4651 \def\backslashcurfont{\indexbackslash}% \indexbackslash isn't defined now
4652 % so it will be output as is; and it will print as backslash.
4654 % Process the index entry with all font commands turned off, to
4655 % get the string to sort by.
4656 {\indexnofonts
4657 \edef\temp{\the\toks0}% need full expansion
4658 \xdef\indexsorttmp{\temp}%
4661 % Set up the complete index entry, with both the sort key and
4662 % the original text, including any font commands. We write
4663 % three arguments to \entry to the .?? file (four in the
4664 % subentry case), texindex reduces to two when writing the .??s
4665 % sorted result.
4666 \edef\temp{%
4667 \write\writeto{%
4668 \string\entry{\indexsorttmp}{\noexpand\folio}{\the\toks0}}%
4670 \temp
4673 % Take care of unwanted page breaks/skips around a whatsit:
4675 % If a skip is the last thing on the list now, preserve it
4676 % by backing up by \lastskip, doing the \write, then inserting
4677 % the skip again. Otherwise, the whatsit generated by the
4678 % \write or \pdfdest will make \lastskip zero. The result is that
4679 % sequences like this:
4680 % @end defun
4681 % @tindex whatever
4682 % @defun ...
4683 % will have extra space inserted, because the \medbreak in the
4684 % start of the @defun won't see the skip inserted by the @end of
4685 % the previous defun.
4687 % But don't do any of this if we're not in vertical mode. We
4688 % don't want to do a \vskip and prematurely end a paragraph.
4690 % Avoid page breaks due to these extra skips, too.
4692 % But wait, there is a catch there:
4693 % We'll have to check whether \lastskip is zero skip. \ifdim is not
4694 % sufficient for this purpose, as it ignores stretch and shrink parts
4695 % of the skip. The only way seems to be to check the textual
4696 % representation of the skip.
4698 % The following is almost like \def\zeroskipmacro{0.0pt} except that
4699 % the ``p'' and ``t'' characters have catcode \other, not 11 (letter).
4701 \edef\zeroskipmacro{\expandafter\the\csname z@skip\endcsname}
4703 \newskip\whatsitskip
4704 \newcount\whatsitpenalty
4706 % ..., ready, GO:
4708 \def\safewhatsit#1{%
4709 \ifhmode
4711 \else
4712 % \lastskip and \lastpenalty cannot both be nonzero simultaneously.
4713 \whatsitskip = \lastskip
4714 \edef\lastskipmacro{\the\lastskip}%
4715 \whatsitpenalty = \lastpenalty
4717 % If \lastskip is nonzero, that means the last item was a
4718 % skip. And since a skip is discardable, that means this
4719 % -\whatsitskip glue we're inserting is preceded by a
4720 % non-discardable item, therefore it is not a potential
4721 % breakpoint, therefore no \nobreak needed.
4722 \ifx\lastskipmacro\zeroskipmacro
4723 \else
4724 \vskip-\whatsitskip
4729 \ifx\lastskipmacro\zeroskipmacro
4730 % If \lastskip was zero, perhaps the last item was a penalty, and
4731 % perhaps it was >=10000, e.g., a \nobreak. In that case, we want
4732 % to re-insert the same penalty (values >10000 are used for various
4733 % signals); since we just inserted a non-discardable item, any
4734 % following glue (such as a \parskip) would be a breakpoint. For example:
4736 % @deffn deffn-whatever
4737 % @vindex index-whatever
4738 % Description.
4739 % would allow a break between the index-whatever whatsit
4740 % and the "Description." paragraph.
4741 \ifnum\whatsitpenalty>9999 \penalty\whatsitpenalty \fi
4742 \else
4743 % On the other hand, if we had a nonzero \lastskip,
4744 % this make-up glue would be preceded by a non-discardable item
4745 % (the whatsit from the \write), so we must insert a \nobreak.
4746 \nobreak\vskip\whatsitskip
4751 % The index entry written in the file actually looks like
4752 % \entry {sortstring}{page}{topic}
4753 % or
4754 % \entry {sortstring}{page}{topic}{subtopic}
4755 % The texindex program reads in these files and writes files
4756 % containing these kinds of lines:
4757 % \initial {c}
4758 % before the first topic whose initial is c
4759 % \entry {topic}{pagelist}
4760 % for a topic that is used without subtopics
4761 % \primary {topic}
4762 % for the beginning of a topic that is used with subtopics
4763 % \secondary {subtopic}{pagelist}
4764 % for each subtopic.
4766 % Define the user-accessible indexing commands
4767 % @findex, @vindex, @kindex, @cindex.
4769 \def\findex {\fnindex}
4770 \def\kindex {\kyindex}
4771 \def\cindex {\cpindex}
4772 \def\vindex {\vrindex}
4773 \def\tindex {\tpindex}
4774 \def\pindex {\pgindex}
4776 \def\cindexsub {\begingroup\obeylines\cindexsub}
4777 {\obeylines %
4778 \gdef\cindexsub "#1" #2^^M{\endgroup %
4779 \dosubind{cp}{#2}{#1}}}
4781 % Define the macros used in formatting output of the sorted index material.
4783 % @printindex causes a particular index (the ??s file) to get printed.
4784 % It does not print any chapter heading (usually an @unnumbered).
4786 \parseargdef\printindex{\begingroup
4787 \dobreak \chapheadingskip{10000}%
4789 \smallfonts \rm
4790 \tolerance = 9500
4791 \plainfrenchspacing
4792 \everypar = {}% don't want the \kern\-parindent from indentation suppression.
4794 % See if the index file exists and is nonempty.
4795 % Change catcode of @ here so that if the index file contains
4796 % \initial {@}
4797 % as its first line, TeX doesn't complain about mismatched braces
4798 % (because it thinks @} is a control sequence).
4799 \catcode`\@ = 11
4800 \openin 1 \jobname.#1s
4801 \ifeof 1
4802 % \enddoublecolumns gets confused if there is no text in the index,
4803 % and it loses the chapter title and the aux file entries for the
4804 % index. The easiest way to prevent this problem is to make sure
4805 % there is some text.
4806 \putwordIndexNonexistent
4807 \else
4809 % If the index file exists but is empty, then \openin leaves \ifeof
4810 % false. We have to make TeX try to read something from the file, so
4811 % it can discover if there is anything in it.
4812 \read 1 to \temp
4813 \ifeof 1
4814 \putwordIndexIsEmpty
4815 \else
4816 % Index files are almost Texinfo source, but we use \ as the escape
4817 % character. It would be better to use @, but that's too big a change
4818 % to make right now.
4819 \def\indexbackslash{\backslashcurfont}%
4820 \catcode`\\ = 0
4821 \escapechar = `\\
4822 \begindoublecolumns
4823 \input \jobname.#1s
4824 \enddoublecolumns
4827 \closein 1
4828 \endgroup}
4830 % These macros are used by the sorted index file itself.
4831 % Change them to control the appearance of the index.
4833 \def\initial#1{{%
4834 % Some minor font changes for the special characters.
4835 \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt
4837 % Remove any glue we may have, we'll be inserting our own.
4838 \removelastskip
4840 % We like breaks before the index initials, so insert a bonus.
4841 \nobreak
4842 \vskip 0pt plus 3\baselineskip
4843 \penalty 0
4844 \vskip 0pt plus -3\baselineskip
4846 % Typeset the initial. Making this add up to a whole number of
4847 % baselineskips increases the chance of the dots lining up from column
4848 % to column. It still won't often be perfect, because of the stretch
4849 % we need before each entry, but it's better.
4851 % No shrink because it confuses \balancecolumns.
4852 \vskip 1.67\baselineskip plus .5\baselineskip
4853 \leftline{\secbf #1}%
4854 % Do our best not to break after the initial.
4855 \nobreak
4856 \vskip .33\baselineskip plus .1\baselineskip
4859 % \entry typesets a paragraph consisting of the text (#1), dot leaders, and
4860 % then page number (#2) flushed to the right margin. It is used for index
4861 % and table of contents entries. The paragraph is indented by \leftskip.
4863 % A straightforward implementation would start like this:
4864 % \def\entry#1#2{...
4865 % But this freezes the catcodes in the argument, and can cause problems to
4866 % @code, which sets - active. This problem was fixed by a kludge---
4867 % ``-'' was active throughout whole index, but this isn't really right.
4868 % The right solution is to prevent \entry from swallowing the whole text.
4869 % --kasal, 21nov03
4870 \def\entry{%
4871 \begingroup
4873 % Start a new paragraph if necessary, so our assignments below can't
4874 % affect previous text.
4875 \par
4877 % Do not fill out the last line with white space.
4878 \parfillskip = 0in
4880 % No extra space above this paragraph.
4881 \parskip = 0in
4883 % Do not prefer a separate line ending with a hyphen to fewer lines.
4884 \finalhyphendemerits = 0
4886 % \hangindent is only relevant when the entry text and page number
4887 % don't both fit on one line. In that case, bob suggests starting the
4888 % dots pretty far over on the line. Unfortunately, a large
4889 % indentation looks wrong when the entry text itself is broken across
4890 % lines. So we use a small indentation and put up with long leaders.
4892 % \hangafter is reset to 1 (which is the value we want) at the start
4893 % of each paragraph, so we need not do anything with that.
4894 \hangindent = 2em
4896 % When the entry text needs to be broken, just fill out the first line
4897 % with blank space.
4898 \rightskip = 0pt plus1fil
4900 % A bit of stretch before each entry for the benefit of balancing
4901 % columns.
4902 \vskip 0pt plus1pt
4904 % When reading the text of entry, convert explicit line breaks
4905 % from @* into spaces. The user might give these in long section
4906 % titles, for instance.
4907 \def\*{\unskip\space\ignorespaces}%
4908 \def\entrybreak{\hfil\break}%
4910 % Swallow the left brace of the text (first parameter):
4911 \afterassignment\doentry
4912 \let\temp =
4914 \def\entrybreak{\unskip\space\ignorespaces}%
4915 \def\doentry{%
4916 \bgroup % Instead of the swallowed brace.
4917 \noindent
4918 \aftergroup\finishentry
4919 % And now comes the text of the entry.
4921 \def\finishentry#1{%
4922 % #1 is the page number.
4924 % The following is kludged to not output a line of dots in the index if
4925 % there are no page numbers. The next person who breaks this will be
4926 % cursed by a Unix daemon.
4927 \setbox\boxA = \hbox{#1}%
4928 \ifdim\wd\boxA = 0pt
4930 \else
4932 % If we must, put the page number on a line of its own, and fill out
4933 % this line with blank space. (The \hfil is overwhelmed with the
4934 % fill leaders glue in \indexdotfill if the page number does fit.)
4935 \hfil\penalty50
4936 \null\nobreak\indexdotfill % Have leaders before the page number.
4938 % The `\ ' here is removed by the implicit \unskip that TeX does as
4939 % part of (the primitive) \par. Without it, a spurious underfull
4940 % \hbox ensues.
4941 \ifpdf
4942 \pdfgettoks#1.%
4943 \ \the\toksA
4944 \else
4945 \ #1%
4948 \par
4949 \endgroup
4952 % Like plain.tex's \dotfill, except uses up at least 1 em.
4953 \def\indexdotfill{\cleaders
4954 \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1fill}
4956 \def\primary #1{\line{#1\hfil}}
4958 \newskip\secondaryindent \secondaryindent=0.5cm
4959 \def\secondary#1#2{{%
4960 \parfillskip=0in
4961 \parskip=0in
4962 \hangindent=1in
4963 \hangafter=1
4964 \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill
4965 \ifpdf
4966 \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph.
4967 \else
4970 \par
4973 % Define two-column mode, which we use to typeset indexes.
4974 % Adapted from the TeXbook, page 416, which is to say,
4975 % the manmac.tex format used to print the TeXbook itself.
4976 \catcode`\@=11
4978 \newbox\partialpage
4979 \newdimen\doublecolumnhsize
4981 \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
4982 % Grab any single-column material above us.
4983 \output = {%
4985 % Here is a possibility not foreseen in manmac: if we accumulate a
4986 % whole lot of material, we might end up calling this \output
4987 % routine twice in a row (see the doublecol-lose test, which is
4988 % essentially a couple of indexes with @setchapternewpage off). In
4989 % that case we just ship out what is in \partialpage with the normal
4990 % output routine. Generally, \partialpage will be empty when this
4991 % runs and this will be a no-op. See the indexspread.tex test case.
4992 \ifvoid\partialpage \else
4993 \onepageout{\pagecontents\partialpage}%
4996 \global\setbox\partialpage = \vbox{%
4997 % Unvbox the main output page.
4998 \unvbox\PAGE
4999 \kern-\topskip \kern\baselineskip
5002 \eject % run that output routine to set \partialpage
5004 % Use the double-column output routine for subsequent pages.
5005 \output = {\doublecolumnout}%
5007 % Change the page size parameters. We could do this once outside this
5008 % routine, in each of @smallbook, @afourpaper, and the default 8.5x11
5009 % format, but then we repeat the same computation. Repeating a couple
5010 % of assignments once per index is clearly meaningless for the
5011 % execution time, so we may as well do it in one place.
5013 % First we halve the line length, less a little for the gutter between
5014 % the columns. We compute the gutter based on the line length, so it
5015 % changes automatically with the paper format. The magic constant
5016 % below is chosen so that the gutter has the same value (well, +-<1pt)
5017 % as it did when we hard-coded it.
5019 % We put the result in a separate register, \doublecolumhsize, so we
5020 % can restore it in \pagesofar, after \hsize itself has (potentially)
5021 % been clobbered.
5023 \doublecolumnhsize = \hsize
5024 \advance\doublecolumnhsize by -.04154\hsize
5025 \divide\doublecolumnhsize by 2
5026 \hsize = \doublecolumnhsize
5028 % Double the \vsize as well. (We don't need a separate register here,
5029 % since nobody clobbers \vsize.)
5030 \vsize = 2\vsize
5033 % The double-column output routine for all double-column pages except
5034 % the last.
5036 \def\doublecolumnout{%
5037 \splittopskip=\topskip \splitmaxdepth=\maxdepth
5038 % Get the available space for the double columns -- the normal
5039 % (undoubled) page height minus any material left over from the
5040 % previous page.
5041 \dimen@ = \vsize
5042 \divide\dimen@ by 2
5043 \advance\dimen@ by -\ht\partialpage
5045 % box0 will be the left-hand column, box2 the right.
5046 \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
5047 \onepageout\pagesofar
5048 \unvbox255
5049 \penalty\outputpenalty
5052 % Re-output the contents of the output page -- any previous material,
5053 % followed by the two boxes we just split, in box0 and box2.
5054 \def\pagesofar{%
5055 \unvbox\partialpage
5057 \hsize = \doublecolumnhsize
5058 \wd0=\hsize \wd2=\hsize
5059 \hbox to\pagewidth{\box0\hfil\box2}%
5062 % All done with double columns.
5063 \def\enddoublecolumns{%
5064 % The following penalty ensures that the page builder is exercised
5065 % _before_ we change the output routine. This is necessary in the
5066 % following situation:
5068 % The last section of the index consists only of a single entry.
5069 % Before this section, \pagetotal is less than \pagegoal, so no
5070 % break occurs before the last section starts. However, the last
5071 % section, consisting of \initial and the single \entry, does not
5072 % fit on the page and has to be broken off. Without the following
5073 % penalty the page builder will not be exercised until \eject
5074 % below, and by that time we'll already have changed the output
5075 % routine to the \balancecolumns version, so the next-to-last
5076 % double-column page will be processed with \balancecolumns, which
5077 % is wrong: The two columns will go to the main vertical list, with
5078 % the broken-off section in the recent contributions. As soon as
5079 % the output routine finishes, TeX starts reconsidering the page
5080 % break. The two columns and the broken-off section both fit on the
5081 % page, because the two columns now take up only half of the page
5082 % goal. When TeX sees \eject from below which follows the final
5083 % section, it invokes the new output routine that we've set after
5084 % \balancecolumns below; \onepageout will try to fit the two columns
5085 % and the final section into the vbox of \pageheight (see
5086 % \pagebody), causing an overfull box.
5088 % Note that glue won't work here, because glue does not exercise the
5089 % page builder, unlike penalties (see The TeXbook, pp. 280-281).
5090 \penalty0
5092 \output = {%
5093 % Split the last of the double-column material. Leave it on the
5094 % current page, no automatic page break.
5095 \balancecolumns
5097 % If we end up splitting too much material for the current page,
5098 % though, there will be another page break right after this \output
5099 % invocation ends. Having called \balancecolumns once, we do not
5100 % want to call it again. Therefore, reset \output to its normal
5101 % definition right away. (We hope \balancecolumns will never be
5102 % called on to balance too much material, but if it is, this makes
5103 % the output somewhat more palatable.)
5104 \global\output = {\onepageout{\pagecontents\PAGE}}%
5106 \eject
5107 \endgroup % started in \begindoublecolumns
5109 % \pagegoal was set to the doubled \vsize above, since we restarted
5110 % the current page. We're now back to normal single-column
5111 % typesetting, so reset \pagegoal to the normal \vsize (after the
5112 % \endgroup where \vsize got restored).
5113 \pagegoal = \vsize
5116 % Called at the end of the double column material.
5117 \def\balancecolumns{%
5118 \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120.
5119 \dimen@ = \ht0
5120 \advance\dimen@ by \topskip
5121 \advance\dimen@ by-\baselineskip
5122 \divide\dimen@ by 2 % target to split to
5123 %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}%
5124 \splittopskip = \topskip
5125 % Loop until we get a decent breakpoint.
5127 \vbadness = 10000
5128 \loop
5129 \global\setbox3 = \copy0
5130 \global\setbox1 = \vsplit3 to \dimen@
5131 \ifdim\ht3>\dimen@
5132 \global\advance\dimen@ by 1pt
5133 \repeat
5135 %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}%
5136 \setbox0=\vbox to\dimen@{\unvbox1}%
5137 \setbox2=\vbox to\dimen@{\unvbox3}%
5139 \pagesofar
5141 \catcode`\@ = \other
5144 \message{sectioning,}
5145 % Chapters, sections, etc.
5147 % Let's start with @part.
5148 \outer\parseargdef\part{\partzzz{#1}}
5149 \def\partzzz#1{%
5150 \chapoddpage
5151 \null
5152 \vskip.3\vsize % move it down on the page a bit
5153 \begingroup
5154 \noindent \titlefonts\rmisbold #1\par % the text
5155 \let\lastnode=\empty % no node to associate with
5156 \writetocentry{part}{#1}{}% but put it in the toc
5157 \headingsoff % no headline or footline on the part page
5158 \chapoddpage
5159 \endgroup
5162 % \unnumberedno is an oxymoron. But we count the unnumbered
5163 % sections so that we can refer to them unambiguously in the pdf
5164 % outlines by their "section number". We avoid collisions with chapter
5165 % numbers by starting them at 10000. (If a document ever has 10000
5166 % chapters, we're in trouble anyway, I'm sure.)
5167 \newcount\unnumberedno \unnumberedno = 10000
5168 \newcount\chapno
5169 \newcount\secno \secno=0
5170 \newcount\subsecno \subsecno=0
5171 \newcount\subsubsecno \subsubsecno=0
5173 % This counter is funny since it counts through charcodes of letters A, B, ...
5174 \newcount\appendixno \appendixno = `\@
5176 % \def\appendixletter{\char\the\appendixno}
5177 % We do the following ugly conditional instead of the above simple
5178 % construct for the sake of pdftex, which needs the actual
5179 % letter in the expansion, not just typeset.
5181 \def\appendixletter{%
5182 \ifnum\appendixno=`A A%
5183 \else\ifnum\appendixno=`B B%
5184 \else\ifnum\appendixno=`C C%
5185 \else\ifnum\appendixno=`D D%
5186 \else\ifnum\appendixno=`E E%
5187 \else\ifnum\appendixno=`F F%
5188 \else\ifnum\appendixno=`G G%
5189 \else\ifnum\appendixno=`H H%
5190 \else\ifnum\appendixno=`I I%
5191 \else\ifnum\appendixno=`J J%
5192 \else\ifnum\appendixno=`K K%
5193 \else\ifnum\appendixno=`L L%
5194 \else\ifnum\appendixno=`M M%
5195 \else\ifnum\appendixno=`N N%
5196 \else\ifnum\appendixno=`O O%
5197 \else\ifnum\appendixno=`P P%
5198 \else\ifnum\appendixno=`Q Q%
5199 \else\ifnum\appendixno=`R R%
5200 \else\ifnum\appendixno=`S S%
5201 \else\ifnum\appendixno=`T T%
5202 \else\ifnum\appendixno=`U U%
5203 \else\ifnum\appendixno=`V V%
5204 \else\ifnum\appendixno=`W W%
5205 \else\ifnum\appendixno=`X X%
5206 \else\ifnum\appendixno=`Y Y%
5207 \else\ifnum\appendixno=`Z Z%
5208 % The \the is necessary, despite appearances, because \appendixletter is
5209 % expanded while writing the .toc file. \char\appendixno is not
5210 % expandable, thus it is written literally, thus all appendixes come out
5211 % with the same letter (or @) in the toc without it.
5212 \else\char\the\appendixno
5213 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
5214 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
5216 % Each @chapter defines these (using marks) as the number+name, number
5217 % and name of the chapter. Page headings and footings can use
5218 % these. @section does likewise.
5219 \def\thischapter{}
5220 \def\thischapternum{}
5221 \def\thischaptername{}
5222 \def\thissection{}
5223 \def\thissectionnum{}
5224 \def\thissectionname{}
5226 \newcount\absseclevel % used to calculate proper heading level
5227 \newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count
5229 % @raisesections: treat @section as chapter, @subsection as section, etc.
5230 \def\raisesections{\global\advance\secbase by -1}
5231 \let\up=\raisesections % original BFox name
5233 % @lowersections: treat @chapter as section, @section as subsection, etc.
5234 \def\lowersections{\global\advance\secbase by 1}
5235 \let\down=\lowersections % original BFox name
5237 % we only have subsub.
5238 \chardef\maxseclevel = 3
5240 % A numbered section within an unnumbered changes to unnumbered too.
5241 % To achieve this, remember the "biggest" unnum. sec. we are currently in:
5242 \chardef\unnlevel = \maxseclevel
5244 % Trace whether the current chapter is an appendix or not:
5245 % \chapheadtype is "N" or "A", unnumbered chapters are ignored.
5246 \def\chapheadtype{N}
5248 % Choose a heading macro
5249 % #1 is heading type
5250 % #2 is heading level
5251 % #3 is text for heading
5252 \def\genhead#1#2#3{%
5253 % Compute the abs. sec. level:
5254 \absseclevel=#2
5255 \advance\absseclevel by \secbase
5256 % Make sure \absseclevel doesn't fall outside the range:
5257 \ifnum \absseclevel < 0
5258 \absseclevel = 0
5259 \else
5260 \ifnum \absseclevel > 3
5261 \absseclevel = 3
5264 % The heading type:
5265 \def\headtype{#1}%
5266 \if \headtype U%
5267 \ifnum \absseclevel < \unnlevel
5268 \chardef\unnlevel = \absseclevel
5270 \else
5271 % Check for appendix sections:
5272 \ifnum \absseclevel = 0
5273 \edef\chapheadtype{\headtype}%
5274 \else
5275 \if \headtype A\if \chapheadtype N%
5276 \errmessage{@appendix... within a non-appendix chapter}%
5277 \fi\fi
5279 % Check for numbered within unnumbered:
5280 \ifnum \absseclevel > \unnlevel
5281 \def\headtype{U}%
5282 \else
5283 \chardef\unnlevel = 3
5286 % Now print the heading:
5287 \if \headtype U%
5288 \ifcase\absseclevel
5289 \unnumberedzzz{#3}%
5290 \or \unnumberedseczzz{#3}%
5291 \or \unnumberedsubseczzz{#3}%
5292 \or \unnumberedsubsubseczzz{#3}%
5294 \else
5295 \if \headtype A%
5296 \ifcase\absseclevel
5297 \appendixzzz{#3}%
5298 \or \appendixsectionzzz{#3}%
5299 \or \appendixsubseczzz{#3}%
5300 \or \appendixsubsubseczzz{#3}%
5302 \else
5303 \ifcase\absseclevel
5304 \chapterzzz{#3}%
5305 \or \seczzz{#3}%
5306 \or \numberedsubseczzz{#3}%
5307 \or \numberedsubsubseczzz{#3}%
5311 \suppressfirstparagraphindent
5314 % an interface:
5315 \def\numhead{\genhead N}
5316 \def\apphead{\genhead A}
5317 \def\unnmhead{\genhead U}
5319 % @chapter, @appendix, @unnumbered. Increment top-level counter, reset
5320 % all lower-level sectioning counters to zero.
5322 % Also set \chaplevelprefix, which we prepend to @float sequence numbers
5323 % (e.g., figures), q.v. By default (before any chapter), that is empty.
5324 \let\chaplevelprefix = \empty
5326 \outer\parseargdef\chapter{\numhead0{#1}} % normally numhead0 calls chapterzzz
5327 \def\chapterzzz#1{%
5328 % section resetting is \global in case the chapter is in a group, such
5329 % as an @include file.
5330 \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
5331 \global\advance\chapno by 1
5333 % Used for \float.
5334 \gdef\chaplevelprefix{\the\chapno.}%
5335 \resetallfloatnos
5337 % \putwordChapter can contain complex things in translations.
5338 \toks0=\expandafter{\putwordChapter}%
5339 \message{\the\toks0 \space \the\chapno}%
5341 % Write the actual heading.
5342 \chapmacro{#1}{Ynumbered}{\the\chapno}%
5344 % So @section and the like are numbered underneath this chapter.
5345 \global\let\section = \numberedsec
5346 \global\let\subsection = \numberedsubsec
5347 \global\let\subsubsection = \numberedsubsubsec
5350 \outer\parseargdef\appendix{\apphead0{#1}} % normally calls appendixzzz
5352 \def\appendixzzz#1{%
5353 \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
5354 \global\advance\appendixno by 1
5355 \gdef\chaplevelprefix{\appendixletter.}%
5356 \resetallfloatnos
5358 % \putwordAppendix can contain complex things in translations.
5359 \toks0=\expandafter{\putwordAppendix}%
5360 \message{\the\toks0 \space \appendixletter}%
5362 \chapmacro{#1}{Yappendix}{\appendixletter}%
5364 \global\let\section = \appendixsec
5365 \global\let\subsection = \appendixsubsec
5366 \global\let\subsubsection = \appendixsubsubsec
5369 % normally unnmhead0 calls unnumberedzzz:
5370 \outer\parseargdef\unnumbered{\unnmhead0{#1}}
5371 \def\unnumberedzzz#1{%
5372 \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
5373 \global\advance\unnumberedno by 1
5375 % Since an unnumbered has no number, no prefix for figures.
5376 \global\let\chaplevelprefix = \empty
5377 \resetallfloatnos
5379 % This used to be simply \message{#1}, but TeX fully expands the
5380 % argument to \message. Therefore, if #1 contained @-commands, TeX
5381 % expanded them. For example, in `@unnumbered The @cite{Book}', TeX
5382 % expanded @cite (which turns out to cause errors because \cite is meant
5383 % to be executed, not expanded).
5385 % Anyway, we don't want the fully-expanded definition of @cite to appear
5386 % as a result of the \message, we just want `@cite' itself. We use
5387 % \the<toks register> to achieve this: TeX expands \the<toks> only once,
5388 % simply yielding the contents of <toks register>. (We also do this for
5389 % the toc entries.)
5390 \toks0 = {#1}%
5391 \message{(\the\toks0)}%
5393 \chapmacro{#1}{Ynothing}{\the\unnumberedno}%
5395 \global\let\section = \unnumberedsec
5396 \global\let\subsection = \unnumberedsubsec
5397 \global\let\subsubsection = \unnumberedsubsubsec
5400 % @centerchap is like @unnumbered, but the heading is centered.
5401 \outer\parseargdef\centerchap{%
5402 % Well, we could do the following in a group, but that would break
5403 % an assumption that \chapmacro is called at the outermost level.
5404 % Thus we are safer this way: --kasal, 24feb04
5405 \let\centerparametersmaybe = \centerparameters
5406 \unnmhead0{#1}%
5407 \let\centerparametersmaybe = \relax
5410 % @top is like @unnumbered.
5411 \let\top\unnumbered
5413 % Sections.
5415 \outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz
5416 \def\seczzz#1{%
5417 \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
5418 \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}%
5421 % normally calls appendixsectionzzz:
5422 \outer\parseargdef\appendixsection{\apphead1{#1}}
5423 \def\appendixsectionzzz#1{%
5424 \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
5425 \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}%
5427 \let\appendixsec\appendixsection
5429 % normally calls unnumberedseczzz:
5430 \outer\parseargdef\unnumberedsec{\unnmhead1{#1}}
5431 \def\unnumberedseczzz#1{%
5432 \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
5433 \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}%
5436 % Subsections.
5438 % normally calls numberedsubseczzz:
5439 \outer\parseargdef\numberedsubsec{\numhead2{#1}}
5440 \def\numberedsubseczzz#1{%
5441 \global\subsubsecno=0 \global\advance\subsecno by 1
5442 \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}%
5445 % normally calls appendixsubseczzz:
5446 \outer\parseargdef\appendixsubsec{\apphead2{#1}}
5447 \def\appendixsubseczzz#1{%
5448 \global\subsubsecno=0 \global\advance\subsecno by 1
5449 \sectionheading{#1}{subsec}{Yappendix}%
5450 {\appendixletter.\the\secno.\the\subsecno}%
5453 % normally calls unnumberedsubseczzz:
5454 \outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}}
5455 \def\unnumberedsubseczzz#1{%
5456 \global\subsubsecno=0 \global\advance\subsecno by 1
5457 \sectionheading{#1}{subsec}{Ynothing}%
5458 {\the\unnumberedno.\the\secno.\the\subsecno}%
5461 % Subsubsections.
5463 % normally numberedsubsubseczzz:
5464 \outer\parseargdef\numberedsubsubsec{\numhead3{#1}}
5465 \def\numberedsubsubseczzz#1{%
5466 \global\advance\subsubsecno by 1
5467 \sectionheading{#1}{subsubsec}{Ynumbered}%
5468 {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}%
5471 % normally appendixsubsubseczzz:
5472 \outer\parseargdef\appendixsubsubsec{\apphead3{#1}}
5473 \def\appendixsubsubseczzz#1{%
5474 \global\advance\subsubsecno by 1
5475 \sectionheading{#1}{subsubsec}{Yappendix}%
5476 {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}%
5479 % normally unnumberedsubsubseczzz:
5480 \outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}}
5481 \def\unnumberedsubsubseczzz#1{%
5482 \global\advance\subsubsecno by 1
5483 \sectionheading{#1}{subsubsec}{Ynothing}%
5484 {\the\unnumberedno.\the\secno.\the\subsecno.\the\subsubsecno}%
5487 % These macros control what the section commands do, according
5488 % to what kind of chapter we are in (ordinary, appendix, or unnumbered).
5489 % Define them by default for a numbered chapter.
5490 \let\section = \numberedsec
5491 \let\subsection = \numberedsubsec
5492 \let\subsubsection = \numberedsubsubsec
5494 % Define @majorheading, @heading and @subheading
5496 % NOTE on use of \vbox for chapter headings, section headings, and such:
5497 % 1) We use \vbox rather than the earlier \line to permit
5498 % overlong headings to fold.
5499 % 2) \hyphenpenalty is set to 10000 because hyphenation in a
5500 % heading is obnoxious; this forbids it.
5501 % 3) Likewise, headings look best if no \parindent is used, and
5502 % if justification is not attempted. Hence \raggedright.
5504 \def\majorheading{%
5505 {\advance\chapheadingskip by 10pt \chapbreak }%
5506 \parsearg\chapheadingzzz
5509 \def\chapheading{\chapbreak \parsearg\chapheadingzzz}
5510 \def\chapheadingzzz#1{%
5511 {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
5512 \parindent=0pt\ptexraggedright
5513 \rmisbold #1\hfill}}%
5514 \bigskip \par\penalty 200\relax
5515 \suppressfirstparagraphindent
5518 % @heading, @subheading, @subsubheading.
5519 \parseargdef\heading{\sectionheading{#1}{sec}{Yomitfromtoc}{}
5520 \suppressfirstparagraphindent}
5521 \parseargdef\subheading{\sectionheading{#1}{subsec}{Yomitfromtoc}{}
5522 \suppressfirstparagraphindent}
5523 \parseargdef\subsubheading{\sectionheading{#1}{subsubsec}{Yomitfromtoc}{}
5524 \suppressfirstparagraphindent}
5526 % These macros generate a chapter, section, etc. heading only
5527 % (including whitespace, linebreaking, etc. around it),
5528 % given all the information in convenient, parsed form.
5530 % Args are the skip and penalty (usually negative)
5531 \def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}
5533 % Parameter controlling skip before chapter headings (if needed)
5534 \newskip\chapheadingskip
5536 % Define plain chapter starts, and page on/off switching for it.
5537 \def\chapbreak{\dobreak \chapheadingskip {-4000}}
5538 \def\chappager{\par\vfill\supereject}
5539 % Because \domark is called before \chapoddpage, the filler page will
5540 % get the headings for the next chapter, which is wrong. But we don't
5541 % care -- we just disable all headings on the filler page.
5542 \def\chapoddpage{%
5543 \chappager
5544 \ifodd\pageno \else
5545 \begingroup
5546 \headingsoff
5547 \null
5548 \chappager
5549 \endgroup
5553 \def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname}
5555 \def\CHAPPAGoff{%
5556 \global\let\contentsalignmacro = \chappager
5557 \global\let\pchapsepmacro=\chapbreak
5558 \global\let\pagealignmacro=\chappager}
5560 \def\CHAPPAGon{%
5561 \global\let\contentsalignmacro = \chappager
5562 \global\let\pchapsepmacro=\chappager
5563 \global\let\pagealignmacro=\chappager
5564 \global\def\HEADINGSon{\HEADINGSsingle}}
5566 \def\CHAPPAGodd{%
5567 \global\let\contentsalignmacro = \chapoddpage
5568 \global\let\pchapsepmacro=\chapoddpage
5569 \global\let\pagealignmacro=\chapoddpage
5570 \global\def\HEADINGSon{\HEADINGSdouble}}
5572 \CHAPPAGon
5574 % Chapter opening.
5576 % #1 is the text, #2 is the section type (Ynumbered, Ynothing,
5577 % Yappendix, Yomitfromtoc), #3 the chapter number.
5579 % To test against our argument.
5580 \def\Ynothingkeyword{Ynothing}
5581 \def\Yomitfromtockeyword{Yomitfromtoc}
5582 \def\Yappendixkeyword{Yappendix}
5584 \def\chapmacro#1#2#3{%
5585 % Insert the first mark before the heading break (see notes for \domark).
5586 \let\prevchapterdefs=\lastchapterdefs
5587 \let\prevsectiondefs=\lastsectiondefs
5588 \gdef\lastsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}%
5589 \gdef\thissection{}}%
5591 \def\temptype{#2}%
5592 \ifx\temptype\Ynothingkeyword
5593 \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
5594 \gdef\thischapter{\thischaptername}}%
5595 \else\ifx\temptype\Yomitfromtockeyword
5596 \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
5597 \gdef\thischapter{}}%
5598 \else\ifx\temptype\Yappendixkeyword
5599 \toks0={#1}%
5600 \xdef\lastchapterdefs{%
5601 \gdef\noexpand\thischaptername{\the\toks0}%
5602 \gdef\noexpand\thischapternum{\appendixletter}%
5603 % \noexpand\putwordAppendix avoids expanding indigestible
5604 % commands in some of the translations.
5605 \gdef\noexpand\thischapter{\noexpand\putwordAppendix{}
5606 \noexpand\thischapternum:
5607 \noexpand\thischaptername}%
5609 \else
5610 \toks0={#1}%
5611 \xdef\lastchapterdefs{%
5612 \gdef\noexpand\thischaptername{\the\toks0}%
5613 \gdef\noexpand\thischapternum{\the\chapno}%
5614 % \noexpand\putwordChapter avoids expanding indigestible
5615 % commands in some of the translations.
5616 \gdef\noexpand\thischapter{\noexpand\putwordChapter{}
5617 \noexpand\thischapternum:
5618 \noexpand\thischaptername}%
5620 \fi\fi\fi
5622 % Output the mark. Pass it through \safewhatsit, to take care of
5623 % the preceding space.
5624 \safewhatsit\domark
5626 % Insert the chapter heading break.
5627 \pchapsepmacro
5629 % Now the second mark, after the heading break. No break points
5630 % between here and the heading.
5631 \let\prevchapterdefs=\lastchapterdefs
5632 \let\prevsectiondefs=\lastsectiondefs
5633 \domark
5636 \chapfonts \rmisbold
5638 % Have to define \lastsection before calling \donoderef, because the
5639 % xref code eventually uses it. On the other hand, it has to be called
5640 % after \pchapsepmacro, or the headline will change too soon.
5641 \gdef\lastsection{#1}%
5643 % Only insert the separating space if we have a chapter/appendix
5644 % number, and don't print the unnumbered ``number''.
5645 \ifx\temptype\Ynothingkeyword
5646 \setbox0 = \hbox{}%
5647 \def\toctype{unnchap}%
5648 \else\ifx\temptype\Yomitfromtockeyword
5649 \setbox0 = \hbox{}% contents like unnumbered, but no toc entry
5650 \def\toctype{omit}%
5651 \else\ifx\temptype\Yappendixkeyword
5652 \setbox0 = \hbox{\putwordAppendix{} #3\enspace}%
5653 \def\toctype{app}%
5654 \else
5655 \setbox0 = \hbox{#3\enspace}%
5656 \def\toctype{numchap}%
5657 \fi\fi\fi
5659 % Write the toc entry for this chapter. Must come before the
5660 % \donoderef, because we include the current node name in the toc
5661 % entry, and \donoderef resets it to empty.
5662 \writetocentry{\toctype}{#1}{#3}%
5664 % For pdftex, we have to write out the node definition (aka, make
5665 % the pdfdest) after any page break, but before the actual text has
5666 % been typeset. If the destination for the pdf outline is after the
5667 % text, then jumping from the outline may wind up with the text not
5668 % being visible, for instance under high magnification.
5669 \donoderef{#2}%
5671 % Typeset the actual heading.
5672 \nobreak % Avoid page breaks at the interline glue.
5673 \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright
5674 \hangindent=\wd0 \centerparametersmaybe
5675 \unhbox0 #1\par}%
5677 \nobreak\bigskip % no page break after a chapter title
5678 \nobreak
5681 % @centerchap -- centered and unnumbered.
5682 \let\centerparametersmaybe = \relax
5683 \def\centerparameters{%
5684 \advance\rightskip by 3\rightskip
5685 \leftskip = \rightskip
5686 \parfillskip = 0pt
5690 % I don't think this chapter style is supported any more, so I'm not
5691 % updating it with the new noderef stuff. We'll see. --karl, 11aug03.
5693 \def\setchapterstyle #1 {\csname CHAPF#1\endcsname}
5695 \def\unnchfopen #1{%
5696 \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
5697 \parindent=0pt\ptexraggedright
5698 \rmisbold #1\hfill}}\bigskip \par\nobreak
5700 \def\chfopen #1#2{\chapoddpage {\chapfonts
5701 \vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}%
5702 \par\penalty 5000 %
5704 \def\centerchfopen #1{%
5705 \chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
5706 \parindent=0pt
5707 \hfill {\rmisbold #1}\hfill}}\bigskip \par\nobreak
5709 \def\CHAPFopen{%
5710 \global\let\chapmacro=\chfopen
5711 \global\let\centerchapmacro=\centerchfopen}
5714 % Section titles. These macros combine the section number parts and
5715 % call the generic \sectionheading to do the printing.
5717 \newskip\secheadingskip
5718 \def\secheadingbreak{\dobreak \secheadingskip{-1000}}
5720 % Subsection titles.
5721 \newskip\subsecheadingskip
5722 \def\subsecheadingbreak{\dobreak \subsecheadingskip{-500}}
5724 % Subsubsection titles.
5725 \def\subsubsecheadingskip{\subsecheadingskip}
5726 \def\subsubsecheadingbreak{\subsecheadingbreak}
5729 % Print any size, any type, section title.
5731 % #1 is the text, #2 is the section level (sec/subsec/subsubsec), #3 is
5732 % the section type for xrefs (Ynumbered, Ynothing, Yappendix), #4 is the
5733 % section number.
5735 \def\seckeyword{sec}
5737 \def\sectionheading#1#2#3#4{%
5739 \checkenv{}% should not be in an environment.
5741 % Switch to the right set of fonts.
5742 \csname #2fonts\endcsname \rmisbold
5744 \def\sectionlevel{#2}%
5745 \def\temptype{#3}%
5747 % Insert first mark before the heading break (see notes for \domark).
5748 \let\prevsectiondefs=\lastsectiondefs
5749 \ifx\temptype\Ynothingkeyword
5750 \ifx\sectionlevel\seckeyword
5751 \gdef\lastsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}%
5752 \gdef\thissection{\thissectionname}}%
5754 \else\ifx\temptype\Yomitfromtockeyword
5755 % Don't redefine \thissection.
5756 \else\ifx\temptype\Yappendixkeyword
5757 \ifx\sectionlevel\seckeyword
5758 \toks0={#1}%
5759 \xdef\lastsectiondefs{%
5760 \gdef\noexpand\thissectionname{\the\toks0}%
5761 \gdef\noexpand\thissectionnum{#4}%
5762 % \noexpand\putwordSection avoids expanding indigestible
5763 % commands in some of the translations.
5764 \gdef\noexpand\thissection{\noexpand\putwordSection{}
5765 \noexpand\thissectionnum:
5766 \noexpand\thissectionname}%
5769 \else
5770 \ifx\sectionlevel\seckeyword
5771 \toks0={#1}%
5772 \xdef\lastsectiondefs{%
5773 \gdef\noexpand\thissectionname{\the\toks0}%
5774 \gdef\noexpand\thissectionnum{#4}%
5775 % \noexpand\putwordSection avoids expanding indigestible
5776 % commands in some of the translations.
5777 \gdef\noexpand\thissection{\noexpand\putwordSection{}
5778 \noexpand\thissectionnum:
5779 \noexpand\thissectionname}%
5782 \fi\fi\fi
5784 % Go into vertical mode. Usually we'll already be there, but we
5785 % don't want the following whatsit to end up in a preceding paragraph
5786 % if the document didn't happen to have a blank line.
5787 \par
5789 % Output the mark. Pass it through \safewhatsit, to take care of
5790 % the preceding space.
5791 \safewhatsit\domark
5793 % Insert space above the heading.
5794 \csname #2headingbreak\endcsname
5796 % Now the second mark, after the heading break. No break points
5797 % between here and the heading.
5798 \let\prevsectiondefs=\lastsectiondefs
5799 \domark
5801 % Only insert the space after the number if we have a section number.
5802 \ifx\temptype\Ynothingkeyword
5803 \setbox0 = \hbox{}%
5804 \def\toctype{unn}%
5805 \gdef\lastsection{#1}%
5806 \else\ifx\temptype\Yomitfromtockeyword
5807 % for @headings -- no section number, don't include in toc,
5808 % and don't redefine \lastsection.
5809 \setbox0 = \hbox{}%
5810 \def\toctype{omit}%
5811 \let\sectionlevel=\empty
5812 \else\ifx\temptype\Yappendixkeyword
5813 \setbox0 = \hbox{#4\enspace}%
5814 \def\toctype{app}%
5815 \gdef\lastsection{#1}%
5816 \else
5817 \setbox0 = \hbox{#4\enspace}%
5818 \def\toctype{num}%
5819 \gdef\lastsection{#1}%
5820 \fi\fi\fi
5822 % Write the toc entry (before \donoderef). See comments in \chapmacro.
5823 \writetocentry{\toctype\sectionlevel}{#1}{#4}%
5825 % Write the node reference (= pdf destination for pdftex).
5826 % Again, see comments in \chapmacro.
5827 \donoderef{#3}%
5829 % Interline glue will be inserted when the vbox is completed.
5830 % That glue will be a valid breakpoint for the page, since it'll be
5831 % preceded by a whatsit (usually from the \donoderef, or from the
5832 % \writetocentry if there was no node). We don't want to allow that
5833 % break, since then the whatsits could end up on page n while the
5834 % section is on page n+1, thus toc/etc. are wrong. Debian bug 276000.
5835 \nobreak
5837 % Output the actual section heading.
5838 \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright
5839 \hangindent=\wd0 % zero if no section number
5840 \unhbox0 #1}%
5842 % Add extra space after the heading -- half of whatever came above it.
5843 % Don't allow stretch, though.
5844 \kern .5 \csname #2headingskip\endcsname
5846 % Do not let the kern be a potential breakpoint, as it would be if it
5847 % was followed by glue.
5848 \nobreak
5850 % We'll almost certainly start a paragraph next, so don't let that
5851 % glue accumulate. (Not a breakpoint because it's preceded by a
5852 % discardable item.)
5853 \vskip-\parskip
5855 % This is purely so the last item on the list is a known \penalty >
5856 % 10000. This is so \startdefun can avoid allowing breakpoints after
5857 % section headings. Otherwise, it would insert a valid breakpoint between:
5858 % @section sec-whatever
5859 % @deffn def-whatever
5860 \penalty 10001
5864 \message{toc,}
5865 % Table of contents.
5866 \newwrite\tocfile
5868 % Write an entry to the toc file, opening it if necessary.
5869 % Called from @chapter, etc.
5871 % Example usage: \writetocentry{sec}{Section Name}{\the\chapno.\the\secno}
5872 % We append the current node name (if any) and page number as additional
5873 % arguments for the \{chap,sec,...}entry macros which will eventually
5874 % read this. The node name is used in the pdf outlines as the
5875 % destination to jump to.
5877 % We open the .toc file for writing here instead of at @setfilename (or
5878 % any other fixed time) so that @contents can be anywhere in the document.
5879 % But if #1 is `omit', then we don't do anything. This is used for the
5880 % table of contents chapter openings themselves.
5882 \newif\iftocfileopened
5883 \def\omitkeyword{omit}%
5885 \def\writetocentry#1#2#3{%
5886 \edef\writetoctype{#1}%
5887 \ifx\writetoctype\omitkeyword \else
5888 \iftocfileopened\else
5889 \immediate\openout\tocfile = \jobname.toc
5890 \global\tocfileopenedtrue
5893 \iflinks
5894 {\atdummies
5895 \edef\temp{%
5896 \write\tocfile{@#1entry{#2}{#3}{\lastnode}{\noexpand\folio}}}%
5897 \temp
5902 % Tell \shipout to create a pdf destination on each page, if we're
5903 % writing pdf. These are used in the table of contents. We can't
5904 % just write one on every page because the title pages are numbered
5905 % 1 and 2 (the page numbers aren't printed), and so are the first
5906 % two pages of the document. Thus, we'd have two destinations named
5907 % `1', and two named `2'.
5908 \ifpdf \global\pdfmakepagedesttrue \fi
5912 % These characters do not print properly in the Computer Modern roman
5913 % fonts, so we must take special care. This is more or less redundant
5914 % with the Texinfo input format setup at the end of this file.
5916 \def\activecatcodes{%
5917 \catcode`\"=\active
5918 \catcode`\$=\active
5919 \catcode`\<=\active
5920 \catcode`\>=\active
5921 \catcode`\\=\active
5922 \catcode`\^=\active
5923 \catcode`\_=\active
5924 \catcode`\|=\active
5925 \catcode`\~=\active
5929 % Read the toc file, which is essentially Texinfo input.
5930 \def\readtocfile{%
5931 \setupdatafile
5932 \activecatcodes
5933 \input \tocreadfilename
5936 \newskip\contentsrightmargin \contentsrightmargin=1in
5937 \newcount\savepageno
5938 \newcount\lastnegativepageno \lastnegativepageno = -1
5940 % Prepare to read what we've written to \tocfile.
5942 \def\startcontents#1{%
5943 % If @setchapternewpage on, and @headings double, the contents should
5944 % start on an odd page, unlike chapters. Thus, we maintain
5945 % \contentsalignmacro in parallel with \pagealignmacro.
5946 % From: Torbjorn Granlund <tege@matematik.su.se>
5947 \contentsalignmacro
5948 \immediate\closeout\tocfile
5950 % Don't need to put `Contents' or `Short Contents' in the headline.
5951 % It is abundantly clear what they are.
5952 \chapmacro{#1}{Yomitfromtoc}{}%
5954 \savepageno = \pageno
5955 \begingroup % Set up to handle contents files properly.
5956 \raggedbottom % Worry more about breakpoints than the bottom.
5957 \advance\hsize by -\contentsrightmargin % Don't use the full line length.
5959 % Roman numerals for page numbers.
5960 \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi
5963 % redefined for the two-volume lispref. We always output on
5964 % \jobname.toc even if this is redefined.
5966 \def\tocreadfilename{\jobname.toc}
5968 % Normal (long) toc.
5970 \def\contents{%
5971 \startcontents{\putwordTOC}%
5972 \openin 1 \tocreadfilename\space
5973 \ifeof 1 \else
5974 \readtocfile
5976 \vfill \eject
5977 \contentsalignmacro % in case @setchapternewpage odd is in effect
5978 \ifeof 1 \else
5979 \pdfmakeoutlines
5981 \closein 1
5982 \endgroup
5983 \lastnegativepageno = \pageno
5984 \global\pageno = \savepageno
5987 % And just the chapters.
5988 \def\summarycontents{%
5989 \startcontents{\putwordShortTOC}%
5991 \let\partentry = \shortpartentry
5992 \let\numchapentry = \shortchapentry
5993 \let\appentry = \shortchapentry
5994 \let\unnchapentry = \shortunnchapentry
5995 % We want a true roman here for the page numbers.
5996 \secfonts
5997 \let\rm=\shortcontrm \let\bf=\shortcontbf
5998 \let\sl=\shortcontsl \let\tt=\shortconttt
6000 \hyphenpenalty = 10000
6001 \advance\baselineskip by 1pt % Open it up a little.
6002 \def\numsecentry##1##2##3##4{}
6003 \let\appsecentry = \numsecentry
6004 \let\unnsecentry = \numsecentry
6005 \let\numsubsecentry = \numsecentry
6006 \let\appsubsecentry = \numsecentry
6007 \let\unnsubsecentry = \numsecentry
6008 \let\numsubsubsecentry = \numsecentry
6009 \let\appsubsubsecentry = \numsecentry
6010 \let\unnsubsubsecentry = \numsecentry
6011 \openin 1 \tocreadfilename\space
6012 \ifeof 1 \else
6013 \readtocfile
6015 \closein 1
6016 \vfill \eject
6017 \contentsalignmacro % in case @setchapternewpage odd is in effect
6018 \endgroup
6019 \lastnegativepageno = \pageno
6020 \global\pageno = \savepageno
6022 \let\shortcontents = \summarycontents
6024 % Typeset the label for a chapter or appendix for the short contents.
6025 % The arg is, e.g., `A' for an appendix, or `3' for a chapter.
6027 \def\shortchaplabel#1{%
6028 % This space should be enough, since a single number is .5em, and the
6029 % widest letter (M) is 1em, at least in the Computer Modern fonts.
6030 % But use \hss just in case.
6031 % (This space doesn't include the extra space that gets added after
6032 % the label; that gets put in by \shortchapentry above.)
6034 % We'd like to right-justify chapter numbers, but that looks strange
6035 % with appendix letters. And right-justifying numbers and
6036 % left-justifying letters looks strange when there is less than 10
6037 % chapters. Have to read the whole toc once to know how many chapters
6038 % there are before deciding ...
6039 \hbox to 1em{#1\hss}%
6042 % These macros generate individual entries in the table of contents.
6043 % The first argument is the chapter or section name.
6044 % The last argument is the page number.
6045 % The arguments in between are the chapter number, section number, ...
6047 % Parts, in the main contents. Replace the part number, which doesn't
6048 % exist, with an empty box. Let's hope all the numbers have the same width.
6049 % Also ignore the page number, which is conventionally not printed.
6050 \def\numeralbox{\setbox0=\hbox{8}\hbox to \wd0{\hfil}}
6051 \def\partentry#1#2#3#4{\dochapentry{\numeralbox\labelspace#1}{}}
6053 % Parts, in the short toc.
6054 \def\shortpartentry#1#2#3#4{%
6055 \penalty-300
6056 \vskip.5\baselineskip plus.15\baselineskip minus.1\baselineskip
6057 \shortchapentry{{\bf #1}}{\numeralbox}{}{}%
6060 % Chapters, in the main contents.
6061 \def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}}
6063 % Chapters, in the short toc.
6064 % See comments in \dochapentry re vbox and related settings.
6065 \def\shortchapentry#1#2#3#4{%
6066 \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#4\egroup}%
6069 % Appendices, in the main contents.
6070 % Need the word Appendix, and a fixed-size box.
6072 \def\appendixbox#1{%
6073 % We use M since it's probably the widest letter.
6074 \setbox0 = \hbox{\putwordAppendix{} M}%
6075 \hbox to \wd0{\putwordAppendix{} #1\hss}}
6077 \def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\labelspace#1}{#4}}
6079 % Unnumbered chapters.
6080 \def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}}
6081 \def\shortunnchapentry#1#2#3#4{\tocentry{#1}{\doshortpageno\bgroup#4\egroup}}
6083 % Sections.
6084 \def\numsecentry#1#2#3#4{\dosecentry{#2\labelspace#1}{#4}}
6085 \let\appsecentry=\numsecentry
6086 \def\unnsecentry#1#2#3#4{\dosecentry{#1}{#4}}
6088 % Subsections.
6089 \def\numsubsecentry#1#2#3#4{\dosubsecentry{#2\labelspace#1}{#4}}
6090 \let\appsubsecentry=\numsubsecentry
6091 \def\unnsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}}
6093 % And subsubsections.
6094 \def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#2\labelspace#1}{#4}}
6095 \let\appsubsubsecentry=\numsubsubsecentry
6096 \def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#4}}
6098 % This parameter controls the indentation of the various levels.
6099 % Same as \defaultparindent.
6100 \newdimen\tocindent \tocindent = 15pt
6102 % Now for the actual typesetting. In all these, #1 is the text and #2 is the
6103 % page number.
6105 % If the toc has to be broken over pages, we want it to be at chapters
6106 % if at all possible; hence the \penalty.
6107 \def\dochapentry#1#2{%
6108 \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip
6109 \begingroup
6110 \chapentryfonts
6111 \tocentry{#1}{\dopageno\bgroup#2\egroup}%
6112 \endgroup
6113 \nobreak\vskip .25\baselineskip plus.1\baselineskip
6116 \def\dosecentry#1#2{\begingroup
6117 \secentryfonts \leftskip=\tocindent
6118 \tocentry{#1}{\dopageno\bgroup#2\egroup}%
6119 \endgroup}
6121 \def\dosubsecentry#1#2{\begingroup
6122 \subsecentryfonts \leftskip=2\tocindent
6123 \tocentry{#1}{\dopageno\bgroup#2\egroup}%
6124 \endgroup}
6126 \def\dosubsubsecentry#1#2{\begingroup
6127 \subsubsecentryfonts \leftskip=3\tocindent
6128 \tocentry{#1}{\dopageno\bgroup#2\egroup}%
6129 \endgroup}
6131 % We use the same \entry macro as for the index entries.
6132 \let\tocentry = \entry
6134 % Space between chapter (or whatever) number and the title.
6135 \def\labelspace{\hskip1em \relax}
6137 \def\dopageno#1{{\rm #1}}
6138 \def\doshortpageno#1{{\rm #1}}
6140 \def\chapentryfonts{\secfonts \rm}
6141 \def\secentryfonts{\textfonts}
6142 \def\subsecentryfonts{\textfonts}
6143 \def\subsubsecentryfonts{\textfonts}
6146 \message{environments,}
6147 % @foo ... @end foo.
6149 % @tex ... @end tex escapes into raw TeX temporarily.
6150 % One exception: @ is still an escape character, so that @end tex works.
6151 % But \@ or @@ will get a plain @ character.
6153 \envdef\tex{%
6154 \setupmarkupstyle{tex}%
6155 \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
6156 \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
6157 \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie
6158 \catcode `\%=14
6159 \catcode `\+=\other
6160 \catcode `\"=\other
6161 \catcode `\|=\other
6162 \catcode `\<=\other
6163 \catcode `\>=\other
6164 \catcode`\`=\other
6165 \catcode`\'=\other
6166 \escapechar=`\\
6168 % ' is active in math mode (mathcode"8000). So reset it, and all our
6169 % other math active characters (just in case), to plain's definitions.
6170 \mathactive
6172 \let\b=\ptexb
6173 \let\bullet=\ptexbullet
6174 \let\c=\ptexc
6175 \let\,=\ptexcomma
6176 \let\.=\ptexdot
6177 \let\dots=\ptexdots
6178 \let\equiv=\ptexequiv
6179 \let\!=\ptexexclam
6180 \let\i=\ptexi
6181 \let\indent=\ptexindent
6182 \let\noindent=\ptexnoindent
6183 \let\{=\ptexlbrace
6184 \let\+=\tabalign
6185 \let\}=\ptexrbrace
6186 \let\/=\ptexslash
6187 \let\*=\ptexstar
6188 \let\t=\ptext
6189 \expandafter \let\csname top\endcsname=\ptextop % outer
6190 \let\frenchspacing=\plainfrenchspacing
6192 \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
6193 \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}%
6194 \def\@{@}%
6196 % There is no need to define \Etex.
6198 % Define @lisp ... @end lisp.
6199 % @lisp environment forms a group so it can rebind things,
6200 % including the definition of @end lisp (which normally is erroneous).
6202 % Amount to narrow the margins by for @lisp.
6203 \newskip\lispnarrowing \lispnarrowing=0.4in
6205 % This is the definition that ^^M gets inside @lisp, @example, and other
6206 % such environments. \null is better than a space, since it doesn't
6207 % have any width.
6208 \def\lisppar{\null\endgraf}
6210 % This space is always present above and below environments.
6211 \newskip\envskipamount \envskipamount = 0pt
6213 % Make spacing and below environment symmetrical. We use \parskip here
6214 % to help in doing that, since in @example-like environments \parskip
6215 % is reset to zero; thus the \afterenvbreak inserts no space -- but the
6216 % start of the next paragraph will insert \parskip.
6218 \def\aboveenvbreak{{%
6219 % =10000 instead of <10000 because of a special case in \itemzzz and
6220 % \sectionheading, q.v.
6221 \ifnum \lastpenalty=10000 \else
6222 \advance\envskipamount by \parskip
6223 \endgraf
6224 \ifdim\lastskip<\envskipamount
6225 \removelastskip
6226 % it's not a good place to break if the last penalty was \nobreak
6227 % or better ...
6228 \ifnum\lastpenalty<10000 \penalty-50 \fi
6229 \vskip\envskipamount
6234 \let\afterenvbreak = \aboveenvbreak
6236 % \nonarrowing is a flag. If "set", @lisp etc don't narrow margins; it will
6237 % also clear it, so that its embedded environments do the narrowing again.
6238 \let\nonarrowing=\relax
6240 % @cartouche ... @end cartouche: draw rectangle w/rounded corners around
6241 % environment contents.
6242 \font\circle=lcircle10
6243 \newdimen\circthick
6244 \newdimen\cartouter\newdimen\cartinner
6245 \newskip\normbskip\newskip\normpskip\newskip\normlskip
6246 \circthick=\fontdimen8\circle
6248 \def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth
6249 \def\ctr{{\hskip 6pt\circle\char'010}}
6250 \def\cbl{{\circle\char'012\hskip -6pt}}
6251 \def\cbr{{\hskip 6pt\circle\char'011}}
6252 \def\carttop{\hbox to \cartouter{\hskip\lskip
6253 \ctl\leaders\hrule height\circthick\hfil\ctr
6254 \hskip\rskip}}
6255 \def\cartbot{\hbox to \cartouter{\hskip\lskip
6256 \cbl\leaders\hrule height\circthick\hfil\cbr
6257 \hskip\rskip}}
6259 \newskip\lskip\newskip\rskip
6261 \envdef\cartouche{%
6262 \ifhmode\par\fi % can't be in the midst of a paragraph.
6263 \startsavinginserts
6264 \lskip=\leftskip \rskip=\rightskip
6265 \leftskip=0pt\rightskip=0pt % we want these *outside*.
6266 \cartinner=\hsize \advance\cartinner by-\lskip
6267 \advance\cartinner by-\rskip
6268 \cartouter=\hsize
6269 \advance\cartouter by 18.4pt % allow for 3pt kerns on either
6270 % side, and for 6pt waste from
6271 % each corner char, and rule thickness
6272 \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
6273 % Flag to tell @lisp, etc., not to narrow margin.
6274 \let\nonarrowing = t%
6276 % If this cartouche directly follows a sectioning command, we need the
6277 % \parskip glue (backspaced over by default) or the cartouche can
6278 % collide with the section heading.
6279 \ifnum\lastpenalty>10000 \vskip\parskip \fi
6281 \vbox\bgroup
6282 \baselineskip=0pt\parskip=0pt\lineskip=0pt
6283 \carttop
6284 \hbox\bgroup
6285 \hskip\lskip
6286 \vrule\kern3pt
6287 \vbox\bgroup
6288 \kern3pt
6289 \hsize=\cartinner
6290 \baselineskip=\normbskip
6291 \lineskip=\normlskip
6292 \parskip=\normpskip
6293 \vskip -\parskip
6294 \comment % For explanation, see the end of def\group.
6296 \def\Ecartouche{%
6297 \ifhmode\par\fi
6298 \kern3pt
6299 \egroup
6300 \kern3pt\vrule
6301 \hskip\rskip
6302 \egroup
6303 \cartbot
6304 \egroup
6305 \checkinserts
6309 % This macro is called at the beginning of all the @example variants,
6310 % inside a group.
6311 \newdimen\nonfillparindent
6312 \def\nonfillstart{%
6313 \aboveenvbreak
6314 \hfuzz = 12pt % Don't be fussy
6315 \sepspaces % Make spaces be word-separators rather than space tokens.
6316 \let\par = \lisppar % don't ignore blank lines
6317 \obeylines % each line of input is a line of output
6318 \parskip = 0pt
6319 % Turn off paragraph indentation but redefine \indent to emulate
6320 % the normal \indent.
6321 \nonfillparindent=\parindent
6322 \parindent = 0pt
6323 \let\indent\nonfillindent
6325 \emergencystretch = 0pt % don't try to avoid overfull boxes
6326 \ifx\nonarrowing\relax
6327 \advance \leftskip by \lispnarrowing
6328 \exdentamount=\lispnarrowing
6329 \else
6330 \let\nonarrowing = \relax
6332 \let\exdent=\nofillexdent
6335 \begingroup
6336 \obeyspaces
6337 % We want to swallow spaces (but not other tokens) after the fake
6338 % @indent in our nonfill-environments, where spaces are normally
6339 % active and set to @tie, resulting in them not being ignored after
6340 % @indent.
6341 \gdef\nonfillindent{\futurelet\temp\nonfillindentcheck}%
6342 \gdef\nonfillindentcheck{%
6343 \ifx\temp %
6344 \expandafter\nonfillindentgobble%
6345 \else%
6346 \leavevmode\nonfillindentbox%
6347 \fi%
6349 \endgroup
6350 \def\nonfillindentgobble#1{\nonfillindent}
6351 \def\nonfillindentbox{\hbox to \nonfillparindent{\hss}}
6353 % If you want all examples etc. small: @set dispenvsize small.
6354 % If you want even small examples the full size: @set dispenvsize nosmall.
6355 % This affects the following displayed environments:
6356 % @example, @display, @format, @lisp
6358 \def\smallword{small}
6359 \def\nosmallword{nosmall}
6360 \let\SETdispenvsize\relax
6361 \def\setnormaldispenv{%
6362 \ifx\SETdispenvsize\smallword
6363 % end paragraph for sake of leading, in case document has no blank
6364 % line. This is redundant with what happens in \aboveenvbreak, but
6365 % we need to do it before changing the fonts, and it's inconvenient
6366 % to change the fonts afterward.
6367 \ifnum \lastpenalty=10000 \else \endgraf \fi
6368 \smallexamplefonts \rm
6371 \def\setsmalldispenv{%
6372 \ifx\SETdispenvsize\nosmallword
6373 \else
6374 \ifnum \lastpenalty=10000 \else \endgraf \fi
6375 \smallexamplefonts \rm
6379 % We often define two environments, @foo and @smallfoo.
6380 % Let's do it in one command. #1 is the env name, #2 the definition.
6381 \def\makedispenvdef#1#2{%
6382 \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2}%
6383 \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2}%
6384 \expandafter\let\csname E#1\endcsname \afterenvbreak
6385 \expandafter\let\csname Esmall#1\endcsname \afterenvbreak
6388 % Define two environment synonyms (#1 and #2) for an environment.
6389 \def\maketwodispenvdef#1#2#3{%
6390 \makedispenvdef{#1}{#3}%
6391 \makedispenvdef{#2}{#3}%
6394 % @lisp: indented, narrowed, typewriter font;
6395 % @example: same as @lisp.
6397 % @smallexample and @smalllisp: use smaller fonts.
6398 % Originally contributed by Pavel@xerox.
6400 \maketwodispenvdef{lisp}{example}{%
6401 \nonfillstart
6402 \tt\setupmarkupstyle{example}%
6403 \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
6404 \gobble % eat return
6406 % @display/@smalldisplay: same as @lisp except keep current font.
6408 \makedispenvdef{display}{%
6409 \nonfillstart
6410 \gobble
6413 % @format/@smallformat: same as @display except don't narrow margins.
6415 \makedispenvdef{format}{%
6416 \let\nonarrowing = t%
6417 \nonfillstart
6418 \gobble
6421 % @flushleft: same as @format, but doesn't obey \SETdispenvsize.
6422 \envdef\flushleft{%
6423 \let\nonarrowing = t%
6424 \nonfillstart
6425 \gobble
6427 \let\Eflushleft = \afterenvbreak
6429 % @flushright.
6431 \envdef\flushright{%
6432 \let\nonarrowing = t%
6433 \nonfillstart
6434 \advance\leftskip by 0pt plus 1fill\relax
6435 \gobble
6437 \let\Eflushright = \afterenvbreak
6440 % @raggedright does more-or-less normal line breaking but no right
6441 % justification. From plain.tex.
6442 \envdef\raggedright{%
6443 \rightskip0pt plus2em \spaceskip.3333em \xspaceskip.5em\relax
6445 \let\Eraggedright\par
6447 \envdef\raggedleft{%
6448 \parindent=0pt \leftskip0pt plus2em
6449 \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt
6450 \hbadness=10000 % Last line will usually be underfull, so turn off
6451 % badness reporting.
6453 \let\Eraggedleft\par
6455 \envdef\raggedcenter{%
6456 \parindent=0pt \rightskip0pt plus1em \leftskip0pt plus1em
6457 \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt
6458 \hbadness=10000 % Last line will usually be underfull, so turn off
6459 % badness reporting.
6461 \let\Eraggedcenter\par
6464 % @quotation does normal linebreaking (hence we can't use \nonfillstart)
6465 % and narrows the margins. We keep \parskip nonzero in general, since
6466 % we're doing normal filling. So, when using \aboveenvbreak and
6467 % \afterenvbreak, temporarily make \parskip 0.
6469 \makedispenvdef{quotation}{\quotationstart}
6471 \def\quotationstart{%
6472 {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
6473 \parindent=0pt
6475 % @cartouche defines \nonarrowing to inhibit narrowing at next level down.
6476 \ifx\nonarrowing\relax
6477 \advance\leftskip by \lispnarrowing
6478 \advance\rightskip by \lispnarrowing
6479 \exdentamount = \lispnarrowing
6480 \else
6481 \let\nonarrowing = \relax
6483 \parsearg\quotationlabel
6486 % We have retained a nonzero parskip for the environment, since we're
6487 % doing normal filling.
6489 \def\Equotation{%
6490 \par
6491 \ifx\quotationauthor\thisisundefined\else
6492 % indent a bit.
6493 \leftline{\kern 2\leftskip \sl ---\quotationauthor}%
6495 {\parskip=0pt \afterenvbreak}%
6497 \def\Esmallquotation{\Equotation}
6499 % If we're given an argument, typeset it in bold with a colon after.
6500 \def\quotationlabel#1{%
6501 \def\temp{#1}%
6502 \ifx\temp\empty \else
6503 {\bf #1: }%
6508 % LaTeX-like @verbatim...@end verbatim and @verb{<char>...<char>}
6509 % If we want to allow any <char> as delimiter,
6510 % we need the curly braces so that makeinfo sees the @verb command, eg:
6511 % `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org
6513 % [Knuth]: Donald Ervin Knuth, 1996. The TeXbook.
6515 % [Knuth] p.344; only we need to do the other characters Texinfo sets
6516 % active too. Otherwise, they get lost as the first character on a
6517 % verbatim line.
6518 \def\dospecials{%
6519 \do\ \do\\\do\{\do\}\do\$\do\&%
6520 \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~%
6521 \do\<\do\>\do\|\do\@\do+\do\"%
6522 % Don't do the quotes -- if we do, @set txicodequoteundirected and
6523 % @set txicodequotebacktick will not have effect on @verb and
6524 % @verbatim, and ?` and !` ligatures won't get disabled.
6525 %\do\`\do\'%
6528 % [Knuth] p. 380
6529 \def\uncatcodespecials{%
6530 \def\do##1{\catcode`##1=\other}\dospecials}
6532 % Setup for the @verb command.
6534 % Eight spaces for a tab
6535 \begingroup
6536 \catcode`\^^I=\active
6537 \gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }}
6538 \endgroup
6540 \def\setupverb{%
6541 \tt % easiest (and conventionally used) font for verbatim
6542 \def\par{\leavevmode\endgraf}%
6543 \setupmarkupstyle{verb}%
6544 \tabeightspaces
6545 % Respect line breaks,
6546 % print special symbols as themselves, and
6547 % make each space count
6548 % must do in this order:
6549 \obeylines \uncatcodespecials \sepspaces
6552 % Setup for the @verbatim environment
6554 % Real tab expansion.
6555 \newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount
6557 % We typeset each line of the verbatim in an \hbox, so we can handle
6558 % tabs. The \global is in case the verbatim line starts with an accent,
6559 % or some other command that starts with a begin-group. Otherwise, the
6560 % entire \verbbox would disappear at the corresponding end-group, before
6561 % it is typeset. Meanwhile, we can't have nested verbatim commands
6562 % (can we?), so the \global won't be overwriting itself.
6563 \newbox\verbbox
6564 \def\starttabbox{\global\setbox\verbbox=\hbox\bgroup}
6566 \begingroup
6567 \catcode`\^^I=\active
6568 \gdef\tabexpand{%
6569 \catcode`\^^I=\active
6570 \def^^I{\leavevmode\egroup
6571 \dimen\verbbox=\wd\verbbox % the width so far, or since the previous tab
6572 \divide\dimen\verbbox by\tabw
6573 \multiply\dimen\verbbox by\tabw % compute previous multiple of \tabw
6574 \advance\dimen\verbbox by\tabw % advance to next multiple of \tabw
6575 \wd\verbbox=\dimen\verbbox \box\verbbox \starttabbox
6578 \endgroup
6580 % start the verbatim environment.
6581 \def\setupverbatim{%
6582 \let\nonarrowing = t%
6583 \nonfillstart
6584 \tt % easiest (and conventionally used) font for verbatim
6585 % The \leavevmode here is for blank lines. Otherwise, we would
6586 % never \starttabox and the \egroup would end verbatim mode.
6587 \def\par{\leavevmode\egroup\box\verbbox\endgraf}%
6588 \tabexpand
6589 \setupmarkupstyle{verbatim}%
6590 % Respect line breaks,
6591 % print special symbols as themselves, and
6592 % make each space count.
6593 % Must do in this order:
6594 \obeylines \uncatcodespecials \sepspaces
6595 \everypar{\starttabbox}%
6598 % Do the @verb magic: verbatim text is quoted by unique
6599 % delimiter characters. Before first delimiter expect a
6600 % right brace, after last delimiter expect closing brace:
6602 % \def\doverb'{'<char>#1<char>'}'{#1}
6604 % [Knuth] p. 382; only eat outer {}
6605 \begingroup
6606 \catcode`[=1\catcode`]=2\catcode`\{=\other\catcode`\}=\other
6607 \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next]
6608 \endgroup
6610 \def\verb{\begingroup\setupverb\doverb}
6613 % Do the @verbatim magic: define the macro \doverbatim so that
6614 % the (first) argument ends when '@end verbatim' is reached, ie:
6616 % \def\doverbatim#1@end verbatim{#1}
6618 % For Texinfo it's a lot easier than for LaTeX,
6619 % because texinfo's \verbatim doesn't stop at '\end{verbatim}':
6620 % we need not redefine '\', '{' and '}'.
6622 % Inspired by LaTeX's verbatim command set [latex.ltx]
6624 \begingroup
6625 \catcode`\ =\active
6626 \obeylines %
6627 % ignore everything up to the first ^^M, that's the newline at the end
6628 % of the @verbatim input line itself. Otherwise we get an extra blank
6629 % line in the output.
6630 \xdef\doverbatim#1^^M#2@end verbatim{#2\noexpand\end\gobble verbatim}%
6631 % We really want {...\end verbatim} in the body of the macro, but
6632 % without the active space; thus we have to use \xdef and \gobble.
6633 \endgroup
6635 \envdef\verbatim{%
6636 \setupverbatim\doverbatim
6638 \let\Everbatim = \afterenvbreak
6641 % @verbatiminclude FILE - insert text of file in verbatim environment.
6643 \def\verbatiminclude{\parseargusing\filenamecatcodes\doverbatiminclude}
6645 \def\doverbatiminclude#1{%
6647 \makevalueexpandable
6648 \setupverbatim
6649 \indexnofonts % Allow `@@' and other weird things in file names.
6650 \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}%
6651 \input #1
6652 \afterenvbreak
6656 % @copying ... @end copying.
6657 % Save the text away for @insertcopying later.
6659 % We save the uninterpreted tokens, rather than creating a box.
6660 % Saving the text in a box would be much easier, but then all the
6661 % typesetting commands (@smallbook, font changes, etc.) have to be done
6662 % beforehand -- and a) we want @copying to be done first in the source
6663 % file; b) letting users define the frontmatter in as flexible order as
6664 % possible is very desirable.
6666 \def\copying{\checkenv{}\begingroup\scanargctxt\docopying}
6667 \def\docopying#1@end copying{\endgroup\def\copyingtext{#1}}
6669 \def\insertcopying{%
6670 \begingroup
6671 \parindent = 0pt % paragraph indentation looks wrong on title page
6672 \scanexp\copyingtext
6673 \endgroup
6677 \message{defuns,}
6678 % @defun etc.
6680 \newskip\defbodyindent \defbodyindent=.4in
6681 \newskip\defargsindent \defargsindent=50pt
6682 \newskip\deflastargmargin \deflastargmargin=18pt
6683 \newcount\defunpenalty
6685 % Start the processing of @deffn:
6686 \def\startdefun{%
6687 \ifnum\lastpenalty<10000
6688 \medbreak
6689 \defunpenalty=10003 % Will keep this @deffn together with the
6690 % following @def command, see below.
6691 \else
6692 % If there are two @def commands in a row, we'll have a \nobreak,
6693 % which is there to keep the function description together with its
6694 % header. But if there's nothing but headers, we need to allow a
6695 % break somewhere. Check specifically for penalty 10002, inserted
6696 % by \printdefunline, instead of 10000, since the sectioning
6697 % commands also insert a nobreak penalty, and we don't want to allow
6698 % a break between a section heading and a defun.
6700 % As a further refinement, we avoid "club" headers by signalling
6701 % with penalty of 10003 after the very first @deffn in the
6702 % sequence (see above), and penalty of 10002 after any following
6703 % @def command.
6704 \ifnum\lastpenalty=10002 \penalty2000 \else \defunpenalty=10002 \fi
6706 % Similarly, after a section heading, do not allow a break.
6707 % But do insert the glue.
6708 \medskip % preceded by discardable penalty, so not a breakpoint
6711 \parindent=0in
6712 \advance\leftskip by \defbodyindent
6713 \exdentamount=\defbodyindent
6716 \def\dodefunx#1{%
6717 % First, check whether we are in the right environment:
6718 \checkenv#1%
6720 % As above, allow line break if we have multiple x headers in a row.
6721 % It's not a great place, though.
6722 \ifnum\lastpenalty=10002 \penalty3000 \else \defunpenalty=10002 \fi
6724 % And now, it's time to reuse the body of the original defun:
6725 \expandafter\gobbledefun#1%
6727 \def\gobbledefun#1\startdefun{}
6729 % \printdefunline \deffnheader{text}
6731 \def\printdefunline#1#2{%
6732 \begingroup
6733 % call \deffnheader:
6734 #1#2 \endheader
6735 % common ending:
6736 \interlinepenalty = 10000
6737 \advance\rightskip by 0pt plus 1fil\relax
6738 \endgraf
6739 \nobreak\vskip -\parskip
6740 \penalty\defunpenalty % signal to \startdefun and \dodefunx
6741 % Some of the @defun-type tags do not enable magic parentheses,
6742 % rendering the following check redundant. But we don't optimize.
6743 \checkparencounts
6744 \endgroup
6747 \def\Edefun{\endgraf\medbreak}
6749 % \makedefun{deffn} creates \deffn, \deffnx and \Edeffn;
6750 % the only thing remaining is to define \deffnheader.
6752 \def\makedefun#1{%
6753 \expandafter\let\csname E#1\endcsname = \Edefun
6754 \edef\temp{\noexpand\domakedefun
6755 \makecsname{#1}\makecsname{#1x}\makecsname{#1header}}%
6756 \temp
6759 % \domakedefun \deffn \deffnx \deffnheader
6761 % Define \deffn and \deffnx, without parameters.
6762 % \deffnheader has to be defined explicitly.
6764 \def\domakedefun#1#2#3{%
6765 \envdef#1{%
6766 \startdefun
6767 \doingtypefnfalse % distinguish typed functions from all else
6768 \parseargusing\activeparens{\printdefunline#3}%
6770 \def#2{\dodefunx#1}%
6771 \def#3%
6774 \newif\ifdoingtypefn % doing typed function?
6775 \newif\ifrettypeownline % typeset return type on its own line?
6777 % @deftypefnnewline on|off says whether the return type of typed functions
6778 % are printed on their own line. This affects @deftypefn, @deftypefun,
6779 % @deftypeop, and @deftypemethod.
6781 \parseargdef\deftypefnnewline{%
6782 \def\temp{#1}%
6783 \ifx\temp\onword
6784 \expandafter\let\csname SETtxideftypefnnl\endcsname
6785 = \empty
6786 \else\ifx\temp\offword
6787 \expandafter\let\csname SETtxideftypefnnl\endcsname
6788 = \relax
6789 \else
6790 \errhelp = \EMsimple
6791 \errmessage{Unknown @txideftypefnnl value `\temp',
6792 must be on|off}%
6793 \fi\fi
6796 % Untyped functions:
6798 % @deffn category name args
6799 \makedefun{deffn}{\deffngeneral{}}
6801 % @deffn category class name args
6802 \makedefun{defop}#1 {\defopon{#1\ \putwordon}}
6804 % \defopon {category on}class name args
6805 \def\defopon#1#2 {\deffngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} }
6807 % \deffngeneral {subind}category name args
6809 \def\deffngeneral#1#2 #3 #4\endheader{%
6810 % Remember that \dosubind{fn}{foo}{} is equivalent to \doind{fn}{foo}.
6811 \dosubind{fn}{\code{#3}}{#1}%
6812 \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}%
6815 % Typed functions:
6817 % @deftypefn category type name args
6818 \makedefun{deftypefn}{\deftypefngeneral{}}
6820 % @deftypeop category class type name args
6821 \makedefun{deftypeop}#1 {\deftypeopon{#1\ \putwordon}}
6823 % \deftypeopon {category on}class type name args
6824 \def\deftypeopon#1#2 {\deftypefngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} }
6826 % \deftypefngeneral {subind}category type name args
6828 \def\deftypefngeneral#1#2 #3 #4 #5\endheader{%
6829 \dosubind{fn}{\code{#4}}{#1}%
6830 \doingtypefntrue
6831 \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
6834 % Typed variables:
6836 % @deftypevr category type var args
6837 \makedefun{deftypevr}{\deftypecvgeneral{}}
6839 % @deftypecv category class type var args
6840 \makedefun{deftypecv}#1 {\deftypecvof{#1\ \putwordof}}
6842 % \deftypecvof {category of}class type var args
6843 \def\deftypecvof#1#2 {\deftypecvgeneral{\putwordof\ \code{#2}}{#1\ \code{#2}} }
6845 % \deftypecvgeneral {subind}category type var args
6847 \def\deftypecvgeneral#1#2 #3 #4 #5\endheader{%
6848 \dosubind{vr}{\code{#4}}{#1}%
6849 \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
6852 % Untyped variables:
6854 % @defvr category var args
6855 \makedefun{defvr}#1 {\deftypevrheader{#1} {} }
6857 % @defcv category class var args
6858 \makedefun{defcv}#1 {\defcvof{#1\ \putwordof}}
6860 % \defcvof {category of}class var args
6861 \def\defcvof#1#2 {\deftypecvof{#1}#2 {} }
6863 % Types:
6865 % @deftp category name args
6866 \makedefun{deftp}#1 #2 #3\endheader{%
6867 \doind{tp}{\code{#2}}%
6868 \defname{#1}{}{#2}\defunargs{#3\unskip}%
6871 % Remaining @defun-like shortcuts:
6872 \makedefun{defun}{\deffnheader{\putwordDeffunc} }
6873 \makedefun{defmac}{\deffnheader{\putwordDefmac} }
6874 \makedefun{defspec}{\deffnheader{\putwordDefspec} }
6875 \makedefun{deftypefun}{\deftypefnheader{\putwordDeffunc} }
6876 \makedefun{defvar}{\defvrheader{\putwordDefvar} }
6877 \makedefun{defopt}{\defvrheader{\putwordDefopt} }
6878 \makedefun{deftypevar}{\deftypevrheader{\putwordDefvar} }
6879 \makedefun{defmethod}{\defopon\putwordMethodon}
6880 \makedefun{deftypemethod}{\deftypeopon\putwordMethodon}
6881 \makedefun{defivar}{\defcvof\putwordInstanceVariableof}
6882 \makedefun{deftypeivar}{\deftypecvof\putwordInstanceVariableof}
6884 % \defname, which formats the name of the @def (not the args).
6885 % #1 is the category, such as "Function".
6886 % #2 is the return type, if any.
6887 % #3 is the function name.
6889 % We are followed by (but not passed) the arguments, if any.
6891 \def\defname#1#2#3{%
6892 \par
6893 % Get the values of \leftskip and \rightskip as they were outside the @def...
6894 \advance\leftskip by -\defbodyindent
6896 % Determine if we are typesetting the return type of a typed function
6897 % on a line by itself.
6898 \rettypeownlinefalse
6899 \ifdoingtypefn % doing a typed function specifically?
6900 % then check user option for putting return type on its own line:
6901 \expandafter\ifx\csname SETtxideftypefnnl\endcsname\relax \else
6902 \rettypeownlinetrue
6906 % How we'll format the category name. Putting it in brackets helps
6907 % distinguish it from the body text that may end up on the next line
6908 % just below it.
6909 \def\temp{#1}%
6910 \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi}
6912 % Figure out line sizes for the paragraph shape. We'll always have at
6913 % least two.
6914 \tempnum = 2
6916 % The first line needs space for \box0; but if \rightskip is nonzero,
6917 % we need only space for the part of \box0 which exceeds it:
6918 \dimen0=\hsize \advance\dimen0 by -\wd0 \advance\dimen0 by \rightskip
6920 % If doing a return type on its own line, we'll have another line.
6921 \ifrettypeownline
6922 \advance\tempnum by 1
6923 \def\maybeshapeline{0in \hsize}%
6924 \else
6925 \def\maybeshapeline{}%
6928 % The continuations:
6929 \dimen2=\hsize \advance\dimen2 by -\defargsindent
6931 % The final paragraph shape:
6932 \parshape \tempnum 0in \dimen0 \maybeshapeline \defargsindent \dimen2
6934 % Put the category name at the right margin.
6935 \noindent
6936 \hbox to 0pt{%
6937 \hfil\box0 \kern-\hsize
6938 % \hsize has to be shortened this way:
6939 \kern\leftskip
6940 % Intentionally do not respect \rightskip, since we need the space.
6943 % Allow all lines to be underfull without complaint:
6944 \tolerance=10000 \hbadness=10000
6945 \exdentamount=\defbodyindent
6947 % defun fonts. We use typewriter by default (used to be bold) because:
6948 % . we're printing identifiers, they should be in tt in principle.
6949 % . in languages with many accents, such as Czech or French, it's
6950 % common to leave accents off identifiers. The result looks ok in
6951 % tt, but exceedingly strange in rm.
6952 % . we don't want -- and --- to be treated as ligatures.
6953 % . this still does not fix the ?` and !` ligatures, but so far no
6954 % one has made identifiers using them :).
6955 \df \tt
6956 \def\temp{#2}% text of the return type
6957 \ifx\temp\empty\else
6958 \tclose{\temp}% typeset the return type
6959 \ifrettypeownline
6960 % put return type on its own line; prohibit line break following:
6961 \hfil\vadjust{\nobreak}\break
6962 \else
6963 \space % type on same line, so just followed by a space
6965 \fi % no return type
6966 #3% output function name
6968 {\rm\enskip}% hskip 0.5 em of \tenrm
6970 \boldbrax
6971 % arguments will be output next, if any.
6974 % Print arguments in slanted roman (not ttsl), inconsistently with using
6975 % tt for the name. This is because literal text is sometimes needed in
6976 % the argument list (groff manual), and ttsl and tt are not very
6977 % distinguishable. Prevent hyphenation at `-' chars.
6979 \def\defunargs#1{%
6980 % use sl by default (not ttsl),
6981 % tt for the names.
6982 \df \sl \hyphenchar\font=0
6984 % On the other hand, if an argument has two dashes (for instance), we
6985 % want a way to get ttsl. Let's try @var for that.
6986 \def\var##1{{\setupmarkupstyle{var}\ttslanted{##1}}}%
6988 \sl\hyphenchar\font=45
6991 % We want ()&[] to print specially on the defun line.
6993 \def\activeparens{%
6994 \catcode`\(=\active \catcode`\)=\active
6995 \catcode`\[=\active \catcode`\]=\active
6996 \catcode`\&=\active
6999 % Make control sequences which act like normal parenthesis chars.
7000 \let\lparen = ( \let\rparen = )
7002 % Be sure that we always have a definition for `(', etc. For example,
7003 % if the fn name has parens in it, \boldbrax will not be in effect yet,
7004 % so TeX would otherwise complain about undefined control sequence.
7006 \activeparens
7007 \global\let(=\lparen \global\let)=\rparen
7008 \global\let[=\lbrack \global\let]=\rbrack
7009 \global\let& = \&
7011 \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}
7012 \gdef\magicamp{\let&=\amprm}
7015 \newcount\parencount
7017 % If we encounter &foo, then turn on ()-hacking afterwards
7018 \newif\ifampseen
7019 \def\amprm#1 {\ampseentrue{\bf\&#1 }}
7021 \def\parenfont{%
7022 \ifampseen
7023 % At the first level, print parens in roman,
7024 % otherwise use the default font.
7025 \ifnum \parencount=1 \rm \fi
7026 \else
7027 % The \sf parens (in \boldbrax) actually are a little bolder than
7028 % the contained text. This is especially needed for [ and ] .
7032 \def\infirstlevel#1{%
7033 \ifampseen
7034 \ifnum\parencount=1
7039 \def\bfafterword#1 {#1 \bf}
7041 \def\opnr{%
7042 \global\advance\parencount by 1
7043 {\parenfont(}%
7044 \infirstlevel \bfafterword
7046 \def\clnr{%
7047 {\parenfont)}%
7048 \infirstlevel \sl
7049 \global\advance\parencount by -1
7052 \newcount\brackcount
7053 \def\lbrb{%
7054 \global\advance\brackcount by 1
7055 {\bf[}%
7057 \def\rbrb{%
7058 {\bf]}%
7059 \global\advance\brackcount by -1
7062 \def\checkparencounts{%
7063 \ifnum\parencount=0 \else \badparencount \fi
7064 \ifnum\brackcount=0 \else \badbrackcount \fi
7066 % these should not use \errmessage; the glibc manual, at least, actually
7067 % has such constructs (when documenting function pointers).
7068 \def\badparencount{%
7069 \message{Warning: unbalanced parentheses in @def...}%
7070 \global\parencount=0
7072 \def\badbrackcount{%
7073 \message{Warning: unbalanced square brackets in @def...}%
7074 \global\brackcount=0
7078 \message{macros,}
7079 % @macro.
7081 % To do this right we need a feature of e-TeX, \scantokens,
7082 % which we arrange to emulate with a temporary file in ordinary TeX.
7083 \ifx\eTeXversion\thisisundefined
7084 \newwrite\macscribble
7085 \def\scantokens#1{%
7086 \toks0={#1}%
7087 \immediate\openout\macscribble=\jobname.tmp
7088 \immediate\write\macscribble{\the\toks0}%
7089 \immediate\closeout\macscribble
7090 \input \jobname.tmp
7094 \def\scanmacro#1{\begingroup
7095 \newlinechar`\^^M
7096 \let\xeatspaces\eatspaces
7098 % Undo catcode changes of \startcontents and \doprintindex
7099 % When called from @insertcopying or (short)caption, we need active
7100 % backslash to get it printed correctly. Previously, we had
7101 % \catcode`\\=\other instead. We'll see whether a problem appears
7102 % with macro expansion. --kasal, 19aug04
7103 \catcode`\@=0 \catcode`\\=\active \escapechar=`\@
7105 % ... and for \example:
7106 \spaceisspace
7108 % The \empty here causes a following catcode 5 newline to be eaten as
7109 % part of reading whitespace after a control sequence. It does not
7110 % eat a catcode 13 newline. There's no good way to handle the two
7111 % cases (untried: maybe e-TeX's \everyeof could help, though plain TeX
7112 % would then have different behavior). See the Macro Details node in
7113 % the manual for the workaround we recommend for macros and
7114 % line-oriented commands.
7116 \scantokens{#1\empty}%
7117 \endgroup}
7119 \def\scanexp#1{%
7120 \edef\temp{\noexpand\scanmacro{#1}}%
7121 \temp
7124 \newcount\paramno % Count of parameters
7125 \newtoks\macname % Macro name
7126 \newif\ifrecursive % Is it recursive?
7128 % List of all defined macros in the form
7129 % \definedummyword\macro1\definedummyword\macro2...
7130 % Currently is also contains all @aliases; the list can be split
7131 % if there is a need.
7132 \def\macrolist{}
7134 % Add the macro to \macrolist
7135 \def\addtomacrolist#1{\expandafter \addtomacrolistxxx \csname#1\endcsname}
7136 \def\addtomacrolistxxx#1{%
7137 \toks0 = \expandafter{\macrolist\definedummyword#1}%
7138 \xdef\macrolist{\the\toks0}%
7141 % Utility routines.
7142 % This does \let #1 = #2, with \csnames; that is,
7143 % \let \csname#1\endcsname = \csname#2\endcsname
7144 % (except of course we have to play expansion games).
7146 \def\cslet#1#2{%
7147 \expandafter\let
7148 \csname#1\expandafter\endcsname
7149 \csname#2\endcsname
7152 % Trim leading and trailing spaces off a string.
7153 % Concepts from aro-bend problem 15 (see CTAN).
7154 {\catcode`\@=11
7155 \gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }}
7156 \gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@}
7157 \gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @}
7158 \def\unbrace#1{#1}
7159 \unbrace{\gdef\trim@@@ #1 } #2@{#1}
7162 % Trim a single trailing ^^M off a string.
7163 {\catcode`\^^M=\other \catcode`\Q=3%
7164 \gdef\eatcr #1{\eatcra #1Q^^MQ}%
7165 \gdef\eatcra#1^^MQ{\eatcrb#1Q}%
7166 \gdef\eatcrb#1Q#2Q{#1}%
7169 % Macro bodies are absorbed as an argument in a context where
7170 % all characters are catcode 10, 11 or 12, except \ which is active
7171 % (as in normal texinfo). It is necessary to change the definition of \
7172 % to recognize macro arguments; this is the job of \mbodybackslash.
7174 % Non-ASCII encodings make 8-bit characters active, so un-activate
7175 % them to avoid their expansion. Must do this non-globally, to
7176 % confine the change to the current group.
7178 % It's necessary to have hard CRs when the macro is executed. This is
7179 % done by making ^^M (\endlinechar) catcode 12 when reading the macro
7180 % body, and then making it the \newlinechar in \scanmacro.
7182 \def\scanctxt{% used as subroutine
7183 \catcode`\"=\other
7184 \catcode`\+=\other
7185 \catcode`\<=\other
7186 \catcode`\>=\other
7187 \catcode`\@=\other
7188 \catcode`\^=\other
7189 \catcode`\_=\other
7190 \catcode`\|=\other
7191 \catcode`\~=\other
7192 \ifx\declaredencoding\ascii \else \setnonasciicharscatcodenonglobal\other \fi
7195 \def\scanargctxt{% used for copying and captions, not macros.
7196 \scanctxt
7197 \catcode`\\=\other
7198 \catcode`\^^M=\other
7201 \def\macrobodyctxt{% used for @macro definitions
7202 \scanctxt
7203 \catcode`\{=\other
7204 \catcode`\}=\other
7205 \catcode`\^^M=\other
7206 \usembodybackslash
7209 \def\macroargctxt{% used when scanning invocations
7210 \scanctxt
7211 \catcode`\\=0
7213 % why catcode 0 for \ in the above? To recognize \\ \{ \} as "escapes"
7214 % for the single characters \ { }. Thus, we end up with the "commands"
7215 % that would be written @\ @{ @} in a Texinfo document.
7217 % We already have @{ and @}. For @\, we define it here, and only for
7218 % this purpose, to produce a typewriter backslash (so, the @\ that we
7219 % define for @math can't be used with @macro calls):
7221 \def\\{\normalbackslash}%
7223 % We would like to do this for \, too, since that is what makeinfo does.
7224 % But it is not possible, because Texinfo already has a command @, for a
7225 % cedilla accent. Documents must use @comma{} instead.
7227 % \anythingelse will almost certainly be an error of some kind.
7230 % \mbodybackslash is the definition of \ in @macro bodies.
7231 % It maps \foo\ => \csname macarg.foo\endcsname => #N
7232 % where N is the macro parameter number.
7233 % We define \csname macarg.\endcsname to be \realbackslash, so
7234 % \\ in macro replacement text gets you a backslash.
7236 {\catcode`@=0 @catcode`@\=@active
7237 @gdef@usembodybackslash{@let\=@mbodybackslash}
7238 @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname}
7240 \expandafter\def\csname macarg.\endcsname{\realbackslash}
7242 \def\margbackslash#1{\char`\#1 }
7244 \def\macro{\recursivefalse\parsearg\macroxxx}
7245 \def\rmacro{\recursivetrue\parsearg\macroxxx}
7247 \def\macroxxx#1{%
7248 \getargs{#1}% now \macname is the macname and \argl the arglist
7249 \ifx\argl\empty % no arguments
7250 \paramno=0\relax
7251 \else
7252 \expandafter\parsemargdef \argl;%
7253 \if\paramno>256\relax
7254 \ifx\eTeXversion\thisisundefined
7255 \errhelp = \EMsimple
7256 \errmessage{You need eTeX to compile a file with macros with more than 256 arguments}
7260 \if1\csname ismacro.\the\macname\endcsname
7261 \message{Warning: redefining \the\macname}%
7262 \else
7263 \expandafter\ifx\csname \the\macname\endcsname \relax
7264 \else \errmessage{Macro name \the\macname\space already defined}\fi
7265 \global\cslet{macsave.\the\macname}{\the\macname}%
7266 \global\expandafter\let\csname ismacro.\the\macname\endcsname=1%
7267 \addtomacrolist{\the\macname}%
7269 \begingroup \macrobodyctxt
7270 \ifrecursive \expandafter\parsermacbody
7271 \else \expandafter\parsemacbody
7272 \fi}
7274 \parseargdef\unmacro{%
7275 \if1\csname ismacro.#1\endcsname
7276 \global\cslet{#1}{macsave.#1}%
7277 \global\expandafter\let \csname ismacro.#1\endcsname=0%
7278 % Remove the macro name from \macrolist:
7279 \begingroup
7280 \expandafter\let\csname#1\endcsname \relax
7281 \let\definedummyword\unmacrodo
7282 \xdef\macrolist{\macrolist}%
7283 \endgroup
7284 \else
7285 \errmessage{Macro #1 not defined}%
7289 % Called by \do from \dounmacro on each macro. The idea is to omit any
7290 % macro definitions that have been changed to \relax.
7292 \def\unmacrodo#1{%
7293 \ifx #1\relax
7294 % remove this
7295 \else
7296 \noexpand\definedummyword \noexpand#1%
7300 % This makes use of the obscure feature that if the last token of a
7301 % <parameter list> is #, then the preceding argument is delimited by
7302 % an opening brace, and that opening brace is not consumed.
7303 \def\getargs#1{\getargsxxx#1{}}
7304 \def\getargsxxx#1#{\getmacname #1 \relax\getmacargs}
7305 \def\getmacname#1 #2\relax{\macname={#1}}
7306 \def\getmacargs#1{\def\argl{#1}}
7308 % For macro processing make @ a letter so that we can make Texinfo private macro names.
7309 \edef\texiatcatcode{\the\catcode`\@}
7310 \catcode `@=11\relax
7312 % Parse the optional {params} list. Set up \paramno and \paramlist
7313 % so \defmacro knows what to do. Define \macarg.BLAH for each BLAH
7314 % in the params list to some hook where the argument si to be expanded. If
7315 % there are less than 10 arguments that hook is to be replaced by ##N where N
7316 % is the position in that list, that is to say the macro arguments are to be
7317 % defined `a la TeX in the macro body.
7319 % That gets used by \mbodybackslash (above).
7321 % We need to get `macro parameter char #' into several definitions.
7322 % The technique used is stolen from LaTeX: let \hash be something
7323 % unexpandable, insert that wherever you need a #, and then redefine
7324 % it to # just before using the token list produced.
7326 % The same technique is used to protect \eatspaces till just before
7327 % the macro is used.
7329 % If there are 10 or more arguments, a different technique is used, where the
7330 % hook remains in the body, and when macro is to be expanded the body is
7331 % processed again to replace the arguments.
7333 % In that case, the hook is \the\toks N-1, and we simply set \toks N-1 to the
7334 % argument N value and then \edef the body (nothing else will expand because of
7335 % the catcode regime underwhich the body was input).
7337 % If you compile with TeX (not eTeX), and you have macros with 10 or more
7338 % arguments, you need that no macro has more than 256 arguments, otherwise an
7339 % error is produced.
7340 \def\parsemargdef#1;{%
7341 \paramno=0\def\paramlist{}%
7342 \let\hash\relax
7343 \let\xeatspaces\relax
7344 \parsemargdefxxx#1,;,%
7345 % In case that there are 10 or more arguments we parse again the arguments
7346 % list to set new definitions for the \macarg.BLAH macros corresponding to
7347 % each BLAH argument. It was anyhow needed to parse already once this list
7348 % in order to count the arguments, and as macros with at most 9 arguments
7349 % are by far more frequent than macro with 10 or more arguments, defining
7350 % twice the \macarg.BLAH macros does not cost too much processing power.
7351 \ifnum\paramno<10\relax\else
7352 \paramno0\relax
7353 \parsemmanyargdef@@#1,;,% 10 or more arguments
7356 \def\parsemargdefxxx#1,{%
7357 \if#1;\let\next=\relax
7358 \else \let\next=\parsemargdefxxx
7359 \advance\paramno by 1
7360 \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname
7361 {\xeatspaces{\hash\the\paramno}}%
7362 \edef\paramlist{\paramlist\hash\the\paramno,}%
7363 \fi\next}
7365 \def\parsemmanyargdef@@#1,{%
7366 \if#1;\let\next=\relax
7367 \else
7368 \let\next=\parsemmanyargdef@@
7369 \edef\tempb{\eatspaces{#1}}%
7370 \expandafter\def\expandafter\tempa
7371 \expandafter{\csname macarg.\tempb\endcsname}%
7372 % Note that we need some extra \noexpand\noexpand, this is because we
7373 % don't want \the to be expanded in the \parsermacbody as it uses an
7374 % \xdef .
7375 \expandafter\edef\tempa
7376 {\noexpand\noexpand\noexpand\the\toks\the\paramno}%
7377 \advance\paramno by 1\relax
7378 \fi\next}
7380 % These two commands read recursive and nonrecursive macro bodies.
7381 % (They're different since rec and nonrec macros end differently.)
7384 \catcode `\@\texiatcatcode
7385 \long\def\parsemacbody#1@end macro%
7386 {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
7387 \long\def\parsermacbody#1@end rmacro%
7388 {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
7389 \catcode `\@=11\relax
7391 \let\endargs@\relax
7392 \let\nil@\relax
7393 \def\nilm@{\nil@}%
7394 \long\def\nillm@{\nil@}%
7396 % This macro is expanded during the Texinfo macro expansion, not during its
7397 % definition. It gets all the arguments values and assigns them to macros
7398 % macarg.ARGNAME
7400 % #1 is the macro name
7401 % #2 is the list of argument names
7402 % #3 is the list of argument values
7403 \def\getargvals@#1#2#3{%
7404 \def\macargdeflist@{}%
7405 \def\saveparamlist@{#2}% Need to keep a copy for parameter expansion.
7406 \def\paramlist{#2,\nil@}%
7407 \def\macroname{#1}%
7408 \begingroup
7409 \macroargctxt
7410 \def\argvaluelist{#3,\nil@}%
7411 \def\@tempa{#3}%
7412 \ifx\@tempa\empty
7413 \setemptyargvalues@
7414 \else
7415 \getargvals@@
7420 \def\getargvals@@{%
7421 \ifx\paramlist\nilm@
7422 % Some sanity check needed here that \argvaluelist is also empty.
7423 \ifx\argvaluelist\nillm@
7424 \else
7425 \errhelp = \EMsimple
7426 \errmessage{Too many arguments in macro `\macroname'!}%
7428 \let\next\macargexpandinbody@
7429 \else
7430 \ifx\argvaluelist\nillm@
7431 % No more arguments values passed to macro. Set remaining named-arg
7432 % macros to empty.
7433 \let\next\setemptyargvalues@
7434 \else
7435 % pop current arg name into \@tempb
7436 \def\@tempa##1{\pop@{\@tempb}{\paramlist}##1\endargs@}%
7437 \expandafter\@tempa\expandafter{\paramlist}%
7438 % pop current argument value into \@tempc
7439 \def\@tempa##1{\longpop@{\@tempc}{\argvaluelist}##1\endargs@}%
7440 \expandafter\@tempa\expandafter{\argvaluelist}%
7441 % Here \@tempb is the current arg name and \@tempc is the current arg value.
7442 % First place the new argument macro definition into \@tempd
7443 \expandafter\macname\expandafter{\@tempc}%
7444 \expandafter\let\csname macarg.\@tempb\endcsname\relax
7445 \expandafter\def\expandafter\@tempe\expandafter{%
7446 \csname macarg.\@tempb\endcsname}%
7447 \edef\@tempd{\long\def\@tempe{\the\macname}}%
7448 \push@\@tempd\macargdeflist@
7449 \let\next\getargvals@@
7452 \next
7455 \def\push@#1#2{%
7456 \expandafter\expandafter\expandafter\def
7457 \expandafter\expandafter\expandafter#2%
7458 \expandafter\expandafter\expandafter{%
7459 \expandafter#1#2}%
7462 % Replace arguments by their values in the macro body, and place the result
7463 % in macro \@tempa
7464 \def\macvalstoargs@{%
7465 % To do this we use the property that token registers that are \the'ed
7466 % within an \edef expand only once. So we are going to place all argument
7467 % values into respective token registers.
7469 % First we save the token context, and initialize argument numbering.
7470 \begingroup
7471 \paramno0\relax
7472 % Then, for each argument number #N, we place the corresponding argument
7473 % value into a new token list register \toks#N
7474 \expandafter\putargsintokens@\saveparamlist@,;,%
7475 % Then, we expand the body so that argument are replaced by their
7476 % values. The trick for values not to be expanded themselves is that they
7477 % are within tokens and that tokens expand only once in an \edef .
7478 \edef\@tempc{\csname mac.\macroname .body\endcsname}%
7479 % Now we restore the token stack pointer to free the token list registers
7480 % which we have used, but we make sure that expanded body is saved after
7481 % group.
7482 \expandafter
7483 \endgroup
7484 \expandafter\def\expandafter\@tempa\expandafter{\@tempc}%
7487 \def\macargexpandinbody@{%
7488 %% Define the named-macro outside of this group and then close this group.
7489 \expandafter
7490 \endgroup
7491 \macargdeflist@
7492 % First the replace in body the macro arguments by their values, the result
7493 % is in \@tempa .
7494 \macvalstoargs@
7495 % Then we point at the \norecurse or \gobble (for recursive) macro value
7496 % with \@tempb .
7497 \expandafter\let\expandafter\@tempb\csname mac.\macroname .recurse\endcsname
7498 % Depending on whether it is recursive or not, we need some tailing
7499 % \egroup .
7500 \ifx\@tempb\gobble
7501 \let\@tempc\relax
7502 \else
7503 \let\@tempc\egroup
7505 % And now we do the real job:
7506 \edef\@tempd{\noexpand\@tempb{\macroname}\noexpand\scanmacro{\@tempa}\@tempc}%
7507 \@tempd
7510 \def\putargsintokens@#1,{%
7511 \if#1;\let\next\relax
7512 \else
7513 \let\next\putargsintokens@
7514 % First we allocate the new token list register, and give it a temporary
7515 % alias \@tempb .
7516 \toksdef\@tempb\the\paramno
7517 % Then we place the argument value into that token list register.
7518 \expandafter\let\expandafter\@tempa\csname macarg.#1\endcsname
7519 \expandafter\@tempb\expandafter{\@tempa}%
7520 \advance\paramno by 1\relax
7522 \next
7525 % Save the token stack pointer into macro #1
7526 \def\texisavetoksstackpoint#1{\edef#1{\the\@cclvi}}
7527 % Restore the token stack pointer from number in macro #1
7528 \def\texirestoretoksstackpoint#1{\expandafter\mathchardef\expandafter\@cclvi#1\relax}
7529 % newtoks that can be used non \outer .
7530 \def\texinonouternewtoks{\alloc@ 5\toks \toksdef \@cclvi}
7532 % Tailing missing arguments are set to empty
7533 \def\setemptyargvalues@{%
7534 \ifx\paramlist\nilm@
7535 \let\next\macargexpandinbody@
7536 \else
7537 \expandafter\setemptyargvaluesparser@\paramlist\endargs@
7538 \let\next\setemptyargvalues@
7540 \next
7543 \def\setemptyargvaluesparser@#1,#2\endargs@{%
7544 \expandafter\def\expandafter\@tempa\expandafter{%
7545 \expandafter\def\csname macarg.#1\endcsname{}}%
7546 \push@\@tempa\macargdeflist@
7547 \def\paramlist{#2}%
7550 % #1 is the element target macro
7551 % #2 is the list macro
7552 % #3,#4\endargs@ is the list value
7553 \def\pop@#1#2#3,#4\endargs@{%
7554 \def#1{#3}%
7555 \def#2{#4}%
7557 \long\def\longpop@#1#2#3,#4\endargs@{%
7558 \long\def#1{#3}%
7559 \long\def#2{#4}%
7562 % This defines a Texinfo @macro. There are eight cases: recursive and
7563 % nonrecursive macros of zero, one, up to nine, and many arguments.
7564 % Much magic with \expandafter here.
7565 % \xdef is used so that macro definitions will survive the file
7566 % they're defined in; @include reads the file inside a group.
7568 \def\defmacro{%
7569 \let\hash=##% convert placeholders to macro parameter chars
7570 \ifrecursive
7571 \ifcase\paramno
7573 \expandafter\xdef\csname\the\macname\endcsname{%
7574 \noexpand\scanmacro{\temp}}%
7575 \or % 1
7576 \expandafter\xdef\csname\the\macname\endcsname{%
7577 \bgroup\noexpand\macroargctxt
7578 \noexpand\braceorline
7579 \expandafter\noexpand\csname\the\macname xxx\endcsname}%
7580 \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
7581 \egroup\noexpand\scanmacro{\temp}}%
7582 \else
7583 \ifnum\paramno<10\relax % at most 9
7584 \expandafter\xdef\csname\the\macname\endcsname{%
7585 \bgroup\noexpand\macroargctxt
7586 \noexpand\csname\the\macname xx\endcsname}%
7587 \expandafter\xdef\csname\the\macname xx\endcsname##1{%
7588 \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
7589 \expandafter\expandafter
7590 \expandafter\xdef
7591 \expandafter\expandafter
7592 \csname\the\macname xxx\endcsname
7593 \paramlist{\egroup\noexpand\scanmacro{\temp}}%
7594 \else % 10 or more
7595 \expandafter\xdef\csname\the\macname\endcsname{%
7596 \noexpand\getargvals@{\the\macname}{\argl}%
7598 \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp
7599 \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\gobble
7602 \else
7603 \ifcase\paramno
7605 \expandafter\xdef\csname\the\macname\endcsname{%
7606 \noexpand\norecurse{\the\macname}%
7607 \noexpand\scanmacro{\temp}\egroup}%
7608 \or % 1
7609 \expandafter\xdef\csname\the\macname\endcsname{%
7610 \bgroup\noexpand\macroargctxt
7611 \noexpand\braceorline
7612 \expandafter\noexpand\csname\the\macname xxx\endcsname}%
7613 \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
7614 \egroup
7615 \noexpand\norecurse{\the\macname}%
7616 \noexpand\scanmacro{\temp}\egroup}%
7617 \else % at most 9
7618 \ifnum\paramno<10\relax
7619 \expandafter\xdef\csname\the\macname\endcsname{%
7620 \bgroup\noexpand\macroargctxt
7621 \expandafter\noexpand\csname\the\macname xx\endcsname}%
7622 \expandafter\xdef\csname\the\macname xx\endcsname##1{%
7623 \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
7624 \expandafter\expandafter
7625 \expandafter\xdef
7626 \expandafter\expandafter
7627 \csname\the\macname xxx\endcsname
7628 \paramlist{%
7629 \egroup
7630 \noexpand\norecurse{\the\macname}%
7631 \noexpand\scanmacro{\temp}\egroup}%
7632 \else % 10 or more:
7633 \expandafter\xdef\csname\the\macname\endcsname{%
7634 \noexpand\getargvals@{\the\macname}{\argl}%
7636 \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp
7637 \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\norecurse
7640 \fi}
7642 \catcode `\@\texiatcatcode\relax
7644 \def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}}
7646 % \braceorline decides whether the next nonwhitespace character is a
7647 % {. If so it reads up to the closing }, if not, it reads the whole
7648 % line. Whatever was read is then fed to the next control sequence
7649 % as an argument (by \parsebrace or \parsearg).
7651 \def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx}
7652 \def\braceorlinexxx{%
7653 \ifx\nchar\bgroup\else
7654 \expandafter\parsearg
7655 \fi \macnamexxx}
7658 % @alias.
7659 % We need some trickery to remove the optional spaces around the equal
7660 % sign. Make them active and then expand them all to nothing.
7662 \def\alias{\parseargusing\obeyspaces\aliasxxx}
7663 \def\aliasxxx #1{\aliasyyy#1\relax}
7664 \def\aliasyyy #1=#2\relax{%
7666 \expandafter\let\obeyedspace=\empty
7667 \addtomacrolist{#1}%
7668 \xdef\next{\global\let\makecsname{#1}=\makecsname{#2}}%
7670 \next
7674 \message{cross references,}
7676 \newwrite\auxfile
7677 \newif\ifhavexrefs % True if xref values are known.
7678 \newif\ifwarnedxrefs % True if we warned once that they aren't known.
7680 % @inforef is relatively simple.
7681 \def\inforef #1{\inforefzzz #1,,,,**}
7682 \def\inforefzzz #1,#2,#3,#4**{%
7683 \putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
7684 node \samp{\ignorespaces#1{}}}
7686 % @node's only job in TeX is to define \lastnode, which is used in
7687 % cross-references. The @node line might or might not have commas, and
7688 % might or might not have spaces before the first comma, like:
7689 % @node foo , bar , ...
7690 % We don't want such trailing spaces in the node name.
7692 \parseargdef\node{\checkenv{}\donode #1 ,\finishnodeparse}
7694 % also remove a trailing comma, in case of something like this:
7695 % @node Help-Cross, , , Cross-refs
7696 \def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse}
7697 \def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}}
7699 \let\nwnode=\node
7700 \let\lastnode=\empty
7702 % Write a cross-reference definition for the current node. #1 is the
7703 % type (Ynumbered, Yappendix, Ynothing).
7705 \def\donoderef#1{%
7706 \ifx\lastnode\empty\else
7707 \setref{\lastnode}{#1}%
7708 \global\let\lastnode=\empty
7712 % @anchor{NAME} -- define xref target at arbitrary point.
7714 \newcount\savesfregister
7716 \def\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi}
7717 \def\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi}
7718 \def\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces}
7720 % \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an
7721 % anchor), which consists of three parts:
7722 % 1) NAME-title - the current sectioning name taken from \lastsection,
7723 % or the anchor name.
7724 % 2) NAME-snt - section number and type, passed as the SNT arg, or
7725 % empty for anchors.
7726 % 3) NAME-pg - the page number.
7728 % This is called from \donoderef, \anchor, and \dofloat. In the case of
7729 % floats, there is an additional part, which is not written here:
7730 % 4) NAME-lof - the text as it should appear in a @listoffloats.
7732 \def\setref#1#2{%
7733 \pdfmkdest{#1}%
7734 \iflinks
7736 \atdummies % preserve commands, but don't expand them
7737 \edef\writexrdef##1##2{%
7738 \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef
7739 ##1}{##2}}% these are parameters of \writexrdef
7741 \toks0 = \expandafter{\lastsection}%
7742 \immediate \writexrdef{title}{\the\toks0 }%
7743 \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc.
7744 \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, at \shipout
7749 % @xrefautosectiontitle on|off says whether @section(ing) names are used
7750 % automatically in xrefs, if the third arg is not explicitly specified.
7751 % This was provided as a "secret" @set xref-automatic-section-title
7752 % variable, now it's official.
7754 \parseargdef\xrefautomaticsectiontitle{%
7755 \def\temp{#1}%
7756 \ifx\temp\onword
7757 \expandafter\let\csname SETxref-automatic-section-title\endcsname
7758 = \empty
7759 \else\ifx\temp\offword
7760 \expandafter\let\csname SETxref-automatic-section-title\endcsname
7761 = \relax
7762 \else
7763 \errhelp = \EMsimple
7764 \errmessage{Unknown @xrefautomaticsectiontitle value `\temp',
7765 must be on|off}%
7766 \fi\fi
7770 % @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is
7771 % the node name, #2 the name of the Info cross-reference, #3 the printed
7772 % node name, #4 the name of the Info file, #5 the name of the printed
7773 % manual. All but the node name can be omitted.
7775 \def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]}
7776 \def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]}
7777 \def\ref#1{\xrefX[#1,,,,,,,]}
7778 \def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
7779 \unsepspaces
7780 \def\printedmanual{\ignorespaces #5}%
7781 \def\printedrefname{\ignorespaces #3}%
7782 \setbox1=\hbox{\printedmanual\unskip}%
7783 \setbox0=\hbox{\printedrefname\unskip}%
7784 \ifdim \wd0 = 0pt
7785 % No printed node name was explicitly given.
7786 \expandafter\ifx\csname SETxref-automatic-section-title\endcsname \relax
7787 % Use the node name inside the square brackets.
7788 \def\printedrefname{\ignorespaces #1}%
7789 \else
7790 % Use the actual chapter/section title appear inside
7791 % the square brackets. Use the real section title if we have it.
7792 \ifdim \wd1 > 0pt
7793 % It is in another manual, so we don't have it.
7794 \def\printedrefname{\ignorespaces #1}%
7795 \else
7796 \ifhavexrefs
7797 % We know the real title if we have the xref values.
7798 \def\printedrefname{\refx{#1-title}{}}%
7799 \else
7800 % Otherwise just copy the Info node name.
7801 \def\printedrefname{\ignorespaces #1}%
7802 \fi%
7807 % Make link in pdf output.
7808 \ifpdf
7809 {\indexnofonts
7810 \turnoffactive
7811 % This expands tokens, so do it after making catcode changes, so _
7812 % etc. don't get their TeX definitions.
7813 \getfilename{#4}%
7815 % See comments at \activebackslashdouble.
7816 {\activebackslashdouble \xdef\pdfxrefdest{#1}%
7817 \backslashparens\pdfxrefdest}%
7819 \leavevmode
7820 \startlink attr{/Border [0 0 0]}%
7821 \ifnum\filenamelength>0
7822 goto file{\the\filename.pdf} name{\pdfxrefdest}%
7823 \else
7824 goto name{\pdfmkpgn{\pdfxrefdest}}%
7827 \setcolor{\linkcolor}%
7830 % Float references are printed completely differently: "Figure 1.2"
7831 % instead of "[somenode], p.3". We distinguish them by the
7832 % LABEL-title being set to a magic string.
7834 % Have to otherify everything special to allow the \csname to
7835 % include an _ in the xref name, etc.
7836 \indexnofonts
7837 \turnoffactive
7838 \expandafter\global\expandafter\let\expandafter\Xthisreftitle
7839 \csname XR#1-title\endcsname
7841 \iffloat\Xthisreftitle
7842 % If the user specified the print name (third arg) to the ref,
7843 % print it instead of our usual "Figure 1.2".
7844 \ifdim\wd0 = 0pt
7845 \refx{#1-snt}{}%
7846 \else
7847 \printedrefname
7850 % if the user also gave the printed manual name (fifth arg), append
7851 % "in MANUALNAME".
7852 \ifdim \wd1 > 0pt
7853 \space \putwordin{} \cite{\printedmanual}%
7855 \else
7856 % node/anchor (non-float) references.
7858 % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not
7859 % insert empty discretionaries after hyphens, which means that it will
7860 % not find a line break at a hyphen in a node names. Since some manuals
7861 % are best written with fairly long node names, containing hyphens, this
7862 % is a loss. Therefore, we give the text of the node name again, so it
7863 % is as if TeX is seeing it for the first time.
7864 \ifdim \wd1 > 0pt
7865 \putwordSection{} ``\printedrefname'' \putwordin{} \cite{\printedmanual}%
7866 \else
7867 % _ (for example) has to be the character _ for the purposes of the
7868 % control sequence corresponding to the node, but it has to expand
7869 % into the usual \leavevmode...\vrule stuff for purposes of
7870 % printing. So we \turnoffactive for the \refx-snt, back on for the
7871 % printing, back off for the \refx-pg.
7872 {\turnoffactive
7873 % Only output a following space if the -snt ref is nonempty; for
7874 % @unnumbered and @anchor, it won't be.
7875 \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}%
7876 \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
7878 % output the `[mynode]' via a macro so it can be overridden.
7879 \xrefprintnodename\printedrefname
7881 % But we always want a comma and a space:
7882 ,\space
7884 % output the `page 3'.
7885 \turnoffactive \putwordpage\tie\refx{#1-pg}{}%
7888 \endlink
7889 \endgroup}
7891 % This macro is called from \xrefX for the `[nodename]' part of xref
7892 % output. It's a separate macro only so it can be changed more easily,
7893 % since square brackets don't work well in some documents. Particularly
7894 % one that Bob is working on :).
7896 \def\xrefprintnodename#1{[#1]}
7898 % Things referred to by \setref.
7900 \def\Ynothing{}
7901 \def\Yomitfromtoc{}
7902 \def\Ynumbered{%
7903 \ifnum\secno=0
7904 \putwordChapter@tie \the\chapno
7905 \else \ifnum\subsecno=0
7906 \putwordSection@tie \the\chapno.\the\secno
7907 \else \ifnum\subsubsecno=0
7908 \putwordSection@tie \the\chapno.\the\secno.\the\subsecno
7909 \else
7910 \putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno
7911 \fi\fi\fi
7913 \def\Yappendix{%
7914 \ifnum\secno=0
7915 \putwordAppendix@tie @char\the\appendixno{}%
7916 \else \ifnum\subsecno=0
7917 \putwordSection@tie @char\the\appendixno.\the\secno
7918 \else \ifnum\subsubsecno=0
7919 \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno
7920 \else
7921 \putwordSection@tie
7922 @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno
7923 \fi\fi\fi
7926 % Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
7927 % If its value is nonempty, SUFFIX is output afterward.
7929 \def\refx#1#2{%
7931 \indexnofonts
7932 \otherbackslash
7933 \expandafter\global\expandafter\let\expandafter\thisrefX
7934 \csname XR#1\endcsname
7936 \ifx\thisrefX\relax
7937 % If not defined, say something at least.
7938 \angleleft un\-de\-fined\angleright
7939 \iflinks
7940 \ifhavexrefs
7941 {\toks0 = {#1}% avoid expansion of possibly-complex value
7942 \message{\linenumber Undefined cross reference `\the\toks0'.}}%
7943 \else
7944 \ifwarnedxrefs\else
7945 \global\warnedxrefstrue
7946 \message{Cross reference values unknown; you must run TeX again.}%
7950 \else
7951 % It's defined, so just use it.
7952 \thisrefX
7954 #2% Output the suffix in any case.
7957 % This is the macro invoked by entries in the aux file. Usually it's
7958 % just a \def (we prepend XR to the control sequence name to avoid
7959 % collisions). But if this is a float type, we have more work to do.
7961 \def\xrdef#1#2{%
7962 {% The node name might contain 8-bit characters, which in our current
7963 % implementation are changed to commands like @'e. Don't let these
7964 % mess up the control sequence name.
7965 \indexnofonts
7966 \turnoffactive
7967 \xdef\safexrefname{#1}%
7970 \expandafter\gdef\csname XR\safexrefname\endcsname{#2}% remember this xref
7972 % Was that xref control sequence that we just defined for a float?
7973 \expandafter\iffloat\csname XR\safexrefname\endcsname
7974 % it was a float, and we have the (safe) float type in \iffloattype.
7975 \expandafter\let\expandafter\floatlist
7976 \csname floatlist\iffloattype\endcsname
7978 % Is this the first time we've seen this float type?
7979 \expandafter\ifx\floatlist\relax
7980 \toks0 = {\do}% yes, so just \do
7981 \else
7982 % had it before, so preserve previous elements in list.
7983 \toks0 = \expandafter{\floatlist\do}%
7986 % Remember this xref in the control sequence \floatlistFLOATTYPE,
7987 % for later use in \listoffloats.
7988 \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0
7989 {\safexrefname}}%
7993 % Read the last existing aux file, if any. No error if none exists.
7995 \def\tryauxfile{%
7996 \openin 1 \jobname.aux
7997 \ifeof 1 \else
7998 \readdatafile{aux}%
7999 \global\havexrefstrue
8001 \closein 1
8004 \def\setupdatafile{%
8005 \catcode`\^^@=\other
8006 \catcode`\^^A=\other
8007 \catcode`\^^B=\other
8008 \catcode`\^^C=\other
8009 \catcode`\^^D=\other
8010 \catcode`\^^E=\other
8011 \catcode`\^^F=\other
8012 \catcode`\^^G=\other
8013 \catcode`\^^H=\other
8014 \catcode`\^^K=\other
8015 \catcode`\^^L=\other
8016 \catcode`\^^N=\other
8017 \catcode`\^^P=\other
8018 \catcode`\^^Q=\other
8019 \catcode`\^^R=\other
8020 \catcode`\^^S=\other
8021 \catcode`\^^T=\other
8022 \catcode`\^^U=\other
8023 \catcode`\^^V=\other
8024 \catcode`\^^W=\other
8025 \catcode`\^^X=\other
8026 \catcode`\^^Z=\other
8027 \catcode`\^^[=\other
8028 \catcode`\^^\=\other
8029 \catcode`\^^]=\other
8030 \catcode`\^^^=\other
8031 \catcode`\^^_=\other
8032 % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc.
8033 % in xref tags, i.e., node names. But since ^^e4 notation isn't
8034 % supported in the main text, it doesn't seem desirable. Furthermore,
8035 % that is not enough: for node names that actually contain a ^
8036 % character, we would end up writing a line like this: 'xrdef {'hat
8037 % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first
8038 % argument, and \hat is not an expandable control sequence. It could
8039 % all be worked out, but why? Either we support ^^ or we don't.
8041 % The other change necessary for this was to define \auxhat:
8042 % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter
8043 % and then to call \auxhat in \setq.
8045 \catcode`\^=\other
8047 % Special characters. Should be turned off anyway, but...
8048 \catcode`\~=\other
8049 \catcode`\[=\other
8050 \catcode`\]=\other
8051 \catcode`\"=\other
8052 \catcode`\_=\other
8053 \catcode`\|=\other
8054 \catcode`\<=\other
8055 \catcode`\>=\other
8056 \catcode`\$=\other
8057 \catcode`\#=\other
8058 \catcode`\&=\other
8059 \catcode`\%=\other
8060 \catcode`+=\other % avoid \+ for paranoia even though we've turned it off
8062 % This is to support \ in node names and titles, since the \
8063 % characters end up in a \csname. It's easier than
8064 % leaving it active and making its active definition an actual \
8065 % character. What I don't understand is why it works in the *value*
8066 % of the xrdef. Seems like it should be a catcode12 \, and that
8067 % should not typeset properly. But it works, so I'm moving on for
8068 % now. --karl, 15jan04.
8069 \catcode`\\=\other
8071 % Make the characters 128-255 be printing characters.
8073 \count1=128
8074 \def\loop{%
8075 \catcode\count1=\other
8076 \advance\count1 by 1
8077 \ifnum \count1<256 \loop \fi
8081 % @ is our escape character in .aux files, and we need braces.
8082 \catcode`\{=1
8083 \catcode`\}=2
8084 \catcode`\@=0
8087 \def\readdatafile#1{%
8088 \begingroup
8089 \setupdatafile
8090 \input\jobname.#1
8091 \endgroup}
8094 \message{insertions,}
8095 % including footnotes.
8097 \newcount \footnoteno
8099 % The trailing space in the following definition for supereject is
8100 % vital for proper filling; pages come out unaligned when you do a
8101 % pagealignmacro call if that space before the closing brace is
8102 % removed. (Generally, numeric constants should always be followed by a
8103 % space to prevent strange expansion errors.)
8104 \def\supereject{\par\penalty -20000\footnoteno =0 }
8106 % @footnotestyle is meaningful for info output only.
8107 \let\footnotestyle=\comment
8109 {\catcode `\@=11
8111 % Auto-number footnotes. Otherwise like plain.
8112 \gdef\footnote{%
8113 \let\indent=\ptexindent
8114 \let\noindent=\ptexnoindent
8115 \global\advance\footnoteno by \@ne
8116 \edef\thisfootno{$^{\the\footnoteno}$}%
8118 % In case the footnote comes at the end of a sentence, preserve the
8119 % extra spacing after we do the footnote number.
8120 \let\@sf\empty
8121 \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi
8123 % Remove inadvertent blank space before typesetting the footnote number.
8124 \unskip
8125 \thisfootno\@sf
8126 \dofootnote
8129 % Don't bother with the trickery in plain.tex to not require the
8130 % footnote text as a parameter. Our footnotes don't need to be so general.
8132 % Oh yes, they do; otherwise, @ifset (and anything else that uses
8133 % \parseargline) fails inside footnotes because the tokens are fixed when
8134 % the footnote is read. --karl, 16nov96.
8136 \gdef\dofootnote{%
8137 \insert\footins\bgroup
8138 % We want to typeset this text as a normal paragraph, even if the
8139 % footnote reference occurs in (for example) a display environment.
8140 % So reset some parameters.
8141 \hsize=\pagewidth
8142 \interlinepenalty\interfootnotelinepenalty
8143 \splittopskip\ht\strutbox % top baseline for broken footnotes
8144 \splitmaxdepth\dp\strutbox
8145 \floatingpenalty\@MM
8146 \leftskip\z@skip
8147 \rightskip\z@skip
8148 \spaceskip\z@skip
8149 \xspaceskip\z@skip
8150 \parindent\defaultparindent
8152 \smallfonts \rm
8154 % Because we use hanging indentation in footnotes, a @noindent appears
8155 % to exdent this text, so make it be a no-op. makeinfo does not use
8156 % hanging indentation so @noindent can still be needed within footnote
8157 % text after an @example or the like (not that this is good style).
8158 \let\noindent = \relax
8160 % Hang the footnote text off the number. Use \everypar in case the
8161 % footnote extends for more than one paragraph.
8162 \everypar = {\hang}%
8163 \textindent{\thisfootno}%
8165 % Don't crash into the line above the footnote text. Since this
8166 % expands into a box, it must come within the paragraph, lest it
8167 % provide a place where TeX can split the footnote.
8168 \footstrut
8169 \futurelet\next\fo@t
8171 }%end \catcode `\@=11
8173 % In case a @footnote appears in a vbox, save the footnote text and create
8174 % the real \insert just after the vbox finished. Otherwise, the insertion
8175 % would be lost.
8176 % Similarly, if a @footnote appears inside an alignment, save the footnote
8177 % text to a box and make the \insert when a row of the table is finished.
8178 % And the same can be done for other insert classes. --kasal, 16nov03.
8180 % Replace the \insert primitive by a cheating macro.
8181 % Deeper inside, just make sure that the saved insertions are not spilled
8182 % out prematurely.
8184 \def\startsavinginserts{%
8185 \ifx \insert\ptexinsert
8186 \let\insert\saveinsert
8187 \else
8188 \let\checkinserts\relax
8192 % This \insert replacement works for both \insert\footins{foo} and
8193 % \insert\footins\bgroup foo\egroup, but it doesn't work for \insert27{foo}.
8195 \def\saveinsert#1{%
8196 \edef\next{\noexpand\savetobox \makeSAVEname#1}%
8197 \afterassignment\next
8198 % swallow the left brace
8199 \let\temp =
8201 \def\makeSAVEname#1{\makecsname{SAVE\expandafter\gobble\string#1}}
8202 \def\savetobox#1{\global\setbox#1 = \vbox\bgroup \unvbox#1}
8204 \def\checksaveins#1{\ifvoid#1\else \placesaveins#1\fi}
8206 \def\placesaveins#1{%
8207 \ptexinsert \csname\expandafter\gobblesave\string#1\endcsname
8208 {\box#1}%
8211 % eat @SAVE -- beware, all of them have catcode \other:
8213 \def\dospecials{\do S\do A\do V\do E} \uncatcodespecials % ;-)
8214 \gdef\gobblesave @SAVE{}
8217 % initialization:
8218 \def\newsaveins #1{%
8219 \edef\next{\noexpand\newsaveinsX \makeSAVEname#1}%
8220 \next
8222 \def\newsaveinsX #1{%
8223 \csname newbox\endcsname #1%
8224 \expandafter\def\expandafter\checkinserts\expandafter{\checkinserts
8225 \checksaveins #1}%
8228 % initialize:
8229 \let\checkinserts\empty
8230 \newsaveins\footins
8231 \newsaveins\margin
8234 % @image. We use the macros from epsf.tex to support this.
8235 % If epsf.tex is not installed and @image is used, we complain.
8237 % Check for and read epsf.tex up front. If we read it only at @image
8238 % time, we might be inside a group, and then its definitions would get
8239 % undone and the next image would fail.
8240 \openin 1 = epsf.tex
8241 \ifeof 1 \else
8242 % Do not bother showing banner with epsf.tex v2.7k (available in
8243 % doc/epsf.tex and on ctan).
8244 \def\epsfannounce{\toks0 = }%
8245 \input epsf.tex
8247 \closein 1
8249 % We will only complain once about lack of epsf.tex.
8250 \newif\ifwarnednoepsf
8251 \newhelp\noepsfhelp{epsf.tex must be installed for images to
8252 work. It is also included in the Texinfo distribution, or you can get
8253 it from ftp://tug.org/tex/epsf.tex.}
8255 \def\image#1{%
8256 \ifx\epsfbox\thisiundefined
8257 \ifwarnednoepsf \else
8258 \errhelp = \noepsfhelp
8259 \errmessage{epsf.tex not found, images will be ignored}%
8260 \global\warnednoepsftrue
8262 \else
8263 \imagexxx #1,,,,,\finish
8267 % Arguments to @image:
8268 % #1 is (mandatory) image filename; we tack on .eps extension.
8269 % #2 is (optional) width, #3 is (optional) height.
8270 % #4 is (ignored optional) html alt text.
8271 % #5 is (ignored optional) extension.
8272 % #6 is just the usual extra ignored arg for parsing stuff.
8273 \newif\ifimagevmode
8274 \def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup
8275 \catcode`\^^M = 5 % in case we're inside an example
8276 \normalturnoffactive % allow _ et al. in names
8277 % If the image is by itself, center it.
8278 \ifvmode
8279 \imagevmodetrue
8280 \nobreak\medskip
8281 % Usually we'll have text after the image which will insert
8282 % \parskip glue, so insert it here too to equalize the space
8283 % above and below.
8284 \nobreak\vskip\parskip
8285 \nobreak
8288 % Leave vertical mode so that indentation from an enclosing
8289 % environment such as @quotation is respected. On the other hand, if
8290 % it's at the top level, we don't want the normal paragraph indentation.
8291 \noindent
8293 % Output the image.
8294 \ifpdf
8295 \dopdfimage{#1}{#2}{#3}%
8296 \else
8297 % \epsfbox itself resets \epsf?size at each figure.
8298 \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
8299 \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
8300 \epsfbox{#1.eps}%
8303 \ifimagevmode \medskip \fi % space after the standalone image
8304 \endgroup}
8307 % @float FLOATTYPE,LABEL,LOC ... @end float for displayed figures, tables,
8308 % etc. We don't actually implement floating yet, we always include the
8309 % float "here". But it seemed the best name for the future.
8311 \envparseargdef\float{\eatcommaspace\eatcommaspace\dofloat#1, , ,\finish}
8313 % There may be a space before second and/or third parameter; delete it.
8314 \def\eatcommaspace#1, {#1,}
8316 % #1 is the optional FLOATTYPE, the text label for this float, typically
8317 % "Figure", "Table", "Example", etc. Can't contain commas. If omitted,
8318 % this float will not be numbered and cannot be referred to.
8320 % #2 is the optional xref label. Also must be present for the float to
8321 % be referable.
8323 % #3 is the optional positioning argument; for now, it is ignored. It
8324 % will somehow specify the positions allowed to float to (here, top, bottom).
8326 % We keep a separate counter for each FLOATTYPE, which we reset at each
8327 % chapter-level command.
8328 \let\resetallfloatnos=\empty
8330 \def\dofloat#1,#2,#3,#4\finish{%
8331 \let\thiscaption=\empty
8332 \let\thisshortcaption=\empty
8334 % don't lose footnotes inside @float.
8336 % BEWARE: when the floats start float, we have to issue warning whenever an
8337 % insert appears inside a float which could possibly float. --kasal, 26may04
8339 \startsavinginserts
8341 % We can't be used inside a paragraph.
8342 \par
8344 \vtop\bgroup
8345 \def\floattype{#1}%
8346 \def\floatlabel{#2}%
8347 \def\floatloc{#3}% we do nothing with this yet.
8349 \ifx\floattype\empty
8350 \let\safefloattype=\empty
8351 \else
8353 % the floattype might have accents or other special characters,
8354 % but we need to use it in a control sequence name.
8355 \indexnofonts
8356 \turnoffactive
8357 \xdef\safefloattype{\floattype}%
8361 % If label is given but no type, we handle that as the empty type.
8362 \ifx\floatlabel\empty \else
8363 % We want each FLOATTYPE to be numbered separately (Figure 1,
8364 % Table 1, Figure 2, ...). (And if no label, no number.)
8366 \expandafter\getfloatno\csname\safefloattype floatno\endcsname
8367 \global\advance\floatno by 1
8370 % This magic value for \lastsection is output by \setref as the
8371 % XREFLABEL-title value. \xrefX uses it to distinguish float
8372 % labels (which have a completely different output format) from
8373 % node and anchor labels. And \xrdef uses it to construct the
8374 % lists of floats.
8376 \edef\lastsection{\floatmagic=\safefloattype}%
8377 \setref{\floatlabel}{Yfloat}%
8381 % start with \parskip glue, I guess.
8382 \vskip\parskip
8384 % Don't suppress indentation if a float happens to start a section.
8385 \restorefirstparagraphindent
8388 % we have these possibilities:
8389 % @float Foo,lbl & @caption{Cap}: Foo 1.1: Cap
8390 % @float Foo,lbl & no caption: Foo 1.1
8391 % @float Foo & @caption{Cap}: Foo: Cap
8392 % @float Foo & no caption: Foo
8393 % @float ,lbl & Caption{Cap}: 1.1: Cap
8394 % @float ,lbl & no caption: 1.1
8395 % @float & @caption{Cap}: Cap
8396 % @float & no caption:
8398 \def\Efloat{%
8399 \let\floatident = \empty
8401 % In all cases, if we have a float type, it comes first.
8402 \ifx\floattype\empty \else \def\floatident{\floattype}\fi
8404 % If we have an xref label, the number comes next.
8405 \ifx\floatlabel\empty \else
8406 \ifx\floattype\empty \else % if also had float type, need tie first.
8407 \appendtomacro\floatident{\tie}%
8409 % the number.
8410 \appendtomacro\floatident{\chaplevelprefix\the\floatno}%
8413 % Start the printed caption with what we've constructed in
8414 % \floatident, but keep it separate; we need \floatident again.
8415 \let\captionline = \floatident
8417 \ifx\thiscaption\empty \else
8418 \ifx\floatident\empty \else
8419 \appendtomacro\captionline{: }% had ident, so need a colon between
8422 % caption text.
8423 \appendtomacro\captionline{\scanexp\thiscaption}%
8426 % If we have anything to print, print it, with space before.
8427 % Eventually this needs to become an \insert.
8428 \ifx\captionline\empty \else
8429 \vskip.5\parskip
8430 \captionline
8432 % Space below caption.
8433 \vskip\parskip
8436 % If have an xref label, write the list of floats info. Do this
8437 % after the caption, to avoid chance of it being a breakpoint.
8438 \ifx\floatlabel\empty \else
8439 % Write the text that goes in the lof to the aux file as
8440 % \floatlabel-lof. Besides \floatident, we include the short
8441 % caption if specified, else the full caption if specified, else nothing.
8443 \atdummies
8445 % since we read the caption text in the macro world, where ^^M
8446 % is turned into a normal character, we have to scan it back, so
8447 % we don't write the literal three characters "^^M" into the aux file.
8448 \scanexp{%
8449 \xdef\noexpand\gtemp{%
8450 \ifx\thisshortcaption\empty
8451 \thiscaption
8452 \else
8453 \thisshortcaption
8457 \immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident
8458 \ifx\gtemp\empty \else : \gtemp \fi}}%
8461 \egroup % end of \vtop
8463 % place the captured inserts
8465 % BEWARE: when the floats start floating, we have to issue warning
8466 % whenever an insert appears inside a float which could possibly
8467 % float. --kasal, 26may04
8469 \checkinserts
8472 % Append the tokens #2 to the definition of macro #1, not expanding either.
8474 \def\appendtomacro#1#2{%
8475 \expandafter\def\expandafter#1\expandafter{#1#2}%
8478 % @caption, @shortcaption
8480 \def\caption{\docaption\thiscaption}
8481 \def\shortcaption{\docaption\thisshortcaption}
8482 \def\docaption{\checkenv\float \bgroup\scanargctxt\defcaption}
8483 \def\defcaption#1#2{\egroup \def#1{#2}}
8485 % The parameter is the control sequence identifying the counter we are
8486 % going to use. Create it if it doesn't exist and assign it to \floatno.
8487 \def\getfloatno#1{%
8488 \ifx#1\relax
8489 % Haven't seen this figure type before.
8490 \csname newcount\endcsname #1%
8492 % Remember to reset this floatno at the next chap.
8493 \expandafter\gdef\expandafter\resetallfloatnos
8494 \expandafter{\resetallfloatnos #1=0 }%
8496 \let\floatno#1%
8499 % \setref calls this to get the XREFLABEL-snt value. We want an @xref
8500 % to the FLOATLABEL to expand to "Figure 3.1". We call \setref when we
8501 % first read the @float command.
8503 \def\Yfloat{\floattype@tie \chaplevelprefix\the\floatno}%
8505 % Magic string used for the XREFLABEL-title value, so \xrefX can
8506 % distinguish floats from other xref types.
8507 \def\floatmagic{!!float!!}
8509 % #1 is the control sequence we are passed; we expand into a conditional
8510 % which is true if #1 represents a float ref. That is, the magic
8511 % \lastsection value which we \setref above.
8513 \def\iffloat#1{\expandafter\doiffloat#1==\finish}
8515 % #1 is (maybe) the \floatmagic string. If so, #2 will be the
8516 % (safe) float type for this float. We set \iffloattype to #2.
8518 \def\doiffloat#1=#2=#3\finish{%
8519 \def\temp{#1}%
8520 \def\iffloattype{#2}%
8521 \ifx\temp\floatmagic
8524 % @listoffloats FLOATTYPE - print a list of floats like a table of contents.
8526 \parseargdef\listoffloats{%
8527 \def\floattype{#1}% floattype
8529 % the floattype might have accents or other special characters,
8530 % but we need to use it in a control sequence name.
8531 \indexnofonts
8532 \turnoffactive
8533 \xdef\safefloattype{\floattype}%
8536 % \xrdef saves the floats as a \do-list in \floatlistSAFEFLOATTYPE.
8537 \expandafter\ifx\csname floatlist\safefloattype\endcsname \relax
8538 \ifhavexrefs
8539 % if the user said @listoffloats foo but never @float foo.
8540 \message{\linenumber No `\safefloattype' floats to list.}%
8542 \else
8543 \begingroup
8544 \leftskip=\tocindent % indent these entries like a toc
8545 \let\do=\listoffloatsdo
8546 \csname floatlist\safefloattype\endcsname
8547 \endgroup
8551 % This is called on each entry in a list of floats. We're passed the
8552 % xref label, in the form LABEL-title, which is how we save it in the
8553 % aux file. We strip off the -title and look up \XRLABEL-lof, which
8554 % has the text we're supposed to typeset here.
8556 % Figures without xref labels will not be included in the list (since
8557 % they won't appear in the aux file).
8559 \def\listoffloatsdo#1{\listoffloatsdoentry#1\finish}
8560 \def\listoffloatsdoentry#1-title\finish{{%
8561 % Can't fully expand XR#1-lof because it can contain anything. Just
8562 % pass the control sequence. On the other hand, XR#1-pg is just the
8563 % page number, and we want to fully expand that so we can get a link
8564 % in pdf output.
8565 \toksA = \expandafter{\csname XR#1-lof\endcsname}%
8567 % use the same \entry macro we use to generate the TOC and index.
8568 \edef\writeentry{\noexpand\entry{\the\toksA}{\csname XR#1-pg\endcsname}}%
8569 \writeentry
8573 \message{localization,}
8575 % For single-language documents, @documentlanguage is usually given very
8576 % early, just after @documentencoding. Single argument is the language
8577 % (de) or locale (de_DE) abbreviation.
8580 \catcode`\_ = \active
8581 \globaldefs=1
8582 \parseargdef\documentlanguage{\begingroup
8583 \let_=\normalunderscore % normal _ character for filenames
8584 \tex % read txi-??.tex file in plain TeX.
8585 % Read the file by the name they passed if it exists.
8586 \openin 1 txi-#1.tex
8587 \ifeof 1
8588 \documentlanguagetrywithoutunderscore{#1_\finish}%
8589 \else
8590 \globaldefs = 1 % everything in the txi-LL files needs to persist
8591 \input txi-#1.tex
8593 \closein 1
8594 \endgroup % end raw TeX
8595 \endgroup}
8597 % If they passed de_DE, and txi-de_DE.tex doesn't exist,
8598 % try txi-de.tex.
8600 \gdef\documentlanguagetrywithoutunderscore#1_#2\finish{%
8601 \openin 1 txi-#1.tex
8602 \ifeof 1
8603 \errhelp = \nolanghelp
8604 \errmessage{Cannot read language file txi-#1.tex}%
8605 \else
8606 \globaldefs = 1 % everything in the txi-LL files needs to persist
8607 \input txi-#1.tex
8609 \closein 1
8611 }% end of special _ catcode
8613 \newhelp\nolanghelp{The given language definition file cannot be found or
8614 is empty. Maybe you need to install it? Putting it in the current
8615 directory should work if nowhere else does.}
8617 % This macro is called from txi-??.tex files; the first argument is the
8618 % \language name to set (without the "\lang@" prefix), the second and
8619 % third args are \{left,right}hyphenmin.
8621 % The language names to pass are determined when the format is built.
8622 % See the etex.log file created at that time, e.g.,
8623 % /usr/local/texlive/2008/texmf-var/web2c/pdftex/etex.log.
8625 % With TeX Live 2008, etex now includes hyphenation patterns for all
8626 % available languages. This means we can support hyphenation in
8627 % Texinfo, at least to some extent. (This still doesn't solve the
8628 % accented characters problem.)
8630 \catcode`@=11
8631 \def\txisetlanguage#1#2#3{%
8632 % do not set the language if the name is undefined in the current TeX.
8633 \expandafter\ifx\csname lang@#1\endcsname \relax
8634 \message{no patterns for #1}%
8635 \else
8636 \global\language = \csname lang@#1\endcsname
8638 % but there is no harm in adjusting the hyphenmin values regardless.
8639 \global\lefthyphenmin = #2\relax
8640 \global\righthyphenmin = #3\relax
8643 % Helpers for encodings.
8644 % Set the catcode of characters 128 through 255 to the specified number.
8646 \def\setnonasciicharscatcode#1{%
8647 \count255=128
8648 \loop\ifnum\count255<256
8649 \global\catcode\count255=#1\relax
8650 \advance\count255 by 1
8651 \repeat
8654 \def\setnonasciicharscatcodenonglobal#1{%
8655 \count255=128
8656 \loop\ifnum\count255<256
8657 \catcode\count255=#1\relax
8658 \advance\count255 by 1
8659 \repeat
8662 % @documentencoding sets the definition of non-ASCII characters
8663 % according to the specified encoding.
8665 \parseargdef\documentencoding{%
8666 % Encoding being declared for the document.
8667 \def\declaredencoding{\csname #1.enc\endcsname}%
8669 % Supported encodings: names converted to tokens in order to be able
8670 % to compare them with \ifx.
8671 \def\ascii{\csname US-ASCII.enc\endcsname}%
8672 \def\latnine{\csname ISO-8859-15.enc\endcsname}%
8673 \def\latone{\csname ISO-8859-1.enc\endcsname}%
8674 \def\lattwo{\csname ISO-8859-2.enc\endcsname}%
8675 \def\utfeight{\csname UTF-8.enc\endcsname}%
8677 \ifx \declaredencoding \ascii
8678 \asciichardefs
8680 \else \ifx \declaredencoding \lattwo
8681 \setnonasciicharscatcode\active
8682 \lattwochardefs
8684 \else \ifx \declaredencoding \latone
8685 \setnonasciicharscatcode\active
8686 \latonechardefs
8688 \else \ifx \declaredencoding \latnine
8689 \setnonasciicharscatcode\active
8690 \latninechardefs
8692 \else \ifx \declaredencoding \utfeight
8693 \setnonasciicharscatcode\active
8694 \utfeightchardefs
8696 \else
8697 \message{Unknown document encoding #1, ignoring.}%
8699 \fi % utfeight
8700 \fi % latnine
8701 \fi % latone
8702 \fi % lattwo
8703 \fi % ascii
8706 % A message to be logged when using a character that isn't available
8707 % the default font encoding (OT1).
8709 \def\missingcharmsg#1{\message{Character missing in OT1 encoding: #1.}}
8711 % Take account of \c (plain) vs. \, (Texinfo) difference.
8712 \def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi}
8714 % First, make active non-ASCII characters in order for them to be
8715 % correctly categorized when TeX reads the replacement text of
8716 % macros containing the character definitions.
8717 \setnonasciicharscatcode\active
8719 % Latin1 (ISO-8859-1) character definitions.
8720 \def\latonechardefs{%
8721 \gdef^^a0{\tie}
8722 \gdef^^a1{\exclamdown}
8723 \gdef^^a2{\missingcharmsg{CENT SIGN}}
8724 \gdef^^a3{{\pounds}}
8725 \gdef^^a4{\missingcharmsg{CURRENCY SIGN}}
8726 \gdef^^a5{\missingcharmsg{YEN SIGN}}
8727 \gdef^^a6{\missingcharmsg{BROKEN BAR}}
8728 \gdef^^a7{\S}
8729 \gdef^^a8{\"{}}
8730 \gdef^^a9{\copyright}
8731 \gdef^^aa{\ordf}
8732 \gdef^^ab{\guillemetleft}
8733 \gdef^^ac{$\lnot$}
8734 \gdef^^ad{\-}
8735 \gdef^^ae{\registeredsymbol}
8736 \gdef^^af{\={}}
8738 \gdef^^b0{\textdegree}
8739 \gdef^^b1{$\pm$}
8740 \gdef^^b2{$^2$}
8741 \gdef^^b3{$^3$}
8742 \gdef^^b4{\'{}}
8743 \gdef^^b5{$\mu$}
8744 \gdef^^b6{\P}
8746 \gdef^^b7{$^.$}
8747 \gdef^^b8{\cedilla\ }
8748 \gdef^^b9{$^1$}
8749 \gdef^^ba{\ordm}
8751 \gdef^^bb{\guillemetright}
8752 \gdef^^bc{$1\over4$}
8753 \gdef^^bd{$1\over2$}
8754 \gdef^^be{$3\over4$}
8755 \gdef^^bf{\questiondown}
8757 \gdef^^c0{\`A}
8758 \gdef^^c1{\'A}
8759 \gdef^^c2{\^A}
8760 \gdef^^c3{\~A}
8761 \gdef^^c4{\"A}
8762 \gdef^^c5{\ringaccent A}
8763 \gdef^^c6{\AE}
8764 \gdef^^c7{\cedilla C}
8765 \gdef^^c8{\`E}
8766 \gdef^^c9{\'E}
8767 \gdef^^ca{\^E}
8768 \gdef^^cb{\"E}
8769 \gdef^^cc{\`I}
8770 \gdef^^cd{\'I}
8771 \gdef^^ce{\^I}
8772 \gdef^^cf{\"I}
8774 \gdef^^d0{\DH}
8775 \gdef^^d1{\~N}
8776 \gdef^^d2{\`O}
8777 \gdef^^d3{\'O}
8778 \gdef^^d4{\^O}
8779 \gdef^^d5{\~O}
8780 \gdef^^d6{\"O}
8781 \gdef^^d7{$\times$}
8782 \gdef^^d8{\O}
8783 \gdef^^d9{\`U}
8784 \gdef^^da{\'U}
8785 \gdef^^db{\^U}
8786 \gdef^^dc{\"U}
8787 \gdef^^dd{\'Y}
8788 \gdef^^de{\TH}
8789 \gdef^^df{\ss}
8791 \gdef^^e0{\`a}
8792 \gdef^^e1{\'a}
8793 \gdef^^e2{\^a}
8794 \gdef^^e3{\~a}
8795 \gdef^^e4{\"a}
8796 \gdef^^e5{\ringaccent a}
8797 \gdef^^e6{\ae}
8798 \gdef^^e7{\cedilla c}
8799 \gdef^^e8{\`e}
8800 \gdef^^e9{\'e}
8801 \gdef^^ea{\^e}
8802 \gdef^^eb{\"e}
8803 \gdef^^ec{\`{\dotless i}}
8804 \gdef^^ed{\'{\dotless i}}
8805 \gdef^^ee{\^{\dotless i}}
8806 \gdef^^ef{\"{\dotless i}}
8808 \gdef^^f0{\dh}
8809 \gdef^^f1{\~n}
8810 \gdef^^f2{\`o}
8811 \gdef^^f3{\'o}
8812 \gdef^^f4{\^o}
8813 \gdef^^f5{\~o}
8814 \gdef^^f6{\"o}
8815 \gdef^^f7{$\div$}
8816 \gdef^^f8{\o}
8817 \gdef^^f9{\`u}
8818 \gdef^^fa{\'u}
8819 \gdef^^fb{\^u}
8820 \gdef^^fc{\"u}
8821 \gdef^^fd{\'y}
8822 \gdef^^fe{\th}
8823 \gdef^^ff{\"y}
8826 % Latin9 (ISO-8859-15) encoding character definitions.
8827 \def\latninechardefs{%
8828 % Encoding is almost identical to Latin1.
8829 \latonechardefs
8831 \gdef^^a4{\euro}
8832 \gdef^^a6{\v S}
8833 \gdef^^a8{\v s}
8834 \gdef^^b4{\v Z}
8835 \gdef^^b8{\v z}
8836 \gdef^^bc{\OE}
8837 \gdef^^bd{\oe}
8838 \gdef^^be{\"Y}
8841 % Latin2 (ISO-8859-2) character definitions.
8842 \def\lattwochardefs{%
8843 \gdef^^a0{\tie}
8844 \gdef^^a1{\ogonek{A}}
8845 \gdef^^a2{\u{}}
8846 \gdef^^a3{\L}
8847 \gdef^^a4{\missingcharmsg{CURRENCY SIGN}}
8848 \gdef^^a5{\v L}
8849 \gdef^^a6{\'S}
8850 \gdef^^a7{\S}
8851 \gdef^^a8{\"{}}
8852 \gdef^^a9{\v S}
8853 \gdef^^aa{\cedilla S}
8854 \gdef^^ab{\v T}
8855 \gdef^^ac{\'Z}
8856 \gdef^^ad{\-}
8857 \gdef^^ae{\v Z}
8858 \gdef^^af{\dotaccent Z}
8860 \gdef^^b0{\textdegree}
8861 \gdef^^b1{\ogonek{a}}
8862 \gdef^^b2{\ogonek{ }}
8863 \gdef^^b3{\l}
8864 \gdef^^b4{\'{}}
8865 \gdef^^b5{\v l}
8866 \gdef^^b6{\'s}
8867 \gdef^^b7{\v{}}
8868 \gdef^^b8{\cedilla\ }
8869 \gdef^^b9{\v s}
8870 \gdef^^ba{\cedilla s}
8871 \gdef^^bb{\v t}
8872 \gdef^^bc{\'z}
8873 \gdef^^bd{\H{}}
8874 \gdef^^be{\v z}
8875 \gdef^^bf{\dotaccent z}
8877 \gdef^^c0{\'R}
8878 \gdef^^c1{\'A}
8879 \gdef^^c2{\^A}
8880 \gdef^^c3{\u A}
8881 \gdef^^c4{\"A}
8882 \gdef^^c5{\'L}
8883 \gdef^^c6{\'C}
8884 \gdef^^c7{\cedilla C}
8885 \gdef^^c8{\v C}
8886 \gdef^^c9{\'E}
8887 \gdef^^ca{\ogonek{E}}
8888 \gdef^^cb{\"E}
8889 \gdef^^cc{\v E}
8890 \gdef^^cd{\'I}
8891 \gdef^^ce{\^I}
8892 \gdef^^cf{\v D}
8894 \gdef^^d0{\DH}
8895 \gdef^^d1{\'N}
8896 \gdef^^d2{\v N}
8897 \gdef^^d3{\'O}
8898 \gdef^^d4{\^O}
8899 \gdef^^d5{\H O}
8900 \gdef^^d6{\"O}
8901 \gdef^^d7{$\times$}
8902 \gdef^^d8{\v R}
8903 \gdef^^d9{\ringaccent U}
8904 \gdef^^da{\'U}
8905 \gdef^^db{\H U}
8906 \gdef^^dc{\"U}
8907 \gdef^^dd{\'Y}
8908 \gdef^^de{\cedilla T}
8909 \gdef^^df{\ss}
8911 \gdef^^e0{\'r}
8912 \gdef^^e1{\'a}
8913 \gdef^^e2{\^a}
8914 \gdef^^e3{\u a}
8915 \gdef^^e4{\"a}
8916 \gdef^^e5{\'l}
8917 \gdef^^e6{\'c}
8918 \gdef^^e7{\cedilla c}
8919 \gdef^^e8{\v c}
8920 \gdef^^e9{\'e}
8921 \gdef^^ea{\ogonek{e}}
8922 \gdef^^eb{\"e}
8923 \gdef^^ec{\v e}
8924 \gdef^^ed{\'{\dotless{i}}}
8925 \gdef^^ee{\^{\dotless{i}}}
8926 \gdef^^ef{\v d}
8928 \gdef^^f0{\dh}
8929 \gdef^^f1{\'n}
8930 \gdef^^f2{\v n}
8931 \gdef^^f3{\'o}
8932 \gdef^^f4{\^o}
8933 \gdef^^f5{\H o}
8934 \gdef^^f6{\"o}
8935 \gdef^^f7{$\div$}
8936 \gdef^^f8{\v r}
8937 \gdef^^f9{\ringaccent u}
8938 \gdef^^fa{\'u}
8939 \gdef^^fb{\H u}
8940 \gdef^^fc{\"u}
8941 \gdef^^fd{\'y}
8942 \gdef^^fe{\cedilla t}
8943 \gdef^^ff{\dotaccent{}}
8946 % UTF-8 character definitions.
8948 % This code to support UTF-8 is based on LaTeX's utf8.def, with some
8949 % changes for Texinfo conventions. It is included here under the GPL by
8950 % permission from Frank Mittelbach and the LaTeX team.
8952 \newcount\countUTFx
8953 \newcount\countUTFy
8954 \newcount\countUTFz
8956 \gdef\UTFviiiTwoOctets#1#2{\expandafter
8957 \UTFviiiDefined\csname u8:#1\string #2\endcsname}
8959 \gdef\UTFviiiThreeOctets#1#2#3{\expandafter
8960 \UTFviiiDefined\csname u8:#1\string #2\string #3\endcsname}
8962 \gdef\UTFviiiFourOctets#1#2#3#4{\expandafter
8963 \UTFviiiDefined\csname u8:#1\string #2\string #3\string #4\endcsname}
8965 \gdef\UTFviiiDefined#1{%
8966 \ifx #1\relax
8967 \message{\linenumber Unicode char \string #1 not defined for Texinfo}%
8968 \else
8969 \expandafter #1%
8973 \begingroup
8974 \catcode`\~13
8975 \catcode`\"12
8977 \def\UTFviiiLoop{%
8978 \global\catcode\countUTFx\active
8979 \uccode`\~\countUTFx
8980 \uppercase\expandafter{\UTFviiiTmp}%
8981 \advance\countUTFx by 1
8982 \ifnum\countUTFx < \countUTFy
8983 \expandafter\UTFviiiLoop
8984 \fi}
8986 \countUTFx = "C2
8987 \countUTFy = "E0
8988 \def\UTFviiiTmp{%
8989 \xdef~{\noexpand\UTFviiiTwoOctets\string~}}
8990 \UTFviiiLoop
8992 \countUTFx = "E0
8993 \countUTFy = "F0
8994 \def\UTFviiiTmp{%
8995 \xdef~{\noexpand\UTFviiiThreeOctets\string~}}
8996 \UTFviiiLoop
8998 \countUTFx = "F0
8999 \countUTFy = "F4
9000 \def\UTFviiiTmp{%
9001 \xdef~{\noexpand\UTFviiiFourOctets\string~}}
9002 \UTFviiiLoop
9003 \endgroup
9005 \begingroup
9006 \catcode`\"=12
9007 \catcode`\<=12
9008 \catcode`\.=12
9009 \catcode`\,=12
9010 \catcode`\;=12
9011 \catcode`\!=12
9012 \catcode`\~=13
9014 \gdef\DeclareUnicodeCharacter#1#2{%
9015 \countUTFz = "#1\relax
9016 %\wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}%
9017 \begingroup
9018 \parseXMLCharref
9019 \def\UTFviiiTwoOctets##1##2{%
9020 \csname u8:##1\string ##2\endcsname}%
9021 \def\UTFviiiThreeOctets##1##2##3{%
9022 \csname u8:##1\string ##2\string ##3\endcsname}%
9023 \def\UTFviiiFourOctets##1##2##3##4{%
9024 \csname u8:##1\string ##2\string ##3\string ##4\endcsname}%
9025 \expandafter\expandafter\expandafter\expandafter
9026 \expandafter\expandafter\expandafter
9027 \gdef\UTFviiiTmp{#2}%
9028 \endgroup}
9030 \gdef\parseXMLCharref{%
9031 \ifnum\countUTFz < "A0\relax
9032 \errhelp = \EMsimple
9033 \errmessage{Cannot define Unicode char value < 00A0}%
9034 \else\ifnum\countUTFz < "800\relax
9035 \parseUTFviiiA,%
9036 \parseUTFviiiB C\UTFviiiTwoOctets.,%
9037 \else\ifnum\countUTFz < "10000\relax
9038 \parseUTFviiiA;%
9039 \parseUTFviiiA,%
9040 \parseUTFviiiB E\UTFviiiThreeOctets.{,;}%
9041 \else
9042 \parseUTFviiiA;%
9043 \parseUTFviiiA,%
9044 \parseUTFviiiA!%
9045 \parseUTFviiiB F\UTFviiiFourOctets.{!,;}%
9046 \fi\fi\fi
9049 \gdef\parseUTFviiiA#1{%
9050 \countUTFx = \countUTFz
9051 \divide\countUTFz by 64
9052 \countUTFy = \countUTFz
9053 \multiply\countUTFz by 64
9054 \advance\countUTFx by -\countUTFz
9055 \advance\countUTFx by 128
9056 \uccode `#1\countUTFx
9057 \countUTFz = \countUTFy}
9059 \gdef\parseUTFviiiB#1#2#3#4{%
9060 \advance\countUTFz by "#10\relax
9061 \uccode `#3\countUTFz
9062 \uppercase{\gdef\UTFviiiTmp{#2#3#4}}}
9063 \endgroup
9065 \def\utfeightchardefs{%
9066 \DeclareUnicodeCharacter{00A0}{\tie}
9067 \DeclareUnicodeCharacter{00A1}{\exclamdown}
9068 \DeclareUnicodeCharacter{00A3}{\pounds}
9069 \DeclareUnicodeCharacter{00A8}{\"{ }}
9070 \DeclareUnicodeCharacter{00A9}{\copyright}
9071 \DeclareUnicodeCharacter{00AA}{\ordf}
9072 \DeclareUnicodeCharacter{00AB}{\guillemetleft}
9073 \DeclareUnicodeCharacter{00AD}{\-}
9074 \DeclareUnicodeCharacter{00AE}{\registeredsymbol}
9075 \DeclareUnicodeCharacter{00AF}{\={ }}
9077 \DeclareUnicodeCharacter{00B0}{\ringaccent{ }}
9078 \DeclareUnicodeCharacter{00B4}{\'{ }}
9079 \DeclareUnicodeCharacter{00B8}{\cedilla{ }}
9080 \DeclareUnicodeCharacter{00BA}{\ordm}
9081 \DeclareUnicodeCharacter{00BB}{\guillemetright}
9082 \DeclareUnicodeCharacter{00BF}{\questiondown}
9084 \DeclareUnicodeCharacter{00C0}{\`A}
9085 \DeclareUnicodeCharacter{00C1}{\'A}
9086 \DeclareUnicodeCharacter{00C2}{\^A}
9087 \DeclareUnicodeCharacter{00C3}{\~A}
9088 \DeclareUnicodeCharacter{00C4}{\"A}
9089 \DeclareUnicodeCharacter{00C5}{\AA}
9090 \DeclareUnicodeCharacter{00C6}{\AE}
9091 \DeclareUnicodeCharacter{00C7}{\cedilla{C}}
9092 \DeclareUnicodeCharacter{00C8}{\`E}
9093 \DeclareUnicodeCharacter{00C9}{\'E}
9094 \DeclareUnicodeCharacter{00CA}{\^E}
9095 \DeclareUnicodeCharacter{00CB}{\"E}
9096 \DeclareUnicodeCharacter{00CC}{\`I}
9097 \DeclareUnicodeCharacter{00CD}{\'I}
9098 \DeclareUnicodeCharacter{00CE}{\^I}
9099 \DeclareUnicodeCharacter{00CF}{\"I}
9101 \DeclareUnicodeCharacter{00D0}{\DH}
9102 \DeclareUnicodeCharacter{00D1}{\~N}
9103 \DeclareUnicodeCharacter{00D2}{\`O}
9104 \DeclareUnicodeCharacter{00D3}{\'O}
9105 \DeclareUnicodeCharacter{00D4}{\^O}
9106 \DeclareUnicodeCharacter{00D5}{\~O}
9107 \DeclareUnicodeCharacter{00D6}{\"O}
9108 \DeclareUnicodeCharacter{00D8}{\O}
9109 \DeclareUnicodeCharacter{00D9}{\`U}
9110 \DeclareUnicodeCharacter{00DA}{\'U}
9111 \DeclareUnicodeCharacter{00DB}{\^U}
9112 \DeclareUnicodeCharacter{00DC}{\"U}
9113 \DeclareUnicodeCharacter{00DD}{\'Y}
9114 \DeclareUnicodeCharacter{00DE}{\TH}
9115 \DeclareUnicodeCharacter{00DF}{\ss}
9117 \DeclareUnicodeCharacter{00E0}{\`a}
9118 \DeclareUnicodeCharacter{00E1}{\'a}
9119 \DeclareUnicodeCharacter{00E2}{\^a}
9120 \DeclareUnicodeCharacter{00E3}{\~a}
9121 \DeclareUnicodeCharacter{00E4}{\"a}
9122 \DeclareUnicodeCharacter{00E5}{\aa}
9123 \DeclareUnicodeCharacter{00E6}{\ae}
9124 \DeclareUnicodeCharacter{00E7}{\cedilla{c}}
9125 \DeclareUnicodeCharacter{00E8}{\`e}
9126 \DeclareUnicodeCharacter{00E9}{\'e}
9127 \DeclareUnicodeCharacter{00EA}{\^e}
9128 \DeclareUnicodeCharacter{00EB}{\"e}
9129 \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}}
9130 \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}}
9131 \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}}
9132 \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}}
9134 \DeclareUnicodeCharacter{00F0}{\dh}
9135 \DeclareUnicodeCharacter{00F1}{\~n}
9136 \DeclareUnicodeCharacter{00F2}{\`o}
9137 \DeclareUnicodeCharacter{00F3}{\'o}
9138 \DeclareUnicodeCharacter{00F4}{\^o}
9139 \DeclareUnicodeCharacter{00F5}{\~o}
9140 \DeclareUnicodeCharacter{00F6}{\"o}
9141 \DeclareUnicodeCharacter{00F8}{\o}
9142 \DeclareUnicodeCharacter{00F9}{\`u}
9143 \DeclareUnicodeCharacter{00FA}{\'u}
9144 \DeclareUnicodeCharacter{00FB}{\^u}
9145 \DeclareUnicodeCharacter{00FC}{\"u}
9146 \DeclareUnicodeCharacter{00FD}{\'y}
9147 \DeclareUnicodeCharacter{00FE}{\th}
9148 \DeclareUnicodeCharacter{00FF}{\"y}
9150 \DeclareUnicodeCharacter{0100}{\=A}
9151 \DeclareUnicodeCharacter{0101}{\=a}
9152 \DeclareUnicodeCharacter{0102}{\u{A}}
9153 \DeclareUnicodeCharacter{0103}{\u{a}}
9154 \DeclareUnicodeCharacter{0104}{\ogonek{A}}
9155 \DeclareUnicodeCharacter{0105}{\ogonek{a}}
9156 \DeclareUnicodeCharacter{0106}{\'C}
9157 \DeclareUnicodeCharacter{0107}{\'c}
9158 \DeclareUnicodeCharacter{0108}{\^C}
9159 \DeclareUnicodeCharacter{0109}{\^c}
9160 \DeclareUnicodeCharacter{0118}{\ogonek{E}}
9161 \DeclareUnicodeCharacter{0119}{\ogonek{e}}
9162 \DeclareUnicodeCharacter{010A}{\dotaccent{C}}
9163 \DeclareUnicodeCharacter{010B}{\dotaccent{c}}
9164 \DeclareUnicodeCharacter{010C}{\v{C}}
9165 \DeclareUnicodeCharacter{010D}{\v{c}}
9166 \DeclareUnicodeCharacter{010E}{\v{D}}
9168 \DeclareUnicodeCharacter{0112}{\=E}
9169 \DeclareUnicodeCharacter{0113}{\=e}
9170 \DeclareUnicodeCharacter{0114}{\u{E}}
9171 \DeclareUnicodeCharacter{0115}{\u{e}}
9172 \DeclareUnicodeCharacter{0116}{\dotaccent{E}}
9173 \DeclareUnicodeCharacter{0117}{\dotaccent{e}}
9174 \DeclareUnicodeCharacter{011A}{\v{E}}
9175 \DeclareUnicodeCharacter{011B}{\v{e}}
9176 \DeclareUnicodeCharacter{011C}{\^G}
9177 \DeclareUnicodeCharacter{011D}{\^g}
9178 \DeclareUnicodeCharacter{011E}{\u{G}}
9179 \DeclareUnicodeCharacter{011F}{\u{g}}
9181 \DeclareUnicodeCharacter{0120}{\dotaccent{G}}
9182 \DeclareUnicodeCharacter{0121}{\dotaccent{g}}
9183 \DeclareUnicodeCharacter{0124}{\^H}
9184 \DeclareUnicodeCharacter{0125}{\^h}
9185 \DeclareUnicodeCharacter{0128}{\~I}
9186 \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}}
9187 \DeclareUnicodeCharacter{012A}{\=I}
9188 \DeclareUnicodeCharacter{012B}{\={\dotless{i}}}
9189 \DeclareUnicodeCharacter{012C}{\u{I}}
9190 \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}}
9192 \DeclareUnicodeCharacter{0130}{\dotaccent{I}}
9193 \DeclareUnicodeCharacter{0131}{\dotless{i}}
9194 \DeclareUnicodeCharacter{0132}{IJ}
9195 \DeclareUnicodeCharacter{0133}{ij}
9196 \DeclareUnicodeCharacter{0134}{\^J}
9197 \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}}
9198 \DeclareUnicodeCharacter{0139}{\'L}
9199 \DeclareUnicodeCharacter{013A}{\'l}
9201 \DeclareUnicodeCharacter{0141}{\L}
9202 \DeclareUnicodeCharacter{0142}{\l}
9203 \DeclareUnicodeCharacter{0143}{\'N}
9204 \DeclareUnicodeCharacter{0144}{\'n}
9205 \DeclareUnicodeCharacter{0147}{\v{N}}
9206 \DeclareUnicodeCharacter{0148}{\v{n}}
9207 \DeclareUnicodeCharacter{014C}{\=O}
9208 \DeclareUnicodeCharacter{014D}{\=o}
9209 \DeclareUnicodeCharacter{014E}{\u{O}}
9210 \DeclareUnicodeCharacter{014F}{\u{o}}
9212 \DeclareUnicodeCharacter{0150}{\H{O}}
9213 \DeclareUnicodeCharacter{0151}{\H{o}}
9214 \DeclareUnicodeCharacter{0152}{\OE}
9215 \DeclareUnicodeCharacter{0153}{\oe}
9216 \DeclareUnicodeCharacter{0154}{\'R}
9217 \DeclareUnicodeCharacter{0155}{\'r}
9218 \DeclareUnicodeCharacter{0158}{\v{R}}
9219 \DeclareUnicodeCharacter{0159}{\v{r}}
9220 \DeclareUnicodeCharacter{015A}{\'S}
9221 \DeclareUnicodeCharacter{015B}{\'s}
9222 \DeclareUnicodeCharacter{015C}{\^S}
9223 \DeclareUnicodeCharacter{015D}{\^s}
9224 \DeclareUnicodeCharacter{015E}{\cedilla{S}}
9225 \DeclareUnicodeCharacter{015F}{\cedilla{s}}
9227 \DeclareUnicodeCharacter{0160}{\v{S}}
9228 \DeclareUnicodeCharacter{0161}{\v{s}}
9229 \DeclareUnicodeCharacter{0162}{\cedilla{t}}
9230 \DeclareUnicodeCharacter{0163}{\cedilla{T}}
9231 \DeclareUnicodeCharacter{0164}{\v{T}}
9233 \DeclareUnicodeCharacter{0168}{\~U}
9234 \DeclareUnicodeCharacter{0169}{\~u}
9235 \DeclareUnicodeCharacter{016A}{\=U}
9236 \DeclareUnicodeCharacter{016B}{\=u}
9237 \DeclareUnicodeCharacter{016C}{\u{U}}
9238 \DeclareUnicodeCharacter{016D}{\u{u}}
9239 \DeclareUnicodeCharacter{016E}{\ringaccent{U}}
9240 \DeclareUnicodeCharacter{016F}{\ringaccent{u}}
9242 \DeclareUnicodeCharacter{0170}{\H{U}}
9243 \DeclareUnicodeCharacter{0171}{\H{u}}
9244 \DeclareUnicodeCharacter{0174}{\^W}
9245 \DeclareUnicodeCharacter{0175}{\^w}
9246 \DeclareUnicodeCharacter{0176}{\^Y}
9247 \DeclareUnicodeCharacter{0177}{\^y}
9248 \DeclareUnicodeCharacter{0178}{\"Y}
9249 \DeclareUnicodeCharacter{0179}{\'Z}
9250 \DeclareUnicodeCharacter{017A}{\'z}
9251 \DeclareUnicodeCharacter{017B}{\dotaccent{Z}}
9252 \DeclareUnicodeCharacter{017C}{\dotaccent{z}}
9253 \DeclareUnicodeCharacter{017D}{\v{Z}}
9254 \DeclareUnicodeCharacter{017E}{\v{z}}
9256 \DeclareUnicodeCharacter{01C4}{D\v{Z}}
9257 \DeclareUnicodeCharacter{01C5}{D\v{z}}
9258 \DeclareUnicodeCharacter{01C6}{d\v{z}}
9259 \DeclareUnicodeCharacter{01C7}{LJ}
9260 \DeclareUnicodeCharacter{01C8}{Lj}
9261 \DeclareUnicodeCharacter{01C9}{lj}
9262 \DeclareUnicodeCharacter{01CA}{NJ}
9263 \DeclareUnicodeCharacter{01CB}{Nj}
9264 \DeclareUnicodeCharacter{01CC}{nj}
9265 \DeclareUnicodeCharacter{01CD}{\v{A}}
9266 \DeclareUnicodeCharacter{01CE}{\v{a}}
9267 \DeclareUnicodeCharacter{01CF}{\v{I}}
9269 \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}}
9270 \DeclareUnicodeCharacter{01D1}{\v{O}}
9271 \DeclareUnicodeCharacter{01D2}{\v{o}}
9272 \DeclareUnicodeCharacter{01D3}{\v{U}}
9273 \DeclareUnicodeCharacter{01D4}{\v{u}}
9275 \DeclareUnicodeCharacter{01E2}{\={\AE}}
9276 \DeclareUnicodeCharacter{01E3}{\={\ae}}
9277 \DeclareUnicodeCharacter{01E6}{\v{G}}
9278 \DeclareUnicodeCharacter{01E7}{\v{g}}
9279 \DeclareUnicodeCharacter{01E8}{\v{K}}
9280 \DeclareUnicodeCharacter{01E9}{\v{k}}
9282 \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}}
9283 \DeclareUnicodeCharacter{01F1}{DZ}
9284 \DeclareUnicodeCharacter{01F2}{Dz}
9285 \DeclareUnicodeCharacter{01F3}{dz}
9286 \DeclareUnicodeCharacter{01F4}{\'G}
9287 \DeclareUnicodeCharacter{01F5}{\'g}
9288 \DeclareUnicodeCharacter{01F8}{\`N}
9289 \DeclareUnicodeCharacter{01F9}{\`n}
9290 \DeclareUnicodeCharacter{01FC}{\'{\AE}}
9291 \DeclareUnicodeCharacter{01FD}{\'{\ae}}
9292 \DeclareUnicodeCharacter{01FE}{\'{\O}}
9293 \DeclareUnicodeCharacter{01FF}{\'{\o}}
9295 \DeclareUnicodeCharacter{021E}{\v{H}}
9296 \DeclareUnicodeCharacter{021F}{\v{h}}
9298 \DeclareUnicodeCharacter{0226}{\dotaccent{A}}
9299 \DeclareUnicodeCharacter{0227}{\dotaccent{a}}
9300 \DeclareUnicodeCharacter{0228}{\cedilla{E}}
9301 \DeclareUnicodeCharacter{0229}{\cedilla{e}}
9302 \DeclareUnicodeCharacter{022E}{\dotaccent{O}}
9303 \DeclareUnicodeCharacter{022F}{\dotaccent{o}}
9305 \DeclareUnicodeCharacter{0232}{\=Y}
9306 \DeclareUnicodeCharacter{0233}{\=y}
9307 \DeclareUnicodeCharacter{0237}{\dotless{j}}
9309 \DeclareUnicodeCharacter{02DB}{\ogonek{ }}
9311 \DeclareUnicodeCharacter{1E02}{\dotaccent{B}}
9312 \DeclareUnicodeCharacter{1E03}{\dotaccent{b}}
9313 \DeclareUnicodeCharacter{1E04}{\udotaccent{B}}
9314 \DeclareUnicodeCharacter{1E05}{\udotaccent{b}}
9315 \DeclareUnicodeCharacter{1E06}{\ubaraccent{B}}
9316 \DeclareUnicodeCharacter{1E07}{\ubaraccent{b}}
9317 \DeclareUnicodeCharacter{1E0A}{\dotaccent{D}}
9318 \DeclareUnicodeCharacter{1E0B}{\dotaccent{d}}
9319 \DeclareUnicodeCharacter{1E0C}{\udotaccent{D}}
9320 \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}}
9321 \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}}
9322 \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}}
9324 \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}}
9325 \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}}
9327 \DeclareUnicodeCharacter{1E20}{\=G}
9328 \DeclareUnicodeCharacter{1E21}{\=g}
9329 \DeclareUnicodeCharacter{1E22}{\dotaccent{H}}
9330 \DeclareUnicodeCharacter{1E23}{\dotaccent{h}}
9331 \DeclareUnicodeCharacter{1E24}{\udotaccent{H}}
9332 \DeclareUnicodeCharacter{1E25}{\udotaccent{h}}
9333 \DeclareUnicodeCharacter{1E26}{\"H}
9334 \DeclareUnicodeCharacter{1E27}{\"h}
9336 \DeclareUnicodeCharacter{1E30}{\'K}
9337 \DeclareUnicodeCharacter{1E31}{\'k}
9338 \DeclareUnicodeCharacter{1E32}{\udotaccent{K}}
9339 \DeclareUnicodeCharacter{1E33}{\udotaccent{k}}
9340 \DeclareUnicodeCharacter{1E34}{\ubaraccent{K}}
9341 \DeclareUnicodeCharacter{1E35}{\ubaraccent{k}}
9342 \DeclareUnicodeCharacter{1E36}{\udotaccent{L}}
9343 \DeclareUnicodeCharacter{1E37}{\udotaccent{l}}
9344 \DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}}
9345 \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}}
9346 \DeclareUnicodeCharacter{1E3E}{\'M}
9347 \DeclareUnicodeCharacter{1E3F}{\'m}
9349 \DeclareUnicodeCharacter{1E40}{\dotaccent{M}}
9350 \DeclareUnicodeCharacter{1E41}{\dotaccent{m}}
9351 \DeclareUnicodeCharacter{1E42}{\udotaccent{M}}
9352 \DeclareUnicodeCharacter{1E43}{\udotaccent{m}}
9353 \DeclareUnicodeCharacter{1E44}{\dotaccent{N}}
9354 \DeclareUnicodeCharacter{1E45}{\dotaccent{n}}
9355 \DeclareUnicodeCharacter{1E46}{\udotaccent{N}}
9356 \DeclareUnicodeCharacter{1E47}{\udotaccent{n}}
9357 \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}}
9358 \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}}
9360 \DeclareUnicodeCharacter{1E54}{\'P}
9361 \DeclareUnicodeCharacter{1E55}{\'p}
9362 \DeclareUnicodeCharacter{1E56}{\dotaccent{P}}
9363 \DeclareUnicodeCharacter{1E57}{\dotaccent{p}}
9364 \DeclareUnicodeCharacter{1E58}{\dotaccent{R}}
9365 \DeclareUnicodeCharacter{1E59}{\dotaccent{r}}
9366 \DeclareUnicodeCharacter{1E5A}{\udotaccent{R}}
9367 \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}}
9368 \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}}
9369 \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}}
9371 \DeclareUnicodeCharacter{1E60}{\dotaccent{S}}
9372 \DeclareUnicodeCharacter{1E61}{\dotaccent{s}}
9373 \DeclareUnicodeCharacter{1E62}{\udotaccent{S}}
9374 \DeclareUnicodeCharacter{1E63}{\udotaccent{s}}
9375 \DeclareUnicodeCharacter{1E6A}{\dotaccent{T}}
9376 \DeclareUnicodeCharacter{1E6B}{\dotaccent{t}}
9377 \DeclareUnicodeCharacter{1E6C}{\udotaccent{T}}
9378 \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}}
9379 \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}}
9380 \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}}
9382 \DeclareUnicodeCharacter{1E7C}{\~V}
9383 \DeclareUnicodeCharacter{1E7D}{\~v}
9384 \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}}
9385 \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}}
9387 \DeclareUnicodeCharacter{1E80}{\`W}
9388 \DeclareUnicodeCharacter{1E81}{\`w}
9389 \DeclareUnicodeCharacter{1E82}{\'W}
9390 \DeclareUnicodeCharacter{1E83}{\'w}
9391 \DeclareUnicodeCharacter{1E84}{\"W}
9392 \DeclareUnicodeCharacter{1E85}{\"w}
9393 \DeclareUnicodeCharacter{1E86}{\dotaccent{W}}
9394 \DeclareUnicodeCharacter{1E87}{\dotaccent{w}}
9395 \DeclareUnicodeCharacter{1E88}{\udotaccent{W}}
9396 \DeclareUnicodeCharacter{1E89}{\udotaccent{w}}
9397 \DeclareUnicodeCharacter{1E8A}{\dotaccent{X}}
9398 \DeclareUnicodeCharacter{1E8B}{\dotaccent{x}}
9399 \DeclareUnicodeCharacter{1E8C}{\"X}
9400 \DeclareUnicodeCharacter{1E8D}{\"x}
9401 \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}}
9402 \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}}
9404 \DeclareUnicodeCharacter{1E90}{\^Z}
9405 \DeclareUnicodeCharacter{1E91}{\^z}
9406 \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}}
9407 \DeclareUnicodeCharacter{1E93}{\udotaccent{z}}
9408 \DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}}
9409 \DeclareUnicodeCharacter{1E95}{\ubaraccent{z}}
9410 \DeclareUnicodeCharacter{1E96}{\ubaraccent{h}}
9411 \DeclareUnicodeCharacter{1E97}{\"t}
9412 \DeclareUnicodeCharacter{1E98}{\ringaccent{w}}
9413 \DeclareUnicodeCharacter{1E99}{\ringaccent{y}}
9415 \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}}
9416 \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}}
9418 \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}}
9419 \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}}
9420 \DeclareUnicodeCharacter{1EBC}{\~E}
9421 \DeclareUnicodeCharacter{1EBD}{\~e}
9423 \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}}
9424 \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}}
9425 \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}}
9426 \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}}
9428 \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}}
9429 \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}}
9431 \DeclareUnicodeCharacter{1EF2}{\`Y}
9432 \DeclareUnicodeCharacter{1EF3}{\`y}
9433 \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}}
9435 \DeclareUnicodeCharacter{1EF8}{\~Y}
9436 \DeclareUnicodeCharacter{1EF9}{\~y}
9438 \DeclareUnicodeCharacter{2013}{--}
9439 \DeclareUnicodeCharacter{2014}{---}
9440 \DeclareUnicodeCharacter{2018}{\quoteleft}
9441 \DeclareUnicodeCharacter{2019}{\quoteright}
9442 \DeclareUnicodeCharacter{201A}{\quotesinglbase}
9443 \DeclareUnicodeCharacter{201C}{\quotedblleft}
9444 \DeclareUnicodeCharacter{201D}{\quotedblright}
9445 \DeclareUnicodeCharacter{201E}{\quotedblbase}
9446 \DeclareUnicodeCharacter{2022}{\bullet}
9447 \DeclareUnicodeCharacter{2026}{\dots}
9448 \DeclareUnicodeCharacter{2039}{\guilsinglleft}
9449 \DeclareUnicodeCharacter{203A}{\guilsinglright}
9450 \DeclareUnicodeCharacter{20AC}{\euro}
9452 \DeclareUnicodeCharacter{2192}{\expansion}
9453 \DeclareUnicodeCharacter{21D2}{\result}
9455 \DeclareUnicodeCharacter{2212}{\minus}
9456 \DeclareUnicodeCharacter{2217}{\point}
9457 \DeclareUnicodeCharacter{2261}{\equiv}
9458 }% end of \utfeightchardefs
9461 % US-ASCII character definitions.
9462 \def\asciichardefs{% nothing need be done
9463 \relax
9466 % Make non-ASCII characters printable again for compatibility with
9467 % existing Texinfo documents that may use them, even without declaring a
9468 % document encoding.
9470 \setnonasciicharscatcode \other
9473 \message{formatting,}
9475 \newdimen\defaultparindent \defaultparindent = 15pt
9477 \chapheadingskip = 15pt plus 4pt minus 2pt
9478 \secheadingskip = 12pt plus 3pt minus 2pt
9479 \subsecheadingskip = 9pt plus 2pt minus 2pt
9481 % Prevent underfull vbox error messages.
9482 \vbadness = 10000
9484 % Don't be very finicky about underfull hboxes, either.
9485 \hbadness = 6666
9487 % Following George Bush, get rid of widows and orphans.
9488 \widowpenalty=10000
9489 \clubpenalty=10000
9491 % Use TeX 3.0's \emergencystretch to help line breaking, but if we're
9492 % using an old version of TeX, don't do anything. We want the amount of
9493 % stretch added to depend on the line length, hence the dependence on
9494 % \hsize. We call this whenever the paper size is set.
9496 \def\setemergencystretch{%
9497 \ifx\emergencystretch\thisisundefined
9498 % Allow us to assign to \emergencystretch anyway.
9499 \def\emergencystretch{\dimen0}%
9500 \else
9501 \emergencystretch = .15\hsize
9505 % Parameters in order: 1) textheight; 2) textwidth;
9506 % 3) voffset; 4) hoffset; 5) binding offset; 6) topskip;
9507 % 7) physical page height; 8) physical page width.
9509 % We also call \setleading{\textleading}, so the caller should define
9510 % \textleading. The caller should also set \parskip.
9512 \def\internalpagesizes#1#2#3#4#5#6#7#8{%
9513 \voffset = #3\relax
9514 \topskip = #6\relax
9515 \splittopskip = \topskip
9517 \vsize = #1\relax
9518 \advance\vsize by \topskip
9519 \outervsize = \vsize
9520 \advance\outervsize by 2\topandbottommargin
9521 \pageheight = \vsize
9523 \hsize = #2\relax
9524 \outerhsize = \hsize
9525 \advance\outerhsize by 0.5in
9526 \pagewidth = \hsize
9528 \normaloffset = #4\relax
9529 \bindingoffset = #5\relax
9531 \ifpdf
9532 \pdfpageheight #7\relax
9533 \pdfpagewidth #8\relax
9534 % if we don't reset these, they will remain at "1 true in" of
9535 % whatever layout pdftex was dumped with.
9536 \pdfhorigin = 1 true in
9537 \pdfvorigin = 1 true in
9540 \setleading{\textleading}
9542 \parindent = \defaultparindent
9543 \setemergencystretch
9546 % @letterpaper (the default).
9547 \def\letterpaper{{\globaldefs = 1
9548 \parskip = 3pt plus 2pt minus 1pt
9549 \textleading = 13.2pt
9551 % If page is nothing but text, make it come out even.
9552 \internalpagesizes{607.2pt}{6in}% that's 46 lines
9553 {\voffset}{.25in}%
9554 {\bindingoffset}{36pt}%
9555 {11in}{8.5in}%
9558 % Use @smallbook to reset parameters for 7x9.25 trim size.
9559 \def\smallbook{{\globaldefs = 1
9560 \parskip = 2pt plus 1pt
9561 \textleading = 12pt
9563 \internalpagesizes{7.5in}{5in}%
9564 {-.2in}{0in}%
9565 {\bindingoffset}{16pt}%
9566 {9.25in}{7in}%
9568 \lispnarrowing = 0.3in
9569 \tolerance = 700
9570 \hfuzz = 1pt
9571 \contentsrightmargin = 0pt
9572 \defbodyindent = .5cm
9575 % Use @smallerbook to reset parameters for 6x9 trim size.
9576 % (Just testing, parameters still in flux.)
9577 \def\smallerbook{{\globaldefs = 1
9578 \parskip = 1.5pt plus 1pt
9579 \textleading = 12pt
9581 \internalpagesizes{7.4in}{4.8in}%
9582 {-.2in}{-.4in}%
9583 {0pt}{14pt}%
9584 {9in}{6in}%
9586 \lispnarrowing = 0.25in
9587 \tolerance = 700
9588 \hfuzz = 1pt
9589 \contentsrightmargin = 0pt
9590 \defbodyindent = .4cm
9593 % Use @afourpaper to print on European A4 paper.
9594 \def\afourpaper{{\globaldefs = 1
9595 \parskip = 3pt plus 2pt minus 1pt
9596 \textleading = 13.2pt
9598 % Double-side printing via postscript on Laserjet 4050
9599 % prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm.
9600 % To change the settings for a different printer or situation, adjust
9601 % \normaloffset until the front-side and back-side texts align. Then
9602 % do the same for \bindingoffset. You can set these for testing in
9603 % your texinfo source file like this:
9604 % @tex
9605 % \global\normaloffset = -6mm
9606 % \global\bindingoffset = 10mm
9607 % @end tex
9608 \internalpagesizes{673.2pt}{160mm}% that's 51 lines
9609 {\voffset}{\hoffset}%
9610 {\bindingoffset}{44pt}%
9611 {297mm}{210mm}%
9613 \tolerance = 700
9614 \hfuzz = 1pt
9615 \contentsrightmargin = 0pt
9616 \defbodyindent = 5mm
9619 % Use @afivepaper to print on European A5 paper.
9620 % From romildo@urano.iceb.ufop.br, 2 July 2000.
9621 % He also recommends making @example and @lisp be small.
9622 \def\afivepaper{{\globaldefs = 1
9623 \parskip = 2pt plus 1pt minus 0.1pt
9624 \textleading = 12.5pt
9626 \internalpagesizes{160mm}{120mm}%
9627 {\voffset}{\hoffset}%
9628 {\bindingoffset}{8pt}%
9629 {210mm}{148mm}%
9631 \lispnarrowing = 0.2in
9632 \tolerance = 800
9633 \hfuzz = 1.2pt
9634 \contentsrightmargin = 0pt
9635 \defbodyindent = 2mm
9636 \tableindent = 12mm
9639 % A specific text layout, 24x15cm overall, intended for A4 paper.
9640 \def\afourlatex{{\globaldefs = 1
9641 \afourpaper
9642 \internalpagesizes{237mm}{150mm}%
9643 {\voffset}{4.6mm}%
9644 {\bindingoffset}{7mm}%
9645 {297mm}{210mm}%
9647 % Must explicitly reset to 0 because we call \afourpaper.
9648 \globaldefs = 0
9651 % Use @afourwide to print on A4 paper in landscape format.
9652 \def\afourwide{{\globaldefs = 1
9653 \afourpaper
9654 \internalpagesizes{241mm}{165mm}%
9655 {\voffset}{-2.95mm}%
9656 {\bindingoffset}{7mm}%
9657 {297mm}{210mm}%
9658 \globaldefs = 0
9661 % @pagesizes TEXTHEIGHT[,TEXTWIDTH]
9662 % Perhaps we should allow setting the margins, \topskip, \parskip,
9663 % and/or leading, also. Or perhaps we should compute them somehow.
9665 \parseargdef\pagesizes{\pagesizesyyy #1,,\finish}
9666 \def\pagesizesyyy#1,#2,#3\finish{{%
9667 \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi
9668 \globaldefs = 1
9670 \parskip = 3pt plus 2pt minus 1pt
9671 \setleading{\textleading}%
9673 \dimen0 = #1\relax
9674 \advance\dimen0 by \voffset
9676 \dimen2 = \hsize
9677 \advance\dimen2 by \normaloffset
9679 \internalpagesizes{#1}{\hsize}%
9680 {\voffset}{\normaloffset}%
9681 {\bindingoffset}{44pt}%
9682 {\dimen0}{\dimen2}%
9685 % Set default to letter.
9687 \letterpaper
9690 \message{and turning on texinfo input format.}
9692 \def^^L{\par} % remove \outer, so ^L can appear in an @comment
9694 % DEL is a comment character, in case @c does not suffice.
9695 \catcode`\^^? = 14
9697 % Define macros to output various characters with catcode for normal text.
9698 \catcode`\"=\other \def\normaldoublequote{"}
9699 \catcode`\$=\other \def\normaldollar{$}%$ font-lock fix
9700 \catcode`\+=\other \def\normalplus{+}
9701 \catcode`\<=\other \def\normalless{<}
9702 \catcode`\>=\other \def\normalgreater{>}
9703 \catcode`\^=\other \def\normalcaret{^}
9704 \catcode`\_=\other \def\normalunderscore{_}
9705 \catcode`\|=\other \def\normalverticalbar{|}
9706 \catcode`\~=\other \def\normaltilde{~}
9708 % This macro is used to make a character print one way in \tt
9709 % (where it can probably be output as-is), and another way in other fonts,
9710 % where something hairier probably needs to be done.
9712 % #1 is what to print if we are indeed using \tt; #2 is what to print
9713 % otherwise. Since all the Computer Modern typewriter fonts have zero
9714 % interword stretch (and shrink), and it is reasonable to expect all
9715 % typewriter fonts to have this, we can check that font parameter.
9717 \def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi}
9719 % Same as above, but check for italic font. Actually this also catches
9720 % non-italic slanted fonts since it is impossible to distinguish them from
9721 % italic fonts. But since this is only used by $ and it uses \sl anyway
9722 % this is not a problem.
9723 \def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi}
9725 % Turn off all special characters except @
9726 % (and those which the user can use as if they were ordinary).
9727 % Most of these we simply print from the \tt font, but for some, we can
9728 % use math or other variants that look better in normal text.
9730 \catcode`\"=\active
9731 \def\activedoublequote{{\tt\char34}}
9732 \let"=\activedoublequote
9733 \catcode`\~=\active
9734 \def~{{\tt\char126}}
9735 \chardef\hat=`\^
9736 \catcode`\^=\active
9737 \def^{{\tt \hat}}
9739 \catcode`\_=\active
9740 \def_{\ifusingtt\normalunderscore\_}
9741 \let\realunder=_
9742 % Subroutine for the previous macro.
9743 \def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em }
9745 \catcode`\|=\active
9746 \def|{{\tt\char124}}
9747 \chardef \less=`\<
9748 \catcode`\<=\active
9749 \def<{{\tt \less}}
9750 \chardef \gtr=`\>
9751 \catcode`\>=\active
9752 \def>{{\tt \gtr}}
9753 \catcode`\+=\active
9754 \def+{{\tt \char 43}}
9755 \catcode`\$=\active
9756 \def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix
9758 % If a .fmt file is being used, characters that might appear in a file
9759 % name cannot be active until we have parsed the command line.
9760 % So turn them off again, and have \everyjob (or @setfilename) turn them on.
9761 % \otherifyactive is called near the end of this file.
9762 \def\otherifyactive{\catcode`+=\other \catcode`\_=\other}
9764 % Used sometimes to turn off (effectively) the active characters even after
9765 % parsing them.
9766 \def\turnoffactive{%
9767 \normalturnoffactive
9768 \otherbackslash
9771 \catcode`\@=0
9773 % \backslashcurfont outputs one backslash character in current font,
9774 % as in \char`\\.
9775 \global\chardef\backslashcurfont=`\\
9776 \global\let\rawbackslashxx=\backslashcurfont % let existing .??s files work
9778 % \realbackslash is an actual character `\' with catcode other, and
9779 % \doublebackslash is two of them (for the pdf outlines).
9780 {\catcode`\\=\other @gdef@realbackslash{\} @gdef@doublebackslash{\\}}
9782 % In texinfo, backslash is an active character; it prints the backslash
9783 % in fixed width font.
9784 \catcode`\\=\active
9785 @def@normalbackslash{{@tt@backslashcurfont}}
9786 % On startup, @fixbackslash assigns:
9787 % @let \ = @normalbackslash
9789 % \rawbackslash defines an active \ to do \backslashcurfont.
9790 % \otherbackslash defines an active \ to be a literal `\' character with
9791 % catcode other.
9792 @gdef@rawbackslash{@let\=@backslashcurfont}
9793 @gdef@otherbackslash{@let\=@realbackslash}
9795 % Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
9796 % the literal character `\'.
9798 @def@normalturnoffactive{%
9799 @let"=@normaldoublequote
9800 @let$=@normaldollar %$ font-lock fix
9801 @let+=@normalplus
9802 @let<=@normalless
9803 @let>=@normalgreater
9804 @let\=@normalbackslash
9805 @let^=@normalcaret
9806 @let_=@normalunderscore
9807 @let|=@normalverticalbar
9808 @let~=@normaltilde
9809 @markupsetuplqdefault
9810 @markupsetuprqdefault
9811 @unsepspaces
9814 % Make _ and + \other characters, temporarily.
9815 % This is canceled by @fixbackslash.
9816 @otherifyactive
9818 % If a .fmt file is being used, we don't want the `\input texinfo' to show up.
9819 % That is what \eatinput is for; after that, the `\' should revert to printing
9820 % a backslash.
9822 @gdef@eatinput input texinfo{@fixbackslash}
9823 @global@let\ = @eatinput
9825 % On the other hand, perhaps the file did not have a `\input texinfo'. Then
9826 % the first `\' in the file would cause an error. This macro tries to fix
9827 % that, assuming it is called before the first `\' could plausibly occur.
9828 % Also turn back on active characters that might appear in the input
9829 % file name, in case not using a pre-dumped format.
9831 @gdef@fixbackslash{%
9832 @ifx\@eatinput @let\ = @normalbackslash @fi
9833 @catcode`+=@active
9834 @catcode`@_=@active
9837 % Say @foo, not \foo, in error messages.
9838 @escapechar = `@@
9840 % These (along with & and #) are made active for url-breaking, so need
9841 % active definitions as the normal characters.
9842 @def@normaldot{.}
9843 @def@normalquest{?}
9844 @def@normalslash{/}
9846 % These look ok in all fonts, so just make them not special.
9847 @catcode`@& = @other @def@normalamp{&}
9848 @catcode`@# = @other @def@normalhash{#}
9849 @catcode`@% = @other @def@normalpercent{%}
9851 @c Finally, make ` and ' active, so that txicodequoteundirected and
9852 @c txicodequotebacktick work right in, e.g., @w{@code{`foo'}}. If we
9853 @c don't make ` and ' active, @code will not get them as active chars.
9854 @c Do this last of all since we use ` in the previous @catcode assignments.
9855 @catcode`@'=@active
9856 @catcode`@`=@active
9857 @markupsetuplqdefault
9858 @markupsetuprqdefault
9860 @c Local variables:
9861 @c eval: (add-hook 'write-file-hooks 'time-stamp)
9862 @c page-delimiter: "^\\\\message"
9863 @c time-stamp-start: "def\\\\texinfoversion{"
9864 @c time-stamp-format: "%:y-%02m-%02d.%02H"
9865 @c time-stamp-end: "}"
9866 @c End:
9868 @c vim:sw=2:
9870 @ignore
9871 arch-tag: e1b36e32-c96e-4135-a41a-0b2efa2ea115
9872 @end ignore