1 % texinfo.tex -- TeX macros to handle Texinfo files.
3 % Load plain if necessary, i.e., if running under initex.
4 \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
6 \def\texinfoversion{2023-03-21.06}
8 % Copyright 1985, 1986, 1988, 1990-2023 Free Software Foundation, Inc.
10 % This texinfo.tex file is free software: you can redistribute it and/or
11 % modify it under the terms of the GNU General Public License as
12 % published by the Free Software Foundation, either version 3 of the
13 % License, or (at your option) any later version.
15 % This texinfo.tex file is distributed in the hope that it will be
16 % useful, but WITHOUT ANY WARRANTY; without even the implied warranty
17 % of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 % General Public License for more details.
20 % You should have received a copy of the GNU General Public License
21 % along with this program. If not, see <https://www.gnu.org/licenses/>.
23 % As a special exception, when this file is read by TeX when processing
24 % a Texinfo source document, you may use the result without
25 % restriction. This Exception is an additional permission under section 7
26 % of the GNU General Public License, version 3 ("GPLv3").
28 % Please try the latest version of texinfo.tex before submitting bug
29 % reports; you can get the latest version from:
30 % https://ftp.gnu.org/gnu/texinfo/ (the Texinfo release area), or
31 % https://ftpmirror.gnu.org/texinfo/ (same, via a mirror), or
32 % https://www.gnu.org/software/texinfo/ (the Texinfo home page)
33 % The texinfo.tex in any given distribution could well be out
34 % of date, so if that's what you're using, please check.
36 % Send bug reports to bug-texinfo@gnu.org. Please include a
37 % complete document in each bug report with which we can reproduce the
38 % problem. Patches are, of course, greatly appreciated.
40 % To process a Texinfo manual with TeX, it's most reliable to use the
41 % texi2dvi shell script that comes with the distribution. For a simple
42 % manual foo.texi, however, you can get away with this:
47 % dvips foo.dvi -o # or whatever; this makes foo.ps.
48 % The extra TeX runs get the cross-reference information correct.
49 % Sometimes one run after texindex suffices, and sometimes you need more
50 % than two; texi2dvi does it as many times as necessary.
52 % It is possible to adapt texinfo.tex for other languages, to some
53 % extent. You can get the existing language-specific files from the
54 % full Texinfo distribution.
56 % The GNU Texinfo home page is https://www.gnu.org/software/texinfo.
59 \message{Loading texinfo [version \texinfoversion]:}
61 % LaTeX's \typeout. This ensures that the messages it is used for
62 % are identical in format to the corresponding ones from latex/pdflatex.
63 \def\typeout{\immediate\write17}%
67 % We never want plain's \outer definition of \+ in Texinfo.
68 % For @tex, we can use \tabalign.
71 % Save some plain tex macros whose names we will redefine.
73 \let\ptexbullet=\bullet
81 \let\ptexfootnote=\footnote
85 \let\ptexindent=\indent
86 \let\ptexinsert=\insert
89 \let\ptexnewwrite\newwrite
90 \let\ptexnoindent=\noindent
92 \let\ptexraggedright=\raggedright
100 {\catcode`\'=\active \global\let\ptexquoteright'}% active in plain's math mode
102 % If this character appears in an error message or help string, it
103 % starts a new line in the output.
106 % Use TeX 3.0's \inputlineno to get the line number, for better error
107 % messages, but if we're using an old version of TeX, don't do anything.
109 \ifx\inputlineno\thisisundefined
110 \let\linenumber = \empty % Pre-3.0.
112 \def\linenumber{l.\the\inputlineno:\space}
115 % Set up fixed words for English if not already set.
116 \ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi
117 \ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi
118 \ifx\putworderror\undefined \gdef\putworderror{error}\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 % Give the space character the catcode for a space.
157 \def\spaceisspace{\catcode`\ =10\relax}
159 % Likewise for ^^M, the end of line character.
160 \def\endlineisspace{\catcode13=10\relax}
162 \chardef\dashChar = `\-
163 \chardef\slashChar = `\/
164 \chardef\underChar = `\_
170 % The following is used inside several \edef's.
171 \def\makecsname#1{\expandafter\noexpand\csname#1\endcsname}
175 Flor-i-da Ghost-script Ghost-view Mac-OS Post-Script
176 ap-pen-dix bit-map bit-maps
177 data-base data-bases eshell fall-ing half-way long-est man-u-script
178 man-u-scripts mini-buf-fer mini-buf-fers over-view par-a-digm
179 par-a-digms rath-er rec-tan-gu-lar ro-bot-ics se-vere-ly set-up spa-ces
181 stand-alone strong-est time-stamp time-stamps which-ever white-space
182 wide-spread wrap-around
185 % Sometimes it is convenient to have everything in the transcript file
186 % and nothing on the terminal. We don't just call \tracingall here,
187 % since that produces some useless output on the terminal. We also make
188 % some effort to order the tracing commands to reduce output in the log
189 % file; cf. trace.sty in LaTeX.
191 \def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%
195 \tracinglostchars2 % 2 gives us more in etex
200 \showboxbreadth\maxdimen \showboxdepth\maxdimen
201 \ifx\eTeXversion\thisisundefined\else % etex gives us more logging
208 \tracingcommands3 % 3 gives us more in etex
212 % @errormsg{MSG}. Do the index-like expansions on MSG, but if things
213 % aren't perfect, it's not the end of the world, being an error message,
216 \def\errormsg{\begingroup \indexnofonts \doerrormsg}
217 \def\doerrormsg#1{\errmessage{#1}}
219 % add check for \lastpenalty to plain's definitions. If the last thing
220 % we did was a \nobreak, we don't want to insert more space.
222 \def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount
223 \removelastskip\penalty-50\smallskip\fi\fi}
224 \def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount
225 \removelastskip\penalty-100\medskip\fi\fi}
226 \def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount
227 \removelastskip\penalty-200\bigskip\fi\fi}
232 % For a final copy, take out the rectangles
233 % that mark overfull boxes (in case you have decided
234 % that the text looks ok even though it passes the margin).
236 \def\finalout{\overfullrule=0pt }
238 % Output a mark which sets \thischapter, \thissection and \thiscolor.
239 % We dump everything together because we only have one kind of mark.
240 % This works because we only use \botmark / \topmark, not \firstmark.
242 % A mark contains a subexpression of the \ifcase ... \fi construct.
243 % \get*marks macros below extract the needed part using \ifcase.
245 % Another complication is to let the user choose whether \thischapter
246 % (\thissection) refers to the chapter (section) in effect at the top
247 % of a page, or that at the bottom of a page.
249 % \domark is called twice inside \chapmacro, to add one
250 % mark before the section break, and one after.
251 % In the second call \prevchapterdefs is the same as \currentchapterdefs,
252 % and \prevsectiondefs is the same as \currentsectiondefs.
253 % Then if the page is not broken at the mark, some of the previous
254 % section appears on the page, and we can get the name of this section
255 % from \firstmark for @everyheadingmarks top.
256 % @everyheadingmarks bottom uses \botmark.
258 % See page 260 of The TeXbook.
260 \toks0=\expandafter{\currentchapterdefs}%
261 \toks2=\expandafter{\currentsectiondefs}%
262 \toks4=\expandafter{\prevchapterdefs}%
263 \toks6=\expandafter{\prevsectiondefs}%
264 \toks8=\expandafter{\currentcolordefs}%
266 \the\toks0 \the\toks2 % 0: marks for @everyheadingmarks top
267 \noexpand\or \the\toks4 \the\toks6 % 1: for @everyheadingmarks bottom
268 \noexpand\else \the\toks8 % 2: color marks
272 % \gettopheadingmarks, \getbottomheadingmarks,
273 % \getcolormarks - extract needed part of mark.
275 % \topmark doesn't work for the very first chapter (after the title
276 % page or the contents), so we use \firstmark there -- this gets us
277 % the mark with the chapter defs, unless the user sneaks in, e.g.,
278 % @setcolor (or @url, or @link, etc.) between @contents and the very
280 \def\gettopheadingmarks{%
281 \ifcase0\the\savedtopmark\fi
282 \ifx\thischapter\empty \ifcase0\firstmark\fi \fi
284 \def\getbottomheadingmarks{\ifcase1\botmark\fi}
285 \def\getcolormarks{\ifcase2\the\savedtopmark\fi}
287 % Avoid "undefined control sequence" errors.
288 \def\currentchapterdefs{}
289 \def\currentsectiondefs{}
290 \def\currentsection{}
291 \def\prevchapterdefs{}
292 \def\prevsectiondefs{}
293 \def\currentcolordefs{}
295 % Margin to add to right of even pages, to left of odd pages.
296 \newdimen\bindingoffset
297 \newdimen\normaloffset
298 \newdimen\txipagewidth \newdimen\txipageheight
300 % Main output routine.
303 \newtoks\defaultoutput
304 \defaultoutput = {\savetopmark\onepageout{\pagecontents\PAGE}}
305 \output=\expandafter{\the\defaultoutput}
310 % When outputting the double column layout for indices, an output routine
311 % is run several times, hiding the original value of \topmark. Hence, save
312 % \topmark at the beginning.
314 \newtoks\savedtopmark
315 \newif\iftopmarksaved
319 \global\savedtopmark=\expandafter{\topmark}%
320 \global\topmarksavedtrue
324 % \onepageout takes a vbox as an argument.
325 % \shipout a vbox for a single page, adding an optional header, footer
326 % and footnote. This also causes index entries for this page to be written
327 % to the auxiliary files.
330 \hoffset=\normaloffset
332 \ifodd\pageno \advance\hoffset by \bindingoffset
333 \else \advance\hoffset by -\bindingoffset\fi
337 % Make the heading and footing. \makeheadline and \makefootline
338 % use the contents of \headline and \footline.
339 \def\commonheadfootline{\let\hsize=\txipagewidth \texinfochars}
340 \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi
341 \global\setbox\headlinebox = \vbox{\commonheadfootline \makeheadline}%
342 \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi
343 \global\setbox\footlinebox = \vbox{\commonheadfootline \makefootline}%
346 % Set context for writing to auxiliary files like index files.
347 % Have to do this stuff outside the \shipout because we want it to
348 % take effect in \write's, yet the group defined by the \vbox ends
349 % before the \shipout runs.
351 \atdummies % don't expand commands in the output.
354 % Do this early so pdf references go to the beginning of the page.
355 \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi
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.
369 \global\topmarksavedfalse
371 \ifnum\outputpenalty>-20000 \else\dosupereject\fi
374 \newinsert\margin \dimen\margin=\maxdimen
376 % Main part of page, including any footnotes
377 \def\pagebody#1{\vbox to\txipageheight{\boxmaxdepth=\maxdepth #1}}
379 \gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
380 % marginal hacks, juha@viisa.uucp (Juha Takala)
381 \ifvoid\margin\else % marginal info is present
382 \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi
383 \dimen@=\dp#1\relax \unvbox#1\relax
384 \ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
385 \ifr@ggedbottom \kern-\dimen@ \vfil \fi}
388 % Check if we are on the first page of a chapter. Used for printing headings.
390 \def\checkchapterpage{%
391 % Get the chapter that was current at the end of the last page
392 \ifcase1\the\savedtopmark\fi
393 \let\prevchaptername\thischaptername
395 \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi
396 \let\curchaptername\thischaptername
398 \ifx\curchaptername\prevchaptername
407 % Parse an argument, then pass it to #1. The argument is the rest of
408 % the input line (except we remove a trailing comment). #1 should be a
409 % macro which expects an ordinary undelimited TeX argument.
410 % For example, \def\foo{\parsearg\fooxxx}.
412 \def\parsearg{\parseargusing{}}
413 \def\parseargusing#1#2{%
419 \parseargline\empty% Insert the \empty token, see \finishparsearg below.
423 \gdef\parseargline#1^^M{%
424 \endgroup % End of the group started in \parsearg.
425 \argremovecomment #1\comment\ArgTerm%
429 % First remove any @comment, then any @c comment. Pass the result on to
431 \def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm}
432 \def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm}
434 % Each occurrence of `\^^M' or `<space>\^^M' is replaced by a single space.
436 % \argremovec might leave us with trailing space, e.g.,
437 % @end itemize @c foo
438 % This space token undergoes the same procedure and is eventually removed
439 % by \finishparsearg.
441 \def\argcheckspaces#1\^^M{\argcheckspacesX#1\^^M \^^M}
442 \def\argcheckspacesX#1 \^^M{\argcheckspacesY#1\^^M}
443 \def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{%
446 % Do not use \next, perhaps the caller of \parsearg uses it; reuse \temp:
447 \let\temp\finishparsearg
449 \let\temp\argcheckspaces
451 % Put the space token in:
455 % If a _delimited_ argument is enclosed in braces, they get stripped; so
456 % to get _exactly_ the rest of the line, we had to prevent such situation.
457 % We prepended an \empty token at the very beginning and we expand it now,
458 % just before passing the control to \argtorun.
459 % (Similarly, we have to think about #3 of \argcheckspacesY above: it is
460 % either the null string, or it ends with \^^M---thus there is no danger
461 % that a pair of braces would be stripped.
463 % But first, we have to remove the trailing space token.
465 \def\finishparsearg#1 \ArgTerm{\expandafter\argtorun\expandafter{#1}}
468 % \parseargdef - define a command taking an argument on the line
470 % \parseargdef\foo{...}
471 % is roughly equivalent to
472 % \def\foo{\parsearg\Xfoo}
475 \expandafter \doparseargdef \csname\string#1\endcsname #1%
477 \def\doparseargdef#1#2{%
482 % Several utility definitions with active space:
487 % Make each space character in the input produce a normal interword
488 % space in the output. Don't allow a line break at this space, as this
489 % is used only in environments like @example, where each line of input
490 % should produce a line of output anyway.
492 \gdef\sepspaces{\obeyspaces\let =\tie}
494 % If an index command is used in an @example environment, any spaces
495 % therein should become regular spaces in the raw index file, not the
496 % expansion of \tie (\leavevmode \penalty \@M \ ).
497 \gdef\unsepspaces{\let =\space}
501 \def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}
503 % Define the framework for environments in texinfo.tex. It's used like this:
508 % It's the responsibility of \envdef to insert \begingroup before the
509 % actual body; @end closes the group after calling \Efoo. \envdef also
510 % defines \thisenv, so the current environment is known; @end checks
511 % whether the environment name matches. The \checkenv macro can also be
512 % used to check whether the current environment is the one expected.
514 % Non-false conditionals (@iftex, @ifset) don't fit into this, so they
515 % are not treated as environments; they don't open a group. (The
516 % implementation of @end takes care not to call \endgroup in this
520 % At run-time, environments start with this:
521 \def\startenvironment#1{\begingroup\def\thisenv{#1}}
525 % ... but they get defined via ``\envdef\foo{...}'':
526 \long\def\envdef#1#2{\def#1{\startenvironment#1#2}}
527 \long\def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}}
529 % Check whether we're in the right environment:
538 % Environment mismatch, #1 expected:
541 \errmessage{This command can appear only \inenvironment\temp,
542 not \inenvironment\thisenv}%
544 \def\inenvironment#1{%
546 outside of any environment%
548 in environment \expandafter\string#1%
553 % @end foo calls \checkenv and executes the definition of \Efoo.
555 \if 1\csname iscond.#1\endcsname
557 % The general wording of \badenverr may not be ideal.
558 \expandafter\checkenv\csname#1\endcsname
559 \csname E#1\endcsname
564 \newhelp\EMsimple{Press RETURN to continue.}
567 % Be sure we're in horizontal mode when doing a tie, since we make space
568 % equivalent to this in @example-like environments. Otherwise, a space
569 % at the beginning of a line will start with \penalty -- and
570 % since \penalty is valid in vertical mode, we'd end up putting the
571 % penalty on the vertical list instead of in the new paragraph.
573 % Avoid using \@M directly, because that causes trouble
574 % if the definition is written into an index file.
575 \global\let\tiepenalty = \@M
576 \gdef\tie{\leavevmode\penalty\tiepenalty\ }
579 % @: forces normal size whitespace following.
580 \def\:{\spacefactor=1000 }
582 % @* forces a line break.
583 \def\*{\unskip\hfil\break\hbox{}\ignorespaces}
585 % @/ allows a line break.
588 % @- allows explicit insertion of hyphenation points
589 \def\-{\discretionary{\normaldash}{}{}}%
591 % @. is an end-of-sentence period.
592 \def\.{.\spacefactor=\endofsentencespacefactor\space}
594 % @! is an end-of-sentence bang.
595 \def\!{!\spacefactor=\endofsentencespacefactor\space}
597 % @? is an end-of-sentence query.
598 \def\?{?\spacefactor=\endofsentencespacefactor\space}
600 % @w prevents a word break. Without the \leavevmode, @w at the
601 % beginning of a paragraph, when TeX is still in vertical mode, would
602 % produce a whole line of output instead of starting the paragraph.
603 \def\w#1{\leavevmode\hbox{#1}}
605 % @group ... @end group forces ... to be all on one page, by enclosing
606 % it in a TeX vbox. We use \vtop instead of \vbox to construct the box
607 % to keep its height that of a normal line. According to the rules for
608 % \topskip (p.114 of the TeXbook), the glue inserted is
609 % max (\topskip - \ht (first item), 0). If that height is large,
610 % therefore, no glue is inserted, and the space between the headline and
611 % the text is small, which looks bad.
613 % Another complication is that the group might be very large. This can
614 % cause the glue on the previous page to be unduly stretched, because it
615 % does not have much material. In this case, it's better to add an
616 % explicit \vfill so that the extra space is at the bottom. The
617 % threshold for doing this is if the group is more than \vfilllimit
618 % percent of a page (\vfilllimit can be changed inside of @tex).
624 \ifnum\catcode`\^^M=\active \else
625 \errhelp = \groupinvalidhelp
626 \errmessage{@group invalid in context where filling is enabled}%
630 \setbox\groupbox = \vtop\bgroup
631 % Do @comment since we are called inside an environment such as
632 % @example, where each end-of-line in the input causes an
633 % end-of-line in the output. We don't want the end-of-line after
634 % the `@group' to put extra space in the output. Since @group
635 % should appear on a line by itself (according to the Texinfo
636 % manual), we don't worry about eating any user text.
640 % The \vtop produces a box with normal height and large depth; thus, TeX puts
641 % \baselineskip glue before it, and (when the next line of text is done)
642 % \lineskip glue after it. Thus, space below is not quite equal to space
643 % above. But it's pretty close.
645 % To get correct interline space between the last line of the group
646 % and the first line afterwards, we have to propagate \prevdepth.
647 \endgraf % Not \par, as it may have been set to \lisppar.
648 \global\dimen1 = \prevdepth
649 \egroup % End the \vtop.
656 % \dimen0 is the vertical size of the group's box.
657 \dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox
658 % \dimen2 is how much space is left on the page (more or less).
659 \dimen2 = \txipageheight \advance\dimen2 by -\pagetotal
660 % if the group doesn't fit on the current page, and it's a big big
661 % group, force a page break.
662 \ifdim \dimen0 > \dimen2
663 \ifdim \pagetotal < \vfilllimit\txipageheight
671 % TeX puts in an \escapechar (i.e., `@') at the beginning of the help
672 % message, so this ends up printing `@group can only ...'.
674 \newhelp\groupinvalidhelp{%
675 group can only be used in environments such as @example,^^J%
676 where each line of input produces a line of output.}
678 % @need space-in-mils
679 % forces a page break if there is not space-in-mils remaining.
681 \newdimen\mil \mil=0.001in
684 % Ensure vertical mode, so we don't make a big box in the middle of a
688 % If the @need value is less than one line space, it's useless.
690 \dimen2 = \ht\strutbox
691 \advance\dimen2 by \dp\strutbox
692 \ifdim\dimen0 > \dimen2
693 % This is similar to the 'needspace' module in LaTeX.
694 % The first penalty allows a break if the end of the page is
695 % not too far away. Following penalties and skips are discarded.
696 % Otherwise, require at least \dimen0 of vertical space.
698 % (We used to use a \vtop to reserve space, but this had spacing issues
699 % when followed by a section heading, as it was not a "discardable item".
700 % This also has the benefit of providing glue before the page break if
701 % there isn't enough space.)
702 \vskip0pt plus \dimen0
704 \vskip0pt plus -\dimen0
708 \penalty0\relax % this hides the above glue from \safewhatsit and \dobreak
712 % @br forces paragraph break (and is undocumented).
716 % @page forces the start of a new page.
718 \def\page{\par\vfill\supereject}
721 % outputs text on separate line in roman font, starting at standard page margin
723 % This records the amount of indent in the innermost environment.
724 % That's how much \exdent should take out.
725 \newskip\exdentamount
727 % This defn is used inside fill environments such as @defun.
728 \parseargdef\exdent{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}
730 % This defn is used inside nofill environments such as @example.
731 \parseargdef\nofillexdent{{\advance \leftskip by -\exdentamount
732 \leftline{\hskip\leftskip{\rm#1}}}}
734 % @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current
735 % paragraph. For more general purposes, use the \margin insertion
736 % class. WHICH is `l' or `r'. Not documented, written for gawk manual.
738 \newskip\inmarginspacing \inmarginspacing=1cm
739 \def\strutdepth{\dp\strutbox}
741 \def\doinmargin#1#2{\strut\vadjust{%
744 \vtop to \strutdepth{%
745 \baselineskip=\strutdepth
747 % if you have multiple lines of stuff to put here, you'll need to
748 % make the vbox yourself of the appropriate size.
750 \llap{\ignorespaces #2\hskip\inmarginspacing}%
752 \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}%
757 \def\inleftmargin{\doinmargin l}
758 \def\inrightmargin{\doinmargin r}
760 % @inmargin{TEXT [, RIGHT-TEXT]}
761 % (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right;
762 % else use TEXT for both).
764 \def\inmargin#1{\parseinmargin #1,,\finish}
765 \def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing.
766 \setbox0 = \hbox{\ignorespaces #2}%
768 \def\lefttext{#1}% have both texts
771 \def\lefttext{#1}% have only one text
776 \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin
778 \def\temp{\inleftmargin\lefttext}%
783 % @include FILE -- \input text of FILE.
785 \def\include{\parseargusing\filenamecatcodes\includezzz}
790 \makevalueexpandable % we want to expand any @value in FILE.
791 \turnoffactive % and allow special characters in the expansion
792 \indexnofonts % Allow `@@' and other weird things in file names.
793 \wlog{texinfo.tex: doing @include of #1^^J}%
794 \edef\temp{\noexpand\input #1 }%
796 % This trickery is to read FILE outside of a group, in case it makes
802 \def\filenamecatcodes{%
816 \def\pushthisfilestack{%
817 \expandafter\pushthisfilestackX\popthisfilestack\StackTerm
819 \def\pushthisfilestackX{%
820 \expandafter\pushthisfilestackY\thisfile\StackTerm
822 \def\pushthisfilestackY #1\StackTerm #2\StackTerm {%
823 \gdef\popthisfilestack{\gdef\thisfile{#1}\gdef\popthisfilestack{#2}}%
826 \def\popthisfilestack{\errthisfilestackempty}
827 \def\errthisfilestackempty{\errmessage{Internal error:
828 the stack of filenames is empty.}}
833 % outputs that line, centered.
835 \parseargdef\center{%
837 \let\centersub\centerH
839 \let\centersub\centerV
841 \centersub{\hfil \ignorespaces#1\unskip \hfil}%
842 \let\centersub\relax % don't let the definition persist, just in case
846 \advance\hsize by -\leftskip
847 \advance\hsize by -\rightskip
852 \newcount\centerpenalty
854 % The idea here is the same as in \startdefun, \cartouche, etc.: if
855 % @center is the first thing after a section heading, we need to wipe
856 % out the negative parskip inserted by \sectionheading, but still
857 % prevent a page break here.
858 \centerpenalty = \lastpenalty
859 \ifnum\centerpenalty>10000 \vskip\parskip \fi
860 \ifnum\centerpenalty>9999 \penalty\centerpenalty \fi
861 \line{\kern\leftskip #1\kern\rightskip}%
864 % @sp n outputs n lines of vertical space
866 \parseargdef\sp{\vskip #1\baselineskip}
868 % @comment ...line which is ignored...
869 % @c is the same as @comment
870 % @ignore ... @end ignore is another way to write a comment
873 \def\c{\begingroup \catcode`\^^M=\active%
874 \catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%
876 {\catcode`\^^M=\active \gdef\cxxx#1^^M{\endgroup}}
880 % @paragraphindent NCHARS
881 % We'll use ems for NCHARS, close enough.
882 % NCHARS can also be the word `asis' or `none'.
883 % We cannot feasibly implement @paragraphindent asis, though.
885 \def\asisword{asis} % no translation, these are keywords
888 \parseargdef\paragraphindent{%
893 \defaultparindent = 0pt
895 \defaultparindent = #1em
898 \parindent = \defaultparindent
901 % @exampleindent NCHARS
902 % We'll use ems for NCHARS like @paragraphindent.
903 % It seems @exampleindent asis isn't necessary, but
904 % I preserve it to make it similar to @paragraphindent.
905 \parseargdef\exampleindent{%
912 \lispnarrowing = #1em
917 % @firstparagraphindent WORD
918 % If WORD is `none', then suppress indentation of the first paragraph
919 % after a section heading. If WORD is `insert', then do indent at such
922 % The paragraph indentation is suppressed or not by calling
923 % \suppressfirstparagraphindent, which the sectioning commands do.
924 % We switch the definition of this back and forth according to WORD.
925 % By default, we suppress indentation.
927 \def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent}
928 \def\insertword{insert}
930 \parseargdef\firstparagraphindent{%
933 \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent
934 \else\ifx\temp\insertword
935 \let\suppressfirstparagraphindent = \relax
938 \errmessage{Unknown @firstparagraphindent option `\temp'}%
942 % Here is how we actually suppress indentation. Redefine \everypar to
943 % \kern backwards by \parindent, and then reset itself to empty.
945 % We also make \indent itself not actually do anything until the next
948 \gdef\dosuppressfirstparagraphindent{%
949 \gdef\indent {\restorefirstparagraphindent \indent}%
950 \gdef\noindent{\restorefirstparagraphindent \noindent}%
951 \global\everypar = {\kern -\parindent \restorefirstparagraphindent}%
954 \gdef\restorefirstparagraphindent{%
955 \global\let\indent = \ptexindent
956 \global\let\noindent = \ptexnoindent
957 \global\everypar = {}%
960 % leave vertical mode without cancelling any first paragraph indent
965 \global\everypar=\toks0
969 % @refill is a no-op.
972 % @setfilename INFO-FILENAME - ignored
973 \let\setfilename=\comment
976 \outer\def\bye{\chappager\pagelabels\tracingstats=1\ptexend}
980 % adobe `portable' document format
984 \newcount\filenamelength
994 \newif\ifpdfmakepagedest
1000 \newif\iftxiuseunicodedestname
1001 \txiuseunicodedestnamefalse % For pdfTeX etc.
1003 \ifx\luatexversion\thisisundefined
1005 % Use Unicode destination names
1006 \txiuseunicodedestnametrue
1007 % Escape PDF strings with converting UTF-16 from UTF-8
1011 function UTF16oct(str)
1012 tex.sprint(string.char(0x5c) .. '376' .. string.char(0x5c) .. '377')
1013 for c in string.utfvalues(str) do
1016 string.format(string.char(0x5c) .. string.char(0x25) .. '03o' ..
1017 string.char(0x5c) .. string.char(0x25) .. '03o',
1018 math.floor(c / 256), math.floor(c % 256)))
1021 local c_hi = c / 1024 + 0xd800
1022 local c_lo = c % 1024 + 0xdc00
1024 string.format(string.char(0x5c) .. string.char(0x25) .. '03o' ..
1025 string.char(0x5c) .. string.char(0x25) .. '03o' ..
1026 string.char(0x5c) .. string.char(0x25) .. '03o' ..
1027 string.char(0x5c) .. string.char(0x25) .. '03o',
1028 math.floor(c_hi / 256), math.floor(c_hi % 256),
1029 math.floor(c_lo / 256), math.floor(c_lo % 256)))
1035 \def\pdfescapestrutfsixteen#1{\directlua{UTF16oct('\luaescapestring{#1}')}}
1036 % Escape PDF strings without converting
1039 function PDFescstr(str)
1040 for c in string.bytes(str) do
1041 if c <= 0x20 or c >= 0x80 or c == 0x28 or c == 0x29 or c == 0x5c then
1043 string.format(string.char(0x5c) .. string.char(0x25) .. '03o',
1046 tex.sprint(-2, string.char(c))
1051 % The -2 in the arguments here gives all the input to TeX catcode 12
1052 % (other) or 10 (space), preventing undefined control sequence errors. See
1053 % https://lists.gnu.org/archive/html/bug-texinfo/2019-08/msg00031.html
1056 \def\pdfescapestring#1{\directlua{PDFescstr('\luaescapestring{#1}')}}
1057 \ifnum\luatexversion>84
1058 % For LuaTeX >= 0.85
1059 \def\pdfdest{\pdfextension dest}
1060 \let\pdfoutput\outputmode
1061 \def\pdfliteral{\pdfextension literal}
1062 \def\pdfcatalog{\pdfextension catalog}
1063 \def\pdftexversion{\numexpr\pdffeedback version\relax}
1064 \let\pdfximage\saveimageresource
1065 \let\pdfrefximage\useimageresource
1066 \let\pdflastximage\lastsavedimageresourceindex
1067 \def\pdfendlink{\pdfextension endlink\relax}
1068 \def\pdfoutline{\pdfextension outline}
1069 \def\pdfstartlink{\pdfextension startlink}
1070 \def\pdffontattr{\pdfextension fontattr}
1071 \def\pdfobj{\pdfextension obj}
1072 \def\pdflastobj{\numexpr\pdffeedback lastobj\relax}
1073 \let\pdfpagewidth\pagewidth
1074 \let\pdfpageheight\pageheight
1075 \edef\pdfhorigin{\pdfvariable horigin}
1076 \edef\pdfvorigin{\pdfvariable vorigin}
1080 % when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1
1081 % can be set). So we test for \relax and 0 as well as being undefined.
1082 \ifx\pdfoutput\thisisundefined
1084 \ifx\pdfoutput\relax
1098 \ifx\XeTeXrevision\thisisundefined\else
1103 % Output page labels information.
1104 % See PDF reference v.1.7 p.594, section 8.3.1.
1107 \def\title{0 << /P (T-) /S /D >>}%
1108 \edef\roman{\the\romancount << /S /r >>}%
1109 \edef\arabic{\the\arabiccount << /S /D >>}%
1111 % Page label ranges must be increasing. Remove any duplicates.
1112 % (There is a slight chance of this being wrong if e.g. there is
1113 % a @contents but no @titlepage, etc.)
1115 \ifnum\romancount=0 \def\roman{}\fi
1116 \ifnum\arabiccount=0 \def\title{}%
1118 \ifnum\romancount=\arabiccount \def\roman{}\fi
1121 \ifnum\romancount<\arabiccount
1122 \pdfcatalog{/PageLabels << /Nums [\title \roman \arabic ] >> }\relax
1124 \pdfcatalog{/PageLabels << /Nums [\title \arabic \roman ] >> }\relax
1128 \let\pagelabels\relax
1131 \newcount\pagecount \pagecount=0
1132 \newcount\romancount \romancount=0
1133 \newcount\arabiccount \arabiccount=0
1135 \let\ptxadvancepageno\advancepageno
1136 \def\advancepageno{%
1137 \ptxadvancepageno\global\advance\pagecount by 1
1142 % PDF uses PostScript string constants for the names of xref targets,
1143 % for display in the outlines, and in other places. Thus, we have to
1144 % double any backslashes. Otherwise, a name like "\node" will be
1145 % interpreted as a newline (\n), followed by o, d, e. Not good.
1147 % See http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html and
1148 % related messages. The final outcome is that it is up to the TeX user
1149 % to double the backslashes and otherwise make the string valid, so
1150 % that's what we do. pdftex 1.30.0 (ca.2005) introduced a primitive to
1151 % do this reliably, so we use it.
1153 % #1 is a control sequence in which to do the replacements,
1155 \def\txiescapepdf#1{%
1156 \ifx\pdfescapestring\thisisundefined
1157 % No primitive available; should we give a warning or log?
1158 % Many times it won't matter.
1161 % The expandable \pdfescapestring primitive escapes parentheses,
1162 % backslashes, and other special chars.
1163 \xdef#1{\pdfescapestring{#1}}%
1166 \def\txiescapepdfutfsixteen#1{%
1167 \ifx\pdfescapestrutfsixteen\thisisundefined
1168 % No UTF-16 converting macro available.
1171 \xdef#1{\pdfescapestrutfsixteen{#1}}%
1175 \newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images
1176 with PDF output, and none of those formats could be found. (.eps cannot
1177 be supported due to the design of the PDF format; use regular TeX (DVI
1182 % Color manipulation macros using ideas from pdfcolor.tex,
1183 % except using rgb instead of cmyk; the latter is said to render as a
1184 % very dark gray on-screen and a very dark halftone in print, instead
1185 % of actual black. The dark red here is dark enough to print on paper as
1186 % nearly black, but still distinguishable for online viewing. We use
1187 % black by default, though.
1188 \def\rgbDarkRed{0.50 0.09 0.12}
1189 \def\rgbBlack{0 0 0}
1191 % rg sets the color for filling (usual text, etc.);
1192 % RG sets the color for stroking (thin rules, e.g., normal _'s).
1193 \def\pdfsetcolor#1{\pdfliteral{#1 rg #1 RG}}
1195 % Set color, and create a mark which defines \thiscolor accordingly,
1196 % so that \makeheadline knows which color to restore.
1197 \def\curcolor{0 0 0}%
1199 \ifx#1\curcolor\else
1200 \xdef\currentcolordefs{\gdef\noexpand\thiscolor{#1}}%
1207 \let\maincolor\rgbBlack
1208 \pdfsetcolor{\maincolor}
1209 \edef\thiscolor{\maincolor}
1210 \def\currentcolordefs{}
1214 \line{\pdfsetcolor{\maincolor}\the\footline}%
1222 % Extract \thiscolor definition from the marks.
1224 % Typeset the headline with \maincolor, then restore the color.
1225 \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}%
1233 \pdfcatalog{/PageMode /UseOutlines}
1235 % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto).
1236 \def\dopdfimage#1#2#3{%
1237 \def\pdfimagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}%
1238 \def\pdfimageheight{#3}\setbox2 = \hbox{\ignorespaces #3}%
1240 % pdftex (and the PDF format) support .pdf, .png, .jpg (among
1241 % others). Let's try in that order, PDF first since if
1242 % someone has a scalable image, presumably better to use that than a
1244 \let\pdfimgext=\empty
1246 \openin 1 #1.pdf \ifeof 1
1247 \openin 1 #1.PDF \ifeof 1
1248 \openin 1 #1.png \ifeof 1
1249 \openin 1 #1.jpg \ifeof 1
1250 \openin 1 #1.jpeg \ifeof 1
1251 \openin 1 #1.JPG \ifeof 1
1252 \errhelp = \nopdfimagehelp
1253 \errmessage{Could not find image file #1 for pdf}%
1254 \else \gdef\pdfimgext{JPG}%
1256 \else \gdef\pdfimgext{jpeg}%
1258 \else \gdef\pdfimgext{jpg}%
1260 \else \gdef\pdfimgext{png}%
1262 \else \gdef\pdfimgext{PDF}%
1264 \else \gdef\pdfimgext{pdf}%
1269 % without \immediate, ancient pdftex seg faults when the same image is
1270 % included twice. (Version 3.14159-pre-1.0-unofficial-20010704.)
1271 \ifnum\pdftexversion < 14
1274 \immediate\pdfximage
1276 \ifdim \wd0 >0pt width \pdfimagewidth \fi
1277 \ifdim \wd2 >0pt height \pdfimageheight \fi
1278 \ifnum\pdftexversion<13
1283 \ifnum\pdftexversion < 14 \else
1284 \pdfrefximage \pdflastximage
1287 \def\setpdfdestname#1{{%
1288 % We have to set dummies so commands such as @code, and characters
1289 % such as \, aren't expanded when present in a section title.
1291 \makevalueexpandable
1293 \iftxiuseunicodedestname
1294 \ifx \declaredencoding \latone
1295 % Pass through Latin-1 characters.
1296 % LuaTeX with byte wise I/O converts Latin-1 characters to Unicode.
1298 \ifx \declaredencoding \utfeight
1299 % Pass through Unicode characters.
1301 % Use ASCII approximations in destination names.
1302 \passthroughcharsfalse
1306 % Use ASCII approximations in destination names.
1307 \passthroughcharsfalse
1309 \def\pdfdestname{#1}%
1310 \txiescapepdf\pdfdestname
1313 \def\setpdfoutlinetext#1{{%
1315 \makevalueexpandable
1317 \ifx \declaredencoding \latone
1318 % The PDF format can use an extended form of Latin-1 in bookmark
1319 % strings. See Appendix D of the PDF Reference, Sixth Edition, for
1320 % the "PDFDocEncoding".
1321 \passthroughcharstrue
1322 % Pass through Latin-1 characters.
1323 % LuaTeX: Convert to Unicode
1324 % pdfTeX: Use Latin-1 as PDFDocEncoding
1325 \def\pdfoutlinetext{#1}%
1327 \ifx \declaredencoding \utfeight
1328 \ifx\luatexversion\thisisundefined
1329 % For pdfTeX with UTF-8.
1330 % TODO: the PDF format can use UTF-16 in bookmark strings,
1331 % but the code for this isn't done yet.
1332 % Use ASCII approximations.
1333 \passthroughcharsfalse
1334 \def\pdfoutlinetext{#1}%
1336 % For LuaTeX with UTF-8.
1337 % Pass through Unicode characters for title texts.
1338 \passthroughcharstrue
1339 \def\pdfoutlinetext{#1}%
1342 % For non-Latin-1 or non-UTF-8 encodings.
1343 % Use ASCII approximations.
1344 \passthroughcharsfalse
1345 \def\pdfoutlinetext{#1}%
1348 % LuaTeX: Convert to UTF-16
1349 % pdfTeX: Use Latin-1 as PDFDocEncoding
1350 \txiescapepdfutfsixteen\pdfoutlinetext
1354 \setpdfdestname{#1}%
1355 \safewhatsit{\pdfdest name{\pdfdestname} xyz}%
1358 % used to mark target names; must be expandable.
1361 % by default, use black for everything.
1362 \def\urlcolor{\rgbBlack}
1363 \let\linkcolor\rgbBlack
1364 \def\endlink{\setcolor{\maincolor}\pdfendlink}
1366 % Adding outlines to PDF; macros for calculating structure of outlines
1367 % come from Petr Olsak
1368 \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0%
1369 \else \csname#1\endcsname \fi}
1370 \def\advancenumber#1{\tempnum=\expnumber{#1}\relax
1371 \advance\tempnum by 1
1372 \expandafter\xdef\csname#1\endcsname{\the\tempnum}}
1374 % #1 is the section text, which is what will be displayed in the
1375 % outline by the pdf viewer. #2 is the pdf expression for the number
1376 % of subentries (or empty, for subsubsections). #3 is the node text,
1377 % which might be empty if this toc entry had no corresponding node.
1378 % #4 is the page number
1380 \def\dopdfoutline#1#2#3#4{%
1381 % Generate a link to the node text if that exists; else, use the
1382 % page number. We could generate a destination for the section
1383 % text in the case where a section has no node, but it doesn't
1384 % seem worth the trouble, since most documents are normally structured.
1385 \setpdfoutlinetext{#1}
1387 \ifx\pdfdestname\empty
1388 \def\pdfdestname{#4}%
1391 \pdfoutline goto name{\pdfmkpgn{\pdfdestname}}#2{\pdfoutlinetext}%
1394 \def\pdfmakeoutlines{%
1396 % Read toc silently, to get counts of subentries for \pdfoutline.
1397 \def\partentry##1##2##3##4{}% ignore parts in the outlines
1398 \def\numchapentry##1##2##3##4{%
1399 \def\thischapnum{##2}%
1401 \def\thissubsecnum{0}%
1403 \def\numsecentry##1##2##3##4{%
1404 \advancenumber{chap\thischapnum}%
1405 \def\thissecnum{##2}%
1406 \def\thissubsecnum{0}%
1408 \def\numsubsecentry##1##2##3##4{%
1409 \advancenumber{sec\thissecnum}%
1410 \def\thissubsecnum{##2}%
1412 \def\numsubsubsecentry##1##2##3##4{%
1413 \advancenumber{subsec\thissubsecnum}%
1415 \def\thischapnum{0}%
1417 \def\thissubsecnum{0}%
1419 % use \def rather than \let here because we redefine \chapentry et
1420 % al. a second time, below.
1421 \def\appentry{\numchapentry}%
1422 \def\appsecentry{\numsecentry}%
1423 \def\appsubsecentry{\numsubsecentry}%
1424 \def\appsubsubsecentry{\numsubsubsecentry}%
1425 \def\unnchapentry{\numchapentry}%
1426 \def\unnsecentry{\numsecentry}%
1427 \def\unnsubsecentry{\numsubsecentry}%
1428 \def\unnsubsubsecentry{\numsubsubsecentry}%
1431 % Read toc second time, this time actually producing the outlines.
1432 % The `-' means take the \expnumber as the absolute number of
1433 % subentries, which we calculated on our first read of the .toc above.
1435 % We use the node names as the destinations.
1437 % Currently we prefix the section name with the section number
1438 % for chapter and appendix headings only in order to avoid too much
1439 % horizontal space being required in the PDF viewer.
1440 \def\numchapentry##1##2##3##4{%
1441 \dopdfoutline{##2 ##1}{count-\expnumber{chap##2}}{##3}{##4}}%
1442 \def\unnchapentry##1##2##3##4{%
1443 \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}%
1444 \def\numsecentry##1##2##3##4{%
1445 \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}%
1446 \def\numsubsecentry##1##2##3##4{%
1447 \dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}%
1448 \def\numsubsubsecentry##1##2##3##4{% count is always zero
1449 \dopdfoutline{##1}{}{##3}{##4}}%
1451 % PDF outlines are displayed using system fonts, instead of
1452 % document fonts. Therefore we cannot use special characters,
1453 % since the encoding is unknown. For example, the eogonek from
1454 % Latin 2 (0xea) gets translated to a | character. Info from
1455 % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100.
1457 % TODO this right, we have to translate 8-bit characters to
1458 % their "best" equivalent, based on the @documentencoding. Too
1459 % much work for too little return. Just use the ASCII equivalents
1460 % we use for the index sort strings.
1464 % We can have normal brace characters in the PDF outlines, unlike
1465 % Texinfo index files. So set that up.
1466 \def\{{\lbracecharliteral}%
1467 \def\}{\rbracecharliteral}%
1468 \catcode`\\=\active \otherbackslash
1469 \input \tocreadfilename
1472 {\catcode`[=1 \catcode`]=2
1473 \catcode`{=\other \catcode`}=\other
1474 \gdef\lbracecharliteral[{]%
1475 \gdef\rbracecharliteral[}]%
1478 \def\skipspaces#1{\def\PP{#1}\def\D{|}%
1479 \ifx\PP\D\let\nextsp\relax
1480 \else\let\nextsp\skipspaces
1481 \addtokens{\filename}{\PP}%
1482 \advance\filenamelength by 1
1485 \def\getfilename#1{%
1487 % If we don't expand the argument now, \skipspaces will get
1488 % snagged on things like "@value{foo}".
1490 \expandafter\skipspaces\temp|\relax
1492 \ifnum\pdftexversion < 14
1493 \let \startlink \pdfannotlink
1495 \let \startlink \pdfstartlink
1497 % make a live url in pdf output.
1500 % it seems we really need yet another set of dummies; have not
1501 % tried to figure out what each command should do in the context
1502 % of @url. for now, just make @/ a no-op, that's the only one
1503 % people have actually reported a problem with.
1505 \normalturnoffactive
1508 \makevalueexpandable
1509 % do we want to go so far as to use \indexnofonts instead of just
1510 % special-casing \var here?
1513 \leavevmode\setcolor{\urlcolor}%
1514 \startlink attr{/Border [0 0 0]}%
1515 user{/Subtype /Link /A << /S /URI /URI (#1) >>}%
1517 % \pdfgettoks - Surround page numbers in #1 with @pdflink. #1 may
1518 % be a simple number, or a list of numbers in the case of an index
1520 \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}}
1521 \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
1522 \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks}
1523 \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}}
1525 \expandafter\poptoks\the\toksA|ENDTOKS|\relax
1527 \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3
1528 \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6
1529 \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9
1531 \ifnum0=\countA\else\makelink\fi
1532 \ifx\first.\let\next=\done\else
1534 \addtokens{\toksB}{\the\toksD}
1535 \ifx\first,\addtokens{\toksB}{\space}\fi
1537 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
1539 \def\makelink{\addtokens{\toksB}%
1540 {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0}
1541 \def\pdflink#1{\pdflinkpage{#1}{#1}}%
1542 \def\pdflinkpage#1#2{%
1543 \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}}
1544 \setcolor{\linkcolor}#2\endlink}
1545 \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
1548 \let\pdfmkdest = \gobble
1549 \let\pdfurl = \gobble
1550 \let\endlink = \relax
1551 \let\setcolor = \gobble
1552 \let\pdfsetcolor = \gobble
1553 \let\pdfmakeoutlines = \relax
1554 \fi % \ifx\pdfoutput
1559 \ifx\XeTeXrevision\thisisundefined
1562 % XeTeX version check
1564 \ifnum\strcmp{\the\XeTeXversion\XeTeXrevision}{0.99996}>-1
1565 % TeX Live 2016 contains XeTeX 0.99996 and xdvipdfmx 20160307.
1566 % It can use the `dvipdfmx:config' special (from TeX Live SVN r40941).
1567 % For avoiding PDF destination name replacement, we use this special
1568 % instead of xdvipdfmx's command line option `-C 0x0010'.
1569 \special{dvipdfmx:config C 0x0010}
1570 % XeTeX 0.99995+ comes with xdvipdfmx 20160307+.
1571 % It can handle Unicode destination names for PDF.
1572 \txiuseunicodedestnametrue
1574 % XeTeX < 0.99996 (TeX Live < 2016) cannot use the
1575 % `dvipdfmx:config' special.
1576 % So for avoiding PDF destination name replacement,
1577 % xdvipdfmx's command line option `-C 0x0010' is necessary.
1579 % XeTeX < 0.99995 can not handle Unicode destination names for PDF
1580 % because xdvipdfmx 20150315 has a UTF-16 conversion issue.
1581 % It is fixed by xdvipdfmx 20160106 (TeX Live SVN r39753).
1582 \txiuseunicodedestnamefalse
1587 \def\rgbDarkRed{0.50 0.09 0.12}
1588 \def\rgbBlack{0 0 0}
1590 \def\pdfsetcolor#1{\special{pdf:scolor [#1]}}
1592 % Set color, and create a mark which defines \thiscolor accordingly,
1593 % so that \makeheadline knows which color to restore.
1595 \xdef\currentcolordefs{\gdef\noexpand\thiscolor{#1}}%
1600 \def\maincolor{\rgbBlack}
1601 \pdfsetcolor{\maincolor}
1602 \edef\thiscolor{\maincolor}
1603 \def\currentcolordefs{}
1607 \line{\pdfsetcolor{\maincolor}\the\footline}%
1615 % Extract \thiscolor definition from the marks.
1617 % Typeset the headline with \maincolor, then restore the color.
1618 \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}%
1625 % PDF outline support
1627 % Emulate pdfTeX primitive
1628 \def\pdfdest name#1 xyz{%
1629 \special{pdf:dest (#1) [@thispage /XYZ @xpos @ypos null]}%
1632 \def\setpdfdestname#1{{%
1633 % We have to set dummies so commands such as @code, and characters
1634 % such as \, aren't expanded when present in a section title.
1636 \makevalueexpandable
1638 \iftxiuseunicodedestname
1639 % Pass through Unicode characters.
1641 % Use ASCII approximations in destination names.
1642 \passthroughcharsfalse
1644 \def\pdfdestname{#1}%
1645 \txiescapepdf\pdfdestname
1648 \def\setpdfoutlinetext#1{{%
1650 % Always use Unicode characters in title texts.
1651 \def\pdfoutlinetext{#1}%
1652 % For XeTeX, xdvipdfmx converts to UTF-16.
1653 % So we do not convert.
1654 \txiescapepdf\pdfoutlinetext
1658 \setpdfdestname{#1}%
1659 \safewhatsit{\pdfdest name{\pdfdestname} xyz}%
1662 % by default, use black for everything.
1663 \def\urlcolor{\rgbBlack}
1664 \def\linkcolor{\rgbBlack}
1665 \def\endlink{\setcolor{\maincolor}\pdfendlink}
1667 \def\dopdfoutline#1#2#3#4{%
1668 \setpdfoutlinetext{#1}
1670 \ifx\pdfdestname\empty
1671 \def\pdfdestname{#4}%
1674 \special{pdf:out [-] #2 << /Title (\pdfoutlinetext) /A
1675 << /S /GoTo /D (\pdfdestname) >> >> }%
1678 \def\pdfmakeoutlines{%
1681 % For XeTeX, counts of subentries are not necessary.
1682 % Therefore, we read toc only once.
1684 % We use node names as destinations.
1686 % Currently we prefix the section name with the section number
1687 % for chapter and appendix headings only in order to avoid too much
1688 % horizontal space being required in the PDF viewer.
1689 \def\partentry##1##2##3##4{}% ignore parts in the outlines
1690 \def\numchapentry##1##2##3##4{%
1691 \dopdfoutline{##2 ##1}{1}{##3}{##4}}%
1692 \def\numsecentry##1##2##3##4{%
1693 \dopdfoutline{##1}{2}{##3}{##4}}%
1694 \def\numsubsecentry##1##2##3##4{%
1695 \dopdfoutline{##1}{3}{##3}{##4}}%
1696 \def\numsubsubsecentry##1##2##3##4{%
1697 \dopdfoutline{##1}{4}{##3}{##4}}%
1699 \let\appentry\numchapentry%
1700 \let\appsecentry\numsecentry%
1701 \let\appsubsecentry\numsubsecentry%
1702 \let\appsubsubsecentry\numsubsubsecentry%
1703 \def\unnchapentry##1##2##3##4{%
1704 \dopdfoutline{##1}{1}{##3}{##4}}%
1705 \let\unnsecentry\numsecentry%
1706 \let\unnsubsecentry\numsubsecentry%
1707 \let\unnsubsubsecentry\numsubsubsecentry%
1709 % For XeTeX, xdvipdfmx converts strings to UTF-16.
1710 % Therefore, the encoding and the language may not be considered.
1714 % We can have normal brace characters in the PDF outlines, unlike
1715 % Texinfo index files. So set that up.
1716 \def\{{\lbracecharliteral}%
1717 \def\}{\rbracecharliteral}%
1718 \catcode`\\=\active \otherbackslash
1719 \input \tocreadfilename
1722 {\catcode`[=1 \catcode`]=2
1723 \catcode`{=\other \catcode`}=\other
1724 \gdef\lbracecharliteral[{]%
1725 \gdef\rbracecharliteral[}]%
1728 \special{pdf:docview << /PageMode /UseOutlines >> }
1729 % ``\special{pdf:tounicode ...}'' is not necessary
1730 % because xdvipdfmx converts strings from UTF-8 to UTF-16 without it.
1731 % However, due to a UTF-16 conversion issue of xdvipdfmx 20150315,
1732 % ``\special{pdf:dest ...}'' cannot handle non-ASCII strings.
1733 % It is fixed by xdvipdfmx 20160106 (TeX Live SVN r39753).
1735 \def\skipspaces#1{\def\PP{#1}\def\D{|}%
1736 \ifx\PP\D\let\nextsp\relax
1737 \else\let\nextsp\skipspaces
1738 \addtokens{\filename}{\PP}%
1739 \advance\filenamelength by 1
1742 \def\getfilename#1{%
1744 % If we don't expand the argument now, \skipspaces will get
1745 % snagged on things like "@value{foo}".
1747 \expandafter\skipspaces\temp|\relax
1749 % make a live url in pdf output.
1752 % it seems we really need yet another set of dummies; have not
1753 % tried to figure out what each command should do in the context
1754 % of @url. for now, just make @/ a no-op, that's the only one
1755 % people have actually reported a problem with.
1757 \normalturnoffactive
1760 \makevalueexpandable
1761 % do we want to go so far as to use \indexnofonts instead of just
1762 % special-casing \var here?
1765 \leavevmode\setcolor{\urlcolor}%
1766 \special{pdf:bann << /Border [0 0 0]
1767 /Subtype /Link /A << /S /URI /URI (#1) >> >>}%
1769 \def\endlink{\setcolor{\maincolor}\special{pdf:eann}}
1770 \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}}
1771 \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
1772 \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks}
1773 \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}}
1775 \expandafter\poptoks\the\toksA|ENDTOKS|\relax
1777 \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3
1778 \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6
1779 \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9
1781 \ifnum0=\countA\else\makelink\fi
1782 \ifx\first.\let\next=\done\else
1784 \addtokens{\toksB}{\the\toksD}
1785 \ifx\first,\addtokens{\toksB}{\space}\fi
1787 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
1789 \def\makelink{\addtokens{\toksB}%
1790 {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0}
1791 \def\pdflink#1{\pdflinkpage{#1}{#1}}%
1792 \def\pdflinkpage#1#2{%
1793 \special{pdf:bann << /Border [0 0 0]
1794 /Type /Annot /Subtype /Link /A << /S /GoTo /D (#1) >> >>}%
1795 \setcolor{\linkcolor}#2\endlink}
1796 \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
1801 % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto).
1802 \def\doxeteximage#1#2#3{%
1803 \def\xeteximagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}%
1804 \def\xeteximageheight{#3}\setbox2 = \hbox{\ignorespaces #3}%
1806 % XeTeX (and the PDF format) supports .pdf, .png, .jpg (among
1807 % others). Let's try in that order, PDF first since if
1808 % someone has a scalable image, presumably better to use that than a
1810 \let\xeteximgext=\empty
1812 \openin 1 #1.pdf \ifeof 1
1813 \openin 1 #1.PDF \ifeof 1
1814 \openin 1 #1.png \ifeof 1
1815 \openin 1 #1.jpg \ifeof 1
1816 \openin 1 #1.jpeg \ifeof 1
1817 \openin 1 #1.JPG \ifeof 1
1818 \errmessage{Could not find image file #1 for XeTeX}%
1819 \else \gdef\xeteximgext{JPG}%
1821 \else \gdef\xeteximgext{jpeg}%
1823 \else \gdef\xeteximgext{jpg}%
1825 \else \gdef\xeteximgext{png}%
1827 \else \gdef\xeteximgext{PDF}%
1829 \else \gdef\xeteximgext{pdf}%
1834 % Putting an \hbox around the image can prevent an over-long line
1837 \def\xetexpdfext{pdf}%
1838 \ifx\xeteximgext\xetexpdfext
1839 \XeTeXpdffile "#1".\xeteximgext ""
1841 \def\xetexpdfext{PDF}%
1842 \ifx\xeteximgext\xetexpdfext
1843 \XeTeXpdffile "#1".\xeteximgext ""
1845 \XeTeXpicfile "#1".\xeteximgext ""
1848 \ifdim \wd0 >0pt width \xeteximagewidth \fi
1849 \ifdim \wd2 >0pt height \xeteximageheight \fi \relax
1858 % Set the baselineskip to #1, and the lineskip and strut size
1859 % correspondingly. There is no deep meaning behind these magic numbers
1860 % used as factors; they just match (closely enough) what Knuth defined.
1862 \def\lineskipfactor{.08333}
1863 \def\strutheightpercent{.70833}
1864 \def\strutdepthpercent {.29167}
1866 % can get a sort of poor man's double spacing by redefining this.
1867 \def\baselinefactor{1}
1869 \newdimen\textleading
1872 \normalbaselineskip = \baselinefactor\dimen0
1873 \normallineskip = \lineskipfactor\normalbaselineskip
1875 \setbox\strutbox =\hbox{%
1876 \vrule width0pt height\strutheightpercent\baselineskip
1877 depth \strutdepthpercent \baselineskip
1881 % PDF CMaps. See also LaTeX's t1.cmap.
1883 % do nothing with this by default.
1884 \expandafter\let\csname cmapOT1\endcsname\gobble
1885 \expandafter\let\csname cmapOT1IT\endcsname\gobble
1886 \expandafter\let\csname cmapOT1TT\endcsname\gobble
1888 % if we are producing pdf, and we have \pdffontattr, then define cmaps.
1889 % (\pdffontattr was introduced many years ago, but people still run
1890 % older pdftex's; it's easy to conditionalize, so we do.)
1891 \ifpdf \ifx\pdffontattr\thisisundefined \else
1893 \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
1894 \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
1895 %%DocumentNeededResources: ProcSet (CIDInit)
1896 %%IncludeResource: ProcSet (CIDInit)
1897 %%BeginResource: CMap (TeX-OT1-0)
1898 %%Title: (TeX-OT1-0 TeX OT1 0)
1901 /CIDInit /ProcSet findresource begin
1909 /CMapName /TeX-OT1-0 def
1911 1 begincodespacerange
1967 CMapName currentdict /CMap defineresource pop
1973 \expandafter\edef\csname cmapOT1\endcsname#1{%
1974 \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
1979 \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
1980 \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
1981 %%DocumentNeededResources: ProcSet (CIDInit)
1982 %%IncludeResource: ProcSet (CIDInit)
1983 %%BeginResource: CMap (TeX-OT1IT-0)
1984 %%Title: (TeX-OT1IT-0 TeX OT1IT 0)
1987 /CIDInit /ProcSet findresource begin
1995 /CMapName /TeX-OT1IT-0 def
1997 1 begincodespacerange
2055 CMapName currentdict /CMap defineresource pop
2061 \expandafter\edef\csname cmapOT1IT\endcsname#1{%
2062 \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
2067 \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
2068 \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
2069 %%DocumentNeededResources: ProcSet (CIDInit)
2070 %%IncludeResource: ProcSet (CIDInit)
2071 %%BeginResource: CMap (TeX-OT1TT-0)
2072 %%Title: (TeX-OT1TT-0 TeX OT1TT 0)
2075 /CIDInit /ProcSet findresource begin
2083 /CMapName /TeX-OT1TT-0 def
2085 1 begincodespacerange
2130 CMapName currentdict /CMap defineresource pop
2136 \expandafter\edef\csname cmapOT1TT\endcsname#1{%
2137 \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
2141 % This is what gets called when #5 of \setfont is empty.
2147 % Set the font macro #1 to the font named \fontprefix#2.
2148 % #3 is the font's design size, #4 is a scale factor, #5 is the CMap
2149 % encoding (only OT1, OT1IT and OT1TT are allowed, or empty to omit).
2157 \def\setfont#1#2#3#4#5{%
2158 \font#1=\fontprefix#2#3 scaled #4
2159 \csname cmap#5\endcsname#1%
2160 \ifx#2\ttshape\hyphenchar#1=-1 \fi
2161 \ifx#2\ttbshape\hyphenchar#1=-1 \fi
2162 \ifx#2\ttslshape\hyphenchar#1=-1 \fi
2165 % Use cm as the default font prefix.
2166 % To specify the font prefix, you must define \fontprefix
2167 % before you read in texinfo.tex.
2168 \ifx\fontprefix\thisisundefined
2171 % Support font families that don't use the same naming scheme as CM.
2173 \def\rmbshape{bx} % where the normal face is bold
2178 \def\ttslshape{sltt}
2188 % Definitions for a main text size of 11pt. (The default in Texinfo.)
2190 \def\definetextfontsizexi{%
2191 % Text fonts (11.2pt, magstep1).
2192 \def\textnominalsize{11pt}
2193 \edef\mainmagstep{\magstephalf}
2194 \setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
2195 \setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
2196 \setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
2197 \setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
2198 \setfont\textsl\slshape{10}{\mainmagstep}{OT1}
2199 \setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
2200 \setfont\textsc\scshape{10}{\mainmagstep}{OT1}
2201 \setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
2202 \font\texti=cmmi10 scaled \mainmagstep
2203 \font\textsy=cmsy10 scaled \mainmagstep
2204 \def\textecsize{1095}
2206 % A few fonts for @defun names and args.
2207 \setfont\defbf\bfshape{10}{\magstep1}{OT1}
2208 \setfont\deftt\ttshape{10}{\magstep1}{OT1TT}
2209 \setfont\defsl\slshape{10}{\magstep1}{OT1}
2210 \setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT}
2211 \def\df{\let\ttfont=\deftt \let\bffont = \defbf
2212 \let\ttslfont=\defttsl \let\slfont=\defsl \bf}
2214 % Fonts for indices, footnotes, small examples (9pt).
2215 \def\smallnominalsize{9pt}
2216 \setfont\smallrm\rmshape{9}{1000}{OT1}
2217 \setfont\smalltt\ttshape{9}{1000}{OT1TT}
2218 \setfont\smallbf\bfshape{10}{900}{OT1}
2219 \setfont\smallit\itshape{9}{1000}{OT1IT}
2220 \setfont\smallsl\slshape{9}{1000}{OT1}
2221 \setfont\smallsf\sfshape{9}{1000}{OT1}
2222 \setfont\smallsc\scshape{10}{900}{OT1}
2223 \setfont\smallttsl\ttslshape{10}{900}{OT1TT}
2226 \def\smallecsize{0900}
2228 % Fonts for small examples (8pt).
2229 \def\smallernominalsize{8pt}
2230 \setfont\smallerrm\rmshape{8}{1000}{OT1}
2231 \setfont\smallertt\ttshape{8}{1000}{OT1TT}
2232 \setfont\smallerbf\bfshape{10}{800}{OT1}
2233 \setfont\smallerit\itshape{8}{1000}{OT1IT}
2234 \setfont\smallersl\slshape{8}{1000}{OT1}
2235 \setfont\smallersf\sfshape{8}{1000}{OT1}
2236 \setfont\smallersc\scshape{10}{800}{OT1}
2237 \setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
2238 \font\smalleri=cmmi8
2239 \font\smallersy=cmsy8
2240 \def\smallerecsize{0800}
2242 % Fonts for math mode superscripts (7pt).
2243 \def\sevennominalsize{7pt}
2244 \setfont\sevenrm\rmshape{7}{1000}{OT1}
2245 \setfont\seventt\ttshape{10}{700}{OT1TT}
2246 \setfont\sevenbf\bfshape{10}{700}{OT1}
2247 \setfont\sevenit\itshape{7}{1000}{OT1IT}
2248 \setfont\sevensl\slshape{10}{700}{OT1}
2249 \setfont\sevensf\sfshape{10}{700}{OT1}
2250 \setfont\sevensc\scshape{10}{700}{OT1}
2251 \setfont\seventtsl\ttslshape{10}{700}{OT1TT}
2254 \def\sevenecsize{0700}
2256 % Fonts for title page (20.4pt):
2257 \def\titlenominalsize{20pt}
2258 \setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
2259 \setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
2260 \setfont\titlesl\slbshape{10}{\magstep4}{OT1}
2261 \setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
2262 \setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
2263 \setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
2264 \let\titlebf=\titlerm
2265 \setfont\titlesc\scbshape{10}{\magstep4}{OT1}
2266 \font\titlei=cmmi12 scaled \magstep3
2267 \font\titlesy=cmsy10 scaled \magstep4
2268 \def\titleecsize{2074}
2270 % Chapter (and unnumbered) fonts (17.28pt).
2271 \def\chapnominalsize{17pt}
2272 \setfont\chaprm\rmbshape{12}{\magstep2}{OT1}
2273 \setfont\chapit\itbshape{10}{\magstep3}{OT1IT}
2274 \setfont\chapsl\slbshape{10}{\magstep3}{OT1}
2275 \setfont\chaptt\ttbshape{12}{\magstep2}{OT1TT}
2276 \setfont\chapttsl\ttslshape{10}{\magstep3}{OT1TT}
2277 \setfont\chapsf\sfbshape{17}{1000}{OT1}
2279 \setfont\chapsc\scbshape{10}{\magstep3}{OT1}
2280 \font\chapi=cmmi12 scaled \magstep2
2281 \font\chapsy=cmsy10 scaled \magstep3
2282 \def\chapecsize{1728}
2284 % Section fonts (14.4pt).
2285 \def\secnominalsize{14pt}
2286 \setfont\secrm\rmbshape{12}{\magstep1}{OT1}
2287 \setfont\secrmnotbold\rmshape{12}{\magstep1}{OT1}
2288 \setfont\secit\itbshape{10}{\magstep2}{OT1IT}
2289 \setfont\secsl\slbshape{10}{\magstep2}{OT1}
2290 \setfont\sectt\ttbshape{12}{\magstep1}{OT1TT}
2291 \setfont\secttsl\ttslshape{10}{\magstep2}{OT1TT}
2292 \setfont\secsf\sfbshape{12}{\magstep1}{OT1}
2294 \setfont\secsc\scbshape{10}{\magstep2}{OT1}
2295 \font\seci=cmmi12 scaled \magstep1
2296 \font\secsy=cmsy10 scaled \magstep2
2297 \def\sececsize{1440}
2299 % Subsection fonts (13.15pt).
2300 \def\ssecnominalsize{13pt}
2301 \setfont\ssecrm\rmbshape{12}{\magstephalf}{OT1}
2302 \setfont\ssecit\itbshape{10}{1315}{OT1IT}
2303 \setfont\ssecsl\slbshape{10}{1315}{OT1}
2304 \setfont\ssectt\ttbshape{12}{\magstephalf}{OT1TT}
2305 \setfont\ssecttsl\ttslshape{10}{1315}{OT1TT}
2306 \setfont\ssecsf\sfbshape{12}{\magstephalf}{OT1}
2308 \setfont\ssecsc\scbshape{10}{1315}{OT1}
2309 \font\sseci=cmmi12 scaled \magstephalf
2310 \font\ssecsy=cmsy10 scaled 1315
2311 \def\ssececsize{1200}
2313 % Reduced fonts for @acronym in text (10pt).
2314 \def\reducednominalsize{10pt}
2315 \setfont\reducedrm\rmshape{10}{1000}{OT1}
2316 \setfont\reducedtt\ttshape{10}{1000}{OT1TT}
2317 \setfont\reducedbf\bfshape{10}{1000}{OT1}
2318 \setfont\reducedit\itshape{10}{1000}{OT1IT}
2319 \setfont\reducedsl\slshape{10}{1000}{OT1}
2320 \setfont\reducedsf\sfshape{10}{1000}{OT1}
2321 \setfont\reducedsc\scshape{10}{1000}{OT1}
2322 \setfont\reducedttsl\ttslshape{10}{1000}{OT1TT}
2323 \font\reducedi=cmmi10
2324 \font\reducedsy=cmsy10
2325 \def\reducedecsize{1000}
2327 \textleading = 13.2pt % line spacing for 11pt CM
2328 \textfonts % reset the current fonts
2330 } % end of 11pt text font size definitions, \definetextfontsizexi
2333 % Definitions to make the main text be 10pt Computer Modern, with
2334 % section, chapter, etc., sizes following suit. This is for the GNU
2335 % Press printing of the Emacs 22 manual. Maybe other manuals in the
2336 % future. Used with @smallbook, which sets the leading to 12pt.
2338 \def\definetextfontsizex{%
2339 % Text fonts (10pt).
2340 \def\textnominalsize{10pt}
2341 \edef\mainmagstep{1000}
2342 \setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
2343 \setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
2344 \setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
2345 \setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
2346 \setfont\textsl\slshape{10}{\mainmagstep}{OT1}
2347 \setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
2348 \setfont\textsc\scshape{10}{\mainmagstep}{OT1}
2349 \setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
2350 \font\texti=cmmi10 scaled \mainmagstep
2351 \font\textsy=cmsy10 scaled \mainmagstep
2352 \def\textecsize{1000}
2354 % A few fonts for @defun names and args.
2355 \setfont\defbf\bfshape{10}{\magstephalf}{OT1}
2356 \setfont\deftt\ttshape{10}{\magstephalf}{OT1TT}
2357 \setfont\defsl\slshape{10}{\magstephalf}{OT1}
2358 \setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT}
2359 \def\df{\let\ttfont=\deftt \let\bffont = \defbf
2360 \let\slfont=\defsl \let\ttslfont=\defttsl \bf}
2362 % Fonts for indices, footnotes, small examples (9pt).
2363 \def\smallnominalsize{9pt}
2364 \setfont\smallrm\rmshape{9}{1000}{OT1}
2365 \setfont\smalltt\ttshape{9}{1000}{OT1TT}
2366 \setfont\smallbf\bfshape{10}{900}{OT1}
2367 \setfont\smallit\itshape{9}{1000}{OT1IT}
2368 \setfont\smallsl\slshape{9}{1000}{OT1}
2369 \setfont\smallsf\sfshape{9}{1000}{OT1}
2370 \setfont\smallsc\scshape{10}{900}{OT1}
2371 \setfont\smallttsl\ttslshape{10}{900}{OT1TT}
2374 \def\smallecsize{0900}
2376 % Fonts for small examples (8pt).
2377 \def\smallernominalsize{8pt}
2378 \setfont\smallerrm\rmshape{8}{1000}{OT1}
2379 \setfont\smallertt\ttshape{8}{1000}{OT1TT}
2380 \setfont\smallerbf\bfshape{10}{800}{OT1}
2381 \setfont\smallerit\itshape{8}{1000}{OT1IT}
2382 \setfont\smallersl\slshape{8}{1000}{OT1}
2383 \setfont\smallersf\sfshape{8}{1000}{OT1}
2384 \setfont\smallersc\scshape{10}{800}{OT1}
2385 \setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
2386 \font\smalleri=cmmi8
2387 \font\smallersy=cmsy8
2388 \def\smallerecsize{0800}
2390 % Fonts for math mode superscripts (7pt).
2391 \def\sevennominalsize{7pt}
2392 \setfont\sevenrm\rmshape{7}{1000}{OT1}
2393 \setfont\seventt\ttshape{10}{700}{OT1TT}
2394 \setfont\sevenbf\bfshape{10}{700}{OT1}
2395 \setfont\sevenit\itshape{7}{1000}{OT1IT}
2396 \setfont\sevensl\slshape{10}{700}{OT1}
2397 \setfont\sevensf\sfshape{10}{700}{OT1}
2398 \setfont\sevensc\scshape{10}{700}{OT1}
2399 \setfont\seventtsl\ttslshape{10}{700}{OT1TT}
2402 \def\sevenecsize{0700}
2404 % Fonts for title page (20.4pt):
2405 \def\titlenominalsize{20pt}
2406 \setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
2407 \setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
2408 \setfont\titlesl\slbshape{10}{\magstep4}{OT1}
2409 \setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
2410 \setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
2411 \setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
2412 \let\titlebf=\titlerm
2413 \setfont\titlesc\scbshape{10}{\magstep4}{OT1}
2414 \font\titlei=cmmi12 scaled \magstep3
2415 \font\titlesy=cmsy10 scaled \magstep4
2416 \def\titleecsize{2074}
2418 % Chapter fonts (14.4pt).
2419 \def\chapnominalsize{14pt}
2420 \setfont\chaprm\rmbshape{12}{\magstep1}{OT1}
2421 \setfont\chapit\itbshape{10}{\magstep2}{OT1IT}
2422 \setfont\chapsl\slbshape{10}{\magstep2}{OT1}
2423 \setfont\chaptt\ttbshape{12}{\magstep1}{OT1TT}
2424 \setfont\chapttsl\ttslshape{10}{\magstep2}{OT1TT}
2425 \setfont\chapsf\sfbshape{12}{\magstep1}{OT1}
2427 \setfont\chapsc\scbshape{10}{\magstep2}{OT1}
2428 \font\chapi=cmmi12 scaled \magstep1
2429 \font\chapsy=cmsy10 scaled \magstep2
2430 \def\chapecsize{1440}
2432 % Section fonts (12pt).
2433 \def\secnominalsize{12pt}
2434 \setfont\secrm\rmbshape{12}{1000}{OT1}
2435 \setfont\secit\itbshape{10}{\magstep1}{OT1IT}
2436 \setfont\secsl\slbshape{10}{\magstep1}{OT1}
2437 \setfont\sectt\ttbshape{12}{1000}{OT1TT}
2438 \setfont\secttsl\ttslshape{10}{\magstep1}{OT1TT}
2439 \setfont\secsf\sfbshape{12}{1000}{OT1}
2441 \setfont\secsc\scbshape{10}{\magstep1}{OT1}
2443 \font\secsy=cmsy10 scaled \magstep1
2444 \def\sececsize{1200}
2446 % Subsection fonts (10pt).
2447 \def\ssecnominalsize{10pt}
2448 \setfont\ssecrm\rmbshape{10}{1000}{OT1}
2449 \setfont\ssecit\itbshape{10}{1000}{OT1IT}
2450 \setfont\ssecsl\slbshape{10}{1000}{OT1}
2451 \setfont\ssectt\ttbshape{10}{1000}{OT1TT}
2452 \setfont\ssecttsl\ttslshape{10}{1000}{OT1TT}
2453 \setfont\ssecsf\sfbshape{10}{1000}{OT1}
2455 \setfont\ssecsc\scbshape{10}{1000}{OT1}
2458 \def\ssececsize{1000}
2460 % Reduced fonts for @acronym in text (9pt).
2461 \def\reducednominalsize{9pt}
2462 \setfont\reducedrm\rmshape{9}{1000}{OT1}
2463 \setfont\reducedtt\ttshape{9}{1000}{OT1TT}
2464 \setfont\reducedbf\bfshape{10}{900}{OT1}
2465 \setfont\reducedit\itshape{9}{1000}{OT1IT}
2466 \setfont\reducedsl\slshape{9}{1000}{OT1}
2467 \setfont\reducedsf\sfshape{9}{1000}{OT1}
2468 \setfont\reducedsc\scshape{10}{900}{OT1}
2469 \setfont\reducedttsl\ttslshape{10}{900}{OT1TT}
2470 \font\reducedi=cmmi9
2471 \font\reducedsy=cmsy9
2472 \def\reducedecsize{0900}
2474 \divide\parskip by 2 % reduce space between paragraphs
2475 \textleading = 12pt % line spacing for 10pt CM
2476 \textfonts % reset the current fonts
2478 } % end of 10pt text font size definitions, \definetextfontsizex
2480 % Fonts for short table of contents.
2481 \setfont\shortcontrm\rmshape{12}{1000}{OT1}
2482 \setfont\shortcontbf\bfshape{10}{\magstep1}{OT1} % no cmb12
2483 \setfont\shortcontsl\slshape{12}{1000}{OT1}
2484 \setfont\shortconttt\ttshape{12}{1000}{OT1TT}
2487 % We provide the user-level command
2489 % (or 11) to redefine the text font size. pt is assumed.
2495 \parseargdef\fonttextsize{%
2496 \def\textsizearg{#1}%
2497 %\wlog{doing @fonttextsize \textsizearg}%
2499 % Set \globaldefs so that documents can use this inside @tex, since
2500 % makeinfo 4.8 does not support it, but we need it nonetheless.
2502 \begingroup \globaldefs=1
2503 \ifx\textsizearg\xword \definetextfontsizex
2504 \else \ifx\textsizearg\xiword \definetextfontsizexi
2507 \errmessage{@fonttextsize only supports `10' or `11', not `\textsizearg'}
2513 % Change the current font style to #1, remembering it in \curfontstyle.
2514 % For now, we do not accumulate font styles: @b{@i{foo}} prints foo in
2515 % italics, not bold italics.
2517 \def\setfontstyle#1{%
2518 \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd.
2519 \csname #1font\endcsname % change the current font
2522 \def\rm{\fam=0 \setfontstyle{rm}}
2523 \def\it{\fam=\itfam \setfontstyle{it}}
2524 \def\sl{\fam=\slfam \setfontstyle{sl}}
2525 \def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf}
2526 \def\tt{\fam=\ttfam \setfontstyle{tt}}
2528 % Texinfo sort of supports the sans serif font style, which plain TeX does not.
2529 % So we set up a \sf.
2531 \def\sf{\fam=\sffam \setfontstyle{sf}}
2533 % We don't need math for this font style.
2534 \def\ttsl{\setfontstyle{ttsl}}
2537 % In order for the font changes to affect most math symbols and letters,
2538 % we have to define the \textfont of the standard families.
2539 % We don't bother to reset \scriptscriptfont; awaiting user need.
2541 \def\resetmathfonts{%
2542 \textfont0=\rmfont \textfont1=\ifont \textfont2=\syfont
2543 \textfont\itfam=\itfont \textfont\slfam=\slfont \textfont\bffam=\bffont
2544 \textfont\ttfam=\ttfont \textfont\sffam=\sffont
2546 % Fonts for superscript. Note that the 7pt fonts are used regardless
2547 % of the current font size.
2548 \scriptfont0=\sevenrm \scriptfont1=\seveni \scriptfont2=\sevensy
2549 \scriptfont\itfam=\sevenit \scriptfont\slfam=\sevensl
2550 \scriptfont\bffam=\sevenbf \scriptfont\ttfam=\seventt
2551 \scriptfont\sffam=\sevensf
2556 % \defineassignfonts{SIZE} -
2557 % Define sequence \assignfontsSIZE, which switches between font sizes
2558 % by redefining the meanings of \STYLEfont. (Just \STYLE additionally sets
2559 % the current \fam for math mode.)
2561 \def\defineassignfonts#1{%
2562 \expandafter\edef\csname assignfonts#1\endcsname{%
2563 \let\noexpand\rmfont\csname #1rm\endcsname
2564 \let\noexpand\itfont\csname #1it\endcsname
2565 \let\noexpand\slfont\csname #1sl\endcsname
2566 \let\noexpand\bffont\csname #1bf\endcsname
2567 \let\noexpand\ttfont\csname #1tt\endcsname
2568 \let\noexpand\smallcaps\csname #1sc\endcsname
2569 \let\noexpand\sffont \csname #1sf\endcsname
2570 \let\noexpand\ifont \csname #1i\endcsname
2571 \let\noexpand\syfont \csname #1sy\endcsname
2572 \let\noexpand\ttslfont\csname #1ttsl\endcsname
2576 \def\assignfonts#1{%
2577 \csname assignfonts#1\endcsname
2582 % Select smaller font size with the current style. Used to change font size
2583 % in, e.g., the LaTeX logo and acronyms. If we are using bold fonts for
2584 % normal roman text, also use bold fonts for roman text in the smaller size.
2585 \def\switchtolllsize{%
2586 \expandafter\assignfonts\expandafter{\lllsize}%
2590 \csname\curfontstyle\endcsname
2593 \def\switchtolsize{%
2594 \expandafter\assignfonts\expandafter{\lsize}%
2598 \csname\curfontstyle\endcsname
2601 % Define the font-changing commands (all called \...fonts).
2602 % Each font-changing command also sets the names \lsize (one size lower)
2603 % and \lllsize (three sizes lower). These relative commands are used
2604 % in, e.g., the LaTeX logo and acronyms.
2606 % Note: The fonts used for \ifont are for "math italics" (\itfont is for
2607 % italics in regular text). \syfont is also used in math mode only.
2609 \def\definefontsetatsize#1#2#3#4#5{%
2610 \defineassignfonts{#1}%
2611 \expandafter\def\csname #1fonts\endcsname{%
2612 \def\curfontsize{#1}%
2613 \def\lsize{#2}\def\lllsize{#3}%
2614 \csname rmisbold#5\endcsname
2615 \csname assignfonts#1\endcsname
2620 \definefontsetatsize{text} {reduced}{smaller}{\textleading}{false}
2621 \definefontsetatsize{title} {chap} {subsec} {27pt} {true}
2622 \definefontsetatsize{chap} {sec} {text} {19pt} {true}
2623 \definefontsetatsize{sec} {subsec} {reduced}{17pt} {true}
2624 \definefontsetatsize{ssec} {text} {small} {15pt} {true}
2625 \definefontsetatsize{reduced}{small} {smaller}{10.5pt}{false}
2626 \definefontsetatsize{small} {smaller}{smaller}{10.5pt}{false}
2627 \definefontsetatsize{smaller}{smaller}{smaller}{9.5pt} {false}
2629 \def\titlefont#1{{\titlefonts\rm #1}}
2630 \let\subsecfonts = \ssecfonts
2631 \let\subsubsecfonts = \ssecfonts
2633 % Define these just so they can be easily changed for other fonts.
2634 \def\angleleft{$\langle$}
2635 \def\angleright{$\rangle$}
2637 % Set the fonts to use with the @small... environments.
2638 \let\smallexamplefonts = \smallfonts
2640 % About \smallexamplefonts. If we use \smallfonts (9pt), @smallexample
2641 % can fit this many characters:
2642 % 8.5x11=86 smallbook=72 a4=90 a5=69
2643 % If we use \scriptfonts (8pt), then we can fit this many characters:
2644 % 8.5x11=90+ smallbook=80 a4=90+ a5=77
2645 % For me, subjectively, the few extra characters that fit aren't worth
2646 % the additional smallness of 8pt. So I'm making the default 9pt.
2648 % By the way, for comparison, here's what fits with @example (10pt):
2649 % 8.5x11=71 smallbook=60 a4=75 a5=58
2652 % Set up the default fonts, so we can use them for creating boxes.
2654 \definetextfontsizexi
2657 % Check if we are currently using a typewriter font. Since all the
2658 % Computer Modern typewriter fonts have zero interword stretch (and
2659 % shrink), and it is reasonable to expect all typewriter fonts to have
2660 % this property, we can check that font parameter. #1 is what to
2661 % print if we are indeed using \tt; #2 is what to print otherwise.
2662 \def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi}
2664 % Same as above, but check for italic font. Actually this also catches
2665 % non-italic slanted fonts since it is impossible to distinguish them from
2666 % italic fonts. But since this is only used by $ and it uses \sl anyway
2667 % this is not a problem.
2668 \def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi}
2671 % Check if internal flag is clear, i.e. has not been @set.
2672 \def\ifflagclear#1#2#3{%
2673 \expandafter\ifx\csname SET#1\endcsname\relax
2681 \gdef\setcodequotes{\let`\codequoteleft \let'\codequoteright}
2682 \gdef\setregularquotes{\let`\lq \let'\rq}
2686 % output for ' in @code
2687 % in tt font hex 0D (undirected) or 27 (curly right quote)
2689 \def\codequoteright{%
2691 {\ifflagclear{txicodequoteundirected}%
2692 {\ifflagclear{codequoteundirected}%
2699 % output for ` in @code
2700 % in tt font hex 12 (grave accent) or 60 (curly left quote)
2701 % \relax disables Spanish ligatures ?` and !` of \tt font.
2703 \def\codequoteleft{%
2705 {\ifflagclear{txicodequotebacktick}%
2706 {\ifflagclear{codequotebacktick}%
2713 % Commands to set the quote options.
2715 \parseargdef\codequoteundirected{%
2718 \expandafter\let\csname SETtxicodequoteundirected\endcsname
2720 \else\ifx\temp\offword
2721 \expandafter\let\csname SETtxicodequoteundirected\endcsname
2724 \errhelp = \EMsimple
2725 \errmessage{Unknown @codequoteundirected value `\temp', must be on|off}%
2729 \parseargdef\codequotebacktick{%
2732 \expandafter\let\csname SETtxicodequotebacktick\endcsname
2734 \else\ifx\temp\offword
2735 \expandafter\let\csname SETtxicodequotebacktick\endcsname
2738 \errhelp = \EMsimple
2739 \errmessage{Unknown @codequotebacktick value `\temp', must be on|off}%
2743 % Turn them on by default
2744 \let\SETtxicodequoteundirected = t
2745 \let\SETtxicodequotebacktick = t
2748 % [Knuth] pp. 380,381,391, disable Spanish ligatures ?` and !` of \tt font.
2749 \def\noligaturesquoteleft{\relax\lq}
2751 % Count depth in font-changes, for error checks
2752 \newcount\fontdepth \fontdepth=0
2756 % #1 is the font command (\sl or \it), #2 is the text to slant.
2757 % If we are in a monospaced environment, however, 1) always use \ttsl,
2758 % and 2) do not add an italic correction.
2759 \def\dosmartslant#1#2{%
2761 {{\ttsl #2}\let\next=\relax}%
2762 {\def\next{{#1#2}\smartitaliccorrection}}%
2765 \def\smartslanted{\dosmartslant\sl}
2766 \def\smartitalic{\dosmartslant\it}
2768 % Output an italic correction unless the following character is such as
2770 \def\smartitaliccorrection{\futurelet\next\smartitaliccorrectionx}
2771 \def\smartitaliccorrectionx{%
2776 \else\ifx\next\comma%
2782 % @cite unconditionally uses \sl with \smartitaliccorrection.
2783 \def\cite#1{{\sl #1}\smartitaliccorrection}
2785 % @var unconditionally uses \sl. This gives consistency for
2786 % parameter names whether they are in @def, @table @code or a
2787 % regular paragraph.
2788 % To get ttsl font for @var when used in code context, @set txicodevaristt.
2789 % The \null is to reset \spacefactor.
2792 \let\saveaftersmartic = \aftersmartic
2793 \def\aftersmartic{\null\let\aftersmartic=\saveaftersmartic}%
2795 \ifflagclear{txicodevaristt}%
2796 {\def\varnext{{{\sl #1}}\smartitaliccorrection}}%
2797 {\def\varnext{\smartslanted{#1}}}%
2801 % To be removed after next release
2802 \def\SETtxicodevaristt{}% @set txicodevaristt
2805 \let\slanted=\smartslanted
2806 \let\dfn=\smartslanted
2807 \let\emph=\smartitalic
2809 % @r for roman font, used for code comment
2811 \usenormaldash % get --, --- ligatures even if in @code
2812 \defcharsdefault % in case on def line
2814 {\catcode`-=\active \gdef\usenormaldash{\let-\normaldash}}
2816 % @sc, undocumented @ii.
2817 \def\sc#1{{\smallcaps#1}} % smallcaps font
2818 \def\ii#1{{\it #1}} % italic font
2820 % @b, explicit bold. Also @strong.
2824 % @sansserif, explicit sans.
2825 \def\sansserif#1{{\sf #1}}
2827 \newif\iffrenchspacing
2830 % Set sfcode to normal for the chars that usually have another value.
2831 % Can't use plain's \frenchspacing because it uses the `\x notation, and
2832 % sometimes \x has an active definition that messes things up.
2835 \def\plainfrenchspacing{%
2836 \iffrenchspacing\else
2838 \sfcode`\.=\@m \sfcode`\?=\@m \sfcode`\!=\@m
2839 \sfcode`\:=\@m \sfcode`\;=\@m \sfcode`\,=\@m
2840 \def\endofsentencespacefactor{1000}% for @. and friends
2843 \def\plainnonfrenchspacing{%
2846 \sfcode`\.3000\sfcode`\?3000\sfcode`\!3000
2847 \sfcode`\:2000\sfcode`\;1500\sfcode`\,1250
2848 \def\endofsentencespacefactor{3000}% for @. and friends
2852 \def\endofsentencespacefactor{3000}% default
2854 % @frenchspacing on|off says whether to put extra space after punctuation.
2859 \let\frenchspacingsetting\plainnonfrenchspacing % used in output routine
2860 \parseargdef\frenchspacing{%
2862 \ifx\temp\onword \let\frenchspacingsetting\plainfrenchspacing
2863 \else\ifx\temp\offword \let\frenchspacingsetting\plainnonfrenchspacing
2865 \errhelp = \EMsimple
2866 \errmessage{Unknown @frenchspacing option `\temp', must be on|off}%
2868 \frenchspacingsetting
2872 % @t, explicit typewriter.
2874 {\tt \defcharsdefault \plainfrenchspacing #1}%
2879 \def\samp#1{{\setcodequotes\lq\tclose{#1}\rq\null}}
2881 % @indicateurl is \samp, that is, with quotes.
2882 \let\indicateurl=\samp
2884 % @code (and similar) prints in typewriter, but with spaces the same
2885 % size as normal in the surrounding text, without hyphenation, etc.
2886 % This is a subroutine for that.
2889 % Change normal interword space to be same as for the current font.
2890 \spaceskip = \fontdimen2\font
2892 % Switch to typewriter.
2895 % `\ ' produces the large typewriter interword space.
2896 \def\ {{\spaceskip = 0pt{} }}%
2901 \null % reset spacefactor to 1000
2904 % This is for LuaTeX: It is not sufficient to disable hyphenation at
2905 % explicit dashes by setting `\hyphenchar` to -1.
2910 % We must turn on hyphenation at `-' and `_' in @code.
2911 % Otherwise, it is too hard to avoid overfull hboxes
2912 % in the Emacs manual, the Library manual, etc.
2913 % We explicitly allow hyphenation at these characters
2914 % using \discretionary.
2916 % Hyphenation at - and hyphenation within words was turned off
2917 % by default for the tt fonts using the \hyphenchar parameter of TeX.
2919 \catcode`\-=\active \catcode`\_=\active
2920 \catcode`\'=\active \catcode`\`=\active
2921 \global\let'=\rq \global\let`=\lq % default definitions
2923 \global\def\code{\begingroup
2925 \catcode\dashChar=\active \catcode\underChar=\active
2936 \gdef\codedash{\futurelet\next\codedashfinish}
2937 \gdef\codedashfinish{%
2938 \normaldash % always output the dash character itself.
2940 % Now, output a discretionary to allow a line break, unless
2941 % (a) the next character is a -, or
2942 % (b) the preceding character is a -, or
2943 % (c) we are at the start of the string.
2944 % In both cases (b) and (c), \codedashnobreak should be set to \codedash.
2946 % E.g., given --posix, we do not want to allow a break after either -.
2947 % Given --foo-bar, we do want to allow a break between the - and the b.
2948 \ifx\next\codedash \else
2949 \ifx\codedashnobreak\codedash
2950 \else \discretionary{}{}{}\fi
2952 % we need the space after the = for the case when \next itself is a
2953 % space token; it would get swallowed otherwise. As in @code{- a}.
2954 \global\let\codedashnobreak= \next
2959 \def\codex #1{\tclose{%
2960 % Given -foo (with a single dash), we do not want to allow a break
2961 % after the -. \codedashnobreak is set to the first character in
2963 \futurelet\codedashnobreak\relax
2968 % this is all so @math{@code{var_name}+1} can work. In math mode, _
2969 % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.)
2970 % will therefore expand the active definition of _, which is us
2971 % (inside @code that is), therefore an endless loop.
2973 \mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_.
2974 \else\normalunderscore \fi
2975 \discretionary{}{}{}}%
2979 % An additional complication: the above will allow breaks after, e.g.,
2980 % each of the four underscores in __typeof__. This is bad.
2981 % @allowcodebreaks provides a document-level way to turn breaking at -
2984 \newif\ifallowcodebreaks \allowcodebreakstrue
2986 \def\keywordtrue{true}
2987 \def\keywordfalse{false}
2989 \parseargdef\allowcodebreaks{%
2991 \ifx\txiarg\keywordtrue
2992 \allowcodebreakstrue
2993 \else\ifx\txiarg\keywordfalse
2994 \allowcodebreaksfalse
2996 \errhelp = \EMsimple
2997 \errmessage{Unknown @allowcodebreaks option `\txiarg', must be true|false}%
3001 % For @command, @env, @file, @option quotes seem unnecessary,
3002 % so use \code rather than \samp.
3008 % @uref (abbreviation for `urlref') aka @url takes an optional
3009 % (comma-separated) second argument specifying the text to display and
3010 % an optional third arg as text to display instead of (rather than in
3011 % addition to) the url itself. First (mandatory) arg is the url.
3013 % TeX-only option to allow changing PDF output to show only the second
3014 % arg (if given), and not the url (which is then just the link target).
3015 \newif\ifurefurlonlylink
3017 % The default \pretolerance setting stops the penalty inserted in
3018 % \urefallowbreak being a discouragement to line breaking. Set it to
3019 % a negative value for this paragraph only. Hopefully this does not
3020 % conflict with redefinitions of \par done elsewhere.
3021 \def\nopretolerance{%
3023 \def\par{\endgraf\pretolerance=100 \let\par\endgraf}%
3026 % The main macro is \urefbreak, which allows breaking at expected
3027 % places within the url.
3028 \def\urefbreak{\nopretolerance \begingroup \urefcatcodes \dourefbreak}
3029 \let\uref=\urefbreak
3031 \def\dourefbreak#1{\urefbreakfinish #1,,,\finish}
3032 \def\urefbreakfinish#1,#2,#3,#4\finish{% doesn't work in @example
3035 \setbox0 = \hbox{\ignorespaces #3}%
3037 \unhbox0 % third arg given, show only that
3039 \setbox0 = \hbox{\ignorespaces #2}% look for second arg
3042 % For pdfTeX and LuaTeX
3044 % PDF plus option to not display url, show just arg
3047 % PDF, normally display both arg and url for consistency,
3048 % visibility, if the pdf is eventually used to print, etc.
3049 \unhbox0\ (\urefcode{#1})%
3052 \ifx\XeTeXrevision\thisisundefined
3053 \unhbox0\ (\urefcode{#1})% DVI, always show arg and url
3057 % PDF plus option to not display url, show just arg
3060 % PDF, normally display both arg and url for consistency,
3061 % visibility, if the pdf is eventually used to print, etc.
3062 \unhbox0\ (\urefcode{#1})%
3067 \urefcode{#1}% only url given, so show it
3073 % Allow line breaks around only a few characters (only).
3075 \catcode`\&=\active \catcode`\.=\active
3076 \catcode`\#=\active \catcode`\?=\active
3082 \global\def\urefcode{\begingroup
3093 % By default, they are just regular characters.
3094 \global\def&{\normalamp}
3095 \global\def.{\normaldot}
3096 \global\def#{\normalhash}
3097 \global\def?{\normalquest}
3098 \global\def/{\normalslash}
3101 \def\urefcodeamp{\urefprebreak \&\urefpostbreak}
3102 \def\urefcodedot{\urefprebreak .\urefpostbreak}
3103 \def\urefcodehash{\urefprebreak \#\urefpostbreak}
3104 \def\urefcodequest{\urefprebreak ?\urefpostbreak}
3105 \def\urefcodeslash{\futurelet\next\urefcodeslashfinish}
3108 \global\def\urefcodeslashfinish{%
3109 \urefprebreak \slashChar
3110 % Allow line break only after the final / in a sequence of
3111 % slashes, to avoid line break between the slashes in http://.
3112 \ifx\next/\else \urefpostbreak \fi
3116 % By default we'll break after the special characters, but some people like to
3117 % break before the special chars, so allow that. Also allow no breaking at
3118 % all, for manual control.
3120 \parseargdef\urefbreakstyle{%
3122 \ifx\txiarg\wordnone
3123 \def\urefprebreak{\nobreak}\def\urefpostbreak{\nobreak}
3124 \else\ifx\txiarg\wordbefore
3125 \def\urefprebreak{\urefallowbreak}\def\urefpostbreak{\nobreak}
3126 \else\ifx\txiarg\wordafter
3127 \def\urefprebreak{\nobreak}\def\urefpostbreak{\urefallowbreak}
3129 \errhelp = \EMsimple
3130 \errmessage{Unknown @urefbreakstyle setting `\txiarg'}%
3133 \def\wordafter{after}
3134 \def\wordbefore{before}
3137 % Allow a ragged right output to aid breaking long URL's. There can
3138 % be a break at the \allowbreak with no extra glue (if the existing stretch in
3139 % the line is sufficient), a break at the \penalty with extra glue added
3140 % at the end of the line, or no break at all here.
3141 % Changing the value of the penalty and/or the amount of stretch affects how
3142 % preferable one choice is over the other.
3143 \def\urefallowbreak{%
3145 \hskip 0pt plus 2 em\relax
3147 \hskip 0pt plus -2 em\relax
3150 \urefbreakstyle after
3152 % @url synonym for @uref, since that's how everyone uses it.
3156 % rms does not like angle brackets --karl, 17may97.
3157 % So now @email is just like @uref, unless we are pdf.
3159 %\def\email#1{\angleleft{\tt #1}\angleright}
3161 \def\email#1{\doemail#1,,\finish}
3162 \def\doemail#1,#2,#3\finish{\begingroup
3165 \setbox0 = \hbox{\ignorespaces #2}%
3166 \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi
3173 % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
3174 % `example' (@kbd uses ttsl only inside of @example and friends),
3175 % or `code' (@kbd uses normal tty font always).
3176 \parseargdef\kbdinputstyle{%
3178 \ifx\txiarg\worddistinct
3179 \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
3180 \else\ifx\txiarg\wordexample
3181 \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
3182 \else\ifx\txiarg\wordcode
3183 \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
3185 \errhelp = \EMsimple
3186 \errmessage{Unknown @kbdinputstyle setting `\txiarg'}%
3189 \def\worddistinct{distinct}
3190 \def\wordexample{example}
3193 % Default is `distinct'.
3194 \kbdinputstyle distinct
3197 \tclose{\kbdfont\setcodequotes#1}%
3200 % definition of @key that produces a lozenge. Doesn't adjust to text size.
3201 %\setfont\keyrm\rmshape{8}{1000}{OT1}
3203 %\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{%
3204 % \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
3205 % \vbox{\hrule\kern-0.4pt
3206 % \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
3207 % \kern-0.4pt\hrule}%
3208 % \kern-.06em\raise0.4pt\hbox{\angleright}}}}
3210 % definition of @key with no lozenge.
3212 \def\key#1{{\setregularquotes \tt #1}\null}
3214 % @clicksequence{File @click{} Open ...}
3215 \def\clicksequence#1{\begingroup #1\endgroup}
3217 % @clickstyle @arrow (by default)
3218 \parseargdef\clickstyle{\def\click{#1}}
3221 % Typeset a dimension, e.g., `in' or `pt'. The only reason for the
3222 % argument is to make the input look right: @dmn{pt} instead of @dmn{}pt.
3224 \def\dmn#1{\thinspace #1}
3226 % @acronym for "FBI", "NATO", and the like.
3227 % We print this one point size smaller, since it's intended for
3230 \def\acronym#1{\doacronym #1,,\finish}
3231 \def\doacronym#1,#2,#3\finish{%
3232 {\switchtolsize #1}%
3234 \ifx\temp\empty \else
3235 \space ({\unsepspaces \ignorespaces \temp \unskip})%
3237 \null % reset \spacefactor=1000
3240 % @abbr for "Comput. J." and the like.
3241 % No font change, but don't do end-of-sentence spacing.
3243 \def\abbr#1{\doabbr #1,,\finish}
3244 \def\doabbr#1,#2,#3\finish{%
3245 {\plainfrenchspacing #1}%
3247 \ifx\temp\empty \else
3248 \space ({\unsepspaces \ignorespaces \temp \unskip})%
3250 \null % reset \spacefactor=1000
3253 % @asis just yields its argument. Used with @table, for example.
3257 % @math outputs its argument in math mode.
3259 % One complication: _ usually means subscripts, but it could also mean
3260 % an actual _ character, as in @math{@var{some_variable} + 1}. So make
3261 % _ active, and distinguish by seeing if the current family is \slfam,
3262 % which is what @var uses.
3264 \catcode`\_ = \active
3265 \gdef\mathunderscore{%
3267 \def_{\ifnum\fam=\slfam \_\else\sb\fi}%
3270 % Another complication: we want \\ (and @\) to output a math (or tt) \.
3271 % FYI, plain.tex uses \\ as a temporary control sequence (for no
3272 % particular reason), but this is not advertised and we don't care.
3274 % The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.
3275 \def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi}
3278 \ifmmode\else % only go into math if not in math mode already
3281 \let\\ = \mathbackslash
3283 % make the texinfo accent commands work in math mode
3293 % have to provide another name for sup operator
3295 $\expandafter\finishmath\fi
3297 \def\finishmath#1{#1$\endgroup} % Close the group opened by \tex.
3299 % Some active characters (such as <) are spaced differently in math.
3300 % We have to reset their definitions in case the @math was an argument
3301 % to a command which sets the catcodes (such as @item or @section).
3304 \catcode`^ = \active
3305 \catcode`< = \active
3306 \catcode`> = \active
3307 \catcode`+ = \active
3308 \catcode`' = \active
3314 \let' = \ptexquoteright
3318 % for @sub and @sup, if in math mode, just do a normal sub/superscript.
3319 % If in text, use math to place as sub/superscript, but switch
3320 % into text mode, with smaller fonts. This is a different font than the
3321 % one used for real math sub/superscripts (8pt vs. 7pt), but let's not
3322 % fix it (significant additions to font machinery) until someone notices.
3324 \def\sub{\ifmmode \expandafter\sb \else \expandafter\finishsub\fi}
3325 \def\finishsub#1{$\sb{\hbox{\switchtolllsize #1}}$}%
3327 \def\sup{\ifmmode \expandafter\ptexsp \else \expandafter\finishsup\fi}
3328 \def\finishsup#1{$\ptexsp{\hbox{\switchtolllsize #1}}$}%
3330 % provide this command from LaTeX as it is very common
3331 \def\frac#1#2{{{#1}\over{#2}}}
3334 % \globaldefs is needed to recognize the end lines in \tex and
3335 % \end tex. Set \thisenv as @end displaymath is seen before @end tex.
3338 \envdef\displaymath{%
3340 \def\thisenv{\displaymath}%
3341 \begingroup\let\end\displaymathend%
3345 \def\displaymathend{$$\endgroup\end}%
3353 % @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}.
3354 % Ignore unless FMTNAME == tex; then it is like @iftex and @tex,
3355 % except specified as a normal braced arg, so no newlines to worry about.
3357 \def\outfmtnametex{tex}
3359 \long\def\inlinefmt#1{\doinlinefmt #1,\finish}
3360 \long\def\doinlinefmt#1,#2,\finish{%
3361 \def\inlinefmtname{#1}%
3362 \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\fi
3365 % @inlinefmtifelse{FMTNAME,THEN-TEXT,ELSE-TEXT} expands THEN-TEXT if
3366 % FMTNAME is tex, else ELSE-TEXT.
3367 \long\def\inlinefmtifelse#1{\doinlinefmtifelse #1,,,\finish}
3368 \long\def\doinlinefmtifelse#1,#2,#3,#4,\finish{%
3369 \def\inlinefmtname{#1}%
3370 \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\else \ignorespaces #3\fi
3373 % For raw, must switch into @tex before parsing the argument, to avoid
3374 % setting catcodes prematurely. Doing it this way means that, for
3375 % example, @inlineraw{html, foo{bar} gets a parse error instead of being
3376 % ignored. But this isn't important because if people want a literal
3377 % *right* brace they would have to use a command anyway, so they may as
3378 % well use a command to get a left brace too. We could re-use the
3379 % delimiter character idea from \verb, but it seems like overkill.
3381 \long\def\inlineraw{\tex \doinlineraw}
3382 \long\def\doinlineraw#1{\doinlinerawtwo #1,\finish}
3383 \def\doinlinerawtwo#1,#2,\finish{%
3384 \def\inlinerawname{#1}%
3385 \ifx\inlinerawname\outfmtnametex \ignorespaces #2\fi
3386 \endgroup % close group opened by \tex.
3389 % @inlineifset{VAR, TEXT} expands TEXT if VAR is @set.
3391 \long\def\inlineifset#1{\doinlineifset #1,\finish}
3392 \long\def\doinlineifset#1,#2,\finish{%
3393 \def\inlinevarname{#1}%
3394 \expandafter\ifx\csname SET\inlinevarname\endcsname\relax
3395 \else\ignorespaces#2\fi
3398 % @inlineifclear{VAR, TEXT} expands TEXT if VAR is not @set.
3400 \long\def\inlineifclear#1{\doinlineifclear #1,\finish}
3401 \long\def\doinlineifclear#1,#2,\finish{%
3402 \def\inlinevarname{#1}%
3403 \expandafter\ifx\csname SET\inlinevarname\endcsname\relax \ignorespaces#2\fi
3410 % @@ prints an @, as does @atchar{}.
3414 % @{ @} @lbracechar{} @rbracechar{} all generate brace characters.
3415 \def\lbracechar{{\ifusingtt{\char123}{\ensuremath\lbrace}}}
3416 \def\rbracechar{{\ifusingtt{\char125}{\ensuremath\rbrace}}}
3420 % @comma{} to avoid , parsing problems.
3423 % Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
3424 % Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H.
3426 \let\dotaccent = \ptexdot
3427 \def\ringaccent#1{{\accent23 #1}}
3428 \let\tieaccent = \ptext
3429 \let\ubaraccent = \ptexb
3430 \let\udotaccent = \d
3432 % Other special characters: @questiondown @exclamdown @ordf @ordm
3433 % Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
3434 \def\questiondown{?`}
3436 \def\ordf{\leavevmode\raise1ex\hbox{\switchtolllsize \underbar{a}}}
3437 \def\ordm{\leavevmode\raise1ex\hbox{\switchtolllsize \underbar{o}}}
3439 % Dotless i and dotless j, used for accents.
3444 \ifx\temp\imacro \ifmmode\imath \else\ptexi \fi
3445 \else\ifx\temp\jmacro \ifmmode\jmath \else\j \fi
3446 \else \errmessage{@dotless can be used only with i or j}%
3450 % The \TeX{} logo, as in plain, but resetting the spacing so that a
3451 % period following counts as ending a sentence. (Idea found in latex.)
3453 \edef\TeX{\TeX \spacefactor=1000 }
3455 % @LaTeX{} logo. Not quite the same results as the definition in
3456 % latex.ltx, since we use a different font for the raised A; it's most
3457 % convenient for us to use an explicitly smaller font, rather than using
3458 % the \scriptstyle font (since we don't reset \scriptstyle and
3459 % \scriptscriptstyle).
3464 \vbox to \ht0{\hbox{%
3465 \ifx\textnominalsize\xwordpt
3466 % for 10pt running text, lllsize (8pt) is too small for the A in LaTeX.
3467 % Revert to plain's \scriptsize, which is 7pt.
3468 \count255=\the\fam $\fam\count255 \scriptstyle A$%
3470 \ifx\curfontsize\smallword
3471 % For footnotes and indices
3472 \count255=\the\fam $\fam\count255 \scriptstyle A$%
3474 % For 11pt, we can use our lllsize.
3484 \def\smallword{small}
3486 % Some math mode symbols. Define \ensuremath to switch into math mode
3487 % unless we are already there. Expansion tricks may not be needed here,
3488 % but safer, and can't hurt.
3489 \def\ensuremath{\ifmmode \expandafter\asis \else\expandafter\ensuredmath \fi}
3490 \def\ensuredmath#1{$\relax#1$}
3492 \def\bullet{\ensuremath\ptexbullet}
3493 \def\geq{\ensuremath\ge}
3494 \def\leq{\ensuremath\le}
3495 \def\minus{\ensuremath-}
3497 % @dots{} outputs an ellipsis using the current font.
3498 % We do .5em per period so that it has the same spacing in the cm
3499 % typewriter fonts as three actual period characters; on the other hand,
3500 % in other typewriter fonts three periods are wider than 1.5em. So do
3501 % whichever is larger.
3505 \setbox0=\hbox{...}% get width of three periods
3512 \hskip 0pt plus.25fil
3513 .\hskip 0pt plus1fil
3514 .\hskip 0pt plus1fil
3515 .\hskip 0pt plus.5fil
3519 % @enddots{} is an end-of-sentence ellipsis.
3523 \spacefactor=\endofsentencespacefactor
3526 % @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
3528 % Since these characters are used in examples, they should be an even number of
3529 % \tt widths. Each \tt character is 1en, so two makes it 1em.
3532 \def\arrow{\leavevmode\raise.05ex\hbox to 1em{\hfil$\rightarrow$\hfil}}
3533 \def\result{\leavevmode\raise.05ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}
3534 \def\expansion{\leavevmode\hbox to 1em{\hfil$\mapsto$\hfil}}
3535 \def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}}
3536 \def\equiv{\leavevmode\hbox to 1em{\hfil$\ptexequiv$\hfil}}
3538 % The @error{} command.
3539 % Adapted from the TeXbook's \boxit.
3543 {\ttfont \global\dimen0 = 3em}% Width of the box.
3544 \dimen2 = .55pt % Thickness of rules
3545 % The text. (`r' is open on the right, `e' somewhat less so on the left.)
3546 \setbox0 = \hbox{\kern-.75pt \reducedsf \putworderror\kern-1.5pt}
3548 \setbox\errorbox=\hbox to \dimen0{\hfil
3549 \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
3550 \advance\hsize by -2\dimen2 % Rules.
3552 \hrule height\dimen2
3553 \hbox{\vrule width\dimen2 \kern3pt % Space to left of text.
3554 \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below.
3555 \kern3pt\vrule width\dimen2}% Space to right.
3556 \hrule height\dimen2}
3559 \def\error{\leavevmode\lower.7ex\copy\errorbox}
3561 % @pounds{} is a sterling sign, which Knuth put in the CM italic font.
3563 \def\pounds{{\ifusingtt{\ecfont\char"BF}{\it\$}}}
3565 % @euro{} comes from a separate font, depending on the current style.
3566 % We use the free feym* fonts from the eurosym package by Henrik
3567 % Theiling, which support regular, slanted, bold and bold slanted (and
3568 % "outlined" (blackboard board, sort of) versions, which we don't need).
3569 % It is available from http://www.ctan.org/tex-archive/fonts/eurosym.
3571 % Although only regular is the truly official Euro symbol, we ignore
3572 % that. The Euro is designed to be slightly taller than the regular
3578 % feybo - bold slanted
3580 % There is no good (free) typewriter version, to my knowledge.
3581 % A feymr10 euro is ~7.3pt wide, while a normal cmtt10 char is ~5.25pt wide.
3584 % Also doesn't work in math. Do we need to do math with euro symbols?
3588 \def\euro{{\eurofont e}}
3590 % We set the font at each command, rather than predefining it in
3591 % \textfonts and the other font-switching commands, so that
3592 % installations which never need the symbol don't have to have the
3595 % There is only one designed size (nominal 10pt), so we always scale
3596 % that to the current nominal size.
3598 % By the way, simply using "at 1em" works for cmr10 and the like, but
3599 % does not work for cmbx10 and other extended/shrunken fonts.
3601 \def\eurosize{\csname\curfontsize nominalsize\endcsname}%
3603 \ifx\curfontstyle\bfstylename
3605 \font\thiseurofont = \ifusingit{feybo10}{feybr10} at \eurosize
3608 \font\thiseurofont = \ifusingit{feymo10}{feymr10} at \eurosize
3613 % Glyphs from the EC fonts. We don't use \let for the aliases, because
3614 % sometimes we redefine the original macro, and the alias should reflect
3617 % Use LaTeX names for the Icelandic letters.
3618 \def\DH{{\ecfont \char"D0}} % Eth
3619 \def\dh{{\ecfont \char"F0}} % eth
3620 \def\TH{{\ecfont \char"DE}} % Thorn
3621 \def\th{{\ecfont \char"FE}} % thorn
3623 \def\guillemetleft{{\ecfont \char"13}}
3624 \def\guillemotleft{\guillemetleft}
3625 \def\guillemetright{{\ecfont \char"14}}
3626 \def\guillemotright{\guillemetright}
3627 \def\guilsinglleft{{\ecfont \char"0E}}
3628 \def\guilsinglright{{\ecfont \char"0F}}
3629 \def\quotedblbase{{\ecfont \char"12}}
3630 \def\quotesinglbase{{\ecfont \char"0D}}
3632 \def\L{{\ecfont \char"8A}} % L with stroke
3633 \def\l{{\ecfont \char"AA}} % l with stroke
3635 % This positioning is not perfect (see the ogonek LaTeX package), but
3636 % we have the precomposed glyphs for the most common cases. We put the
3637 % tests to use those glyphs in the single \ogonek macro so we have fewer
3638 % dummy definitions to worry about for index entries, etc.
3640 % ogonek is also used with other letters in Lithuanian (IOU), but using
3641 % the precomposed glyphs for those is not so easy since they aren't in
3645 \ifx\temp\macrocharA\Aogonek
3646 \else\ifx\temp\macrochara\aogonek
3647 \else\ifx\temp\macrocharE\Eogonek
3648 \else\ifx\temp\macrochare\eogonek
3650 \ecfont \setbox0=\hbox{#1}%
3651 \ifdim\ht0=1ex\accent"0C #1%
3652 \else\ooalign{\unhbox0\crcr\hidewidth\char"0C \hidewidth}%
3657 \def\Aogonek{{\ecfont \char"81}}\def\macrocharA{A}
3658 \def\aogonek{{\ecfont \char"A1}}\def\macrochara{a}
3659 \def\Eogonek{{\ecfont \char"86}}\def\macrocharE{E}
3660 \def\eogonek{{\ecfont \char"A6}}\def\macrochare{e}
3662 % Use the European Computer Modern fonts (cm-super in outline format)
3663 % for non-CM glyphs. That is ec* for regular text and tc* for the text
3664 % companion symbols (LaTeX TS1 encoding). Both are part of the ec
3665 % package and follow the same conventions.
3667 \def\ecfont{\etcfont{e}}
3668 \def\tcfont{\etcfont{t}}
3671 % We can't distinguish serif/sans and italic/slanted, but this
3672 % is used for crude hacks anyway (like adding French and German
3673 % quotes to documents typeset with CM, where we lose kerning), so
3674 % hopefully nobody will notice/care.
3675 \edef\ecsize{\csname\curfontsize ecsize\endcsname}%
3676 \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}%
3679 {\font\thisecfont = #1ctt\ecsize \space at \nominalsize}%
3681 {\ifx\curfontstyle\bfstylename
3683 \font\thisecfont = #1cb\ifusingit{i}{x}\ecsize \space at \nominalsize
3686 \font\thisecfont = #1c\ifusingit{ti}{rm}\ecsize \space at \nominalsize
3691 % @registeredsymbol - R in a circle. The font for the R should really
3692 % be smaller yet, but lllsize is the best we can do for now.
3693 % Adapted from the plain.tex definition of \copyright.
3695 \def\registeredsymbol{%
3696 $^{{\ooalign{\hfil\raise.07ex\hbox{\switchtolllsize R}%
3701 % @textdegree - the normal degrees sign.
3705 \else {\tcfont \char 176}%
3708 % Laurent Siebenmann reports \Orb undefined with:
3709 % Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38
3710 % so we'll define it if necessary.
3712 \ifx\Orb\thisisundefined
3713 \def\Orb{\mathhexbox20D}
3717 \chardef\quoteleft=`\`
3718 \chardef\quoteright=`\'
3720 % only change font for tt for correct kerning and to avoid using
3721 % \ecfont unless necessary.
3723 \ifusingtt{{\ecfont\char"10}}{{\char"5C}}%
3726 \def\quotedblright{%
3727 \ifusingtt{{\ecfont\char"11}}{{\char`\"}}%
3731 \message{page headings,}
3733 \newskip\titlepagetopglue \titlepagetopglue = 1.5in
3734 \newskip\titlepagebottomglue \titlepagebottomglue = 2pc
3736 % First the title page. Must do @settitle before @titlepage.
3738 \newif\iffinishedtitlepage
3740 % @setcontentsaftertitlepage used to do an implicit @contents or
3741 % @shortcontents after @end titlepage, but it is now obsolete.
3742 \def\setcontentsaftertitlepage{%
3743 \errmessage{@setcontentsaftertitlepage has been removed as a Texinfo
3744 command; move your @contents command if you want the contents
3745 after the title page.}}%
3746 \def\setshortcontentsaftertitlepage{%
3747 \errmessage{@setshortcontentsaftertitlepage has been removed as a Texinfo
3748 command; move your @shortcontents and @contents commands if you
3749 want the contents after the title page.}}%
3751 \parseargdef\shorttitlepage{%
3752 {\headingsoff \begingroup \hbox{}\vskip 1.5in \chaprm \centerline{#1}%
3753 \endgroup\page\hbox{}\page}\pageone}
3756 % Open one extra group, as we want to close it in the middle of \Etitlepage.
3758 \parindent=0pt \textfonts
3760 % Leave some space at the very top of the page.
3761 \vglue\titlepagetopglue
3762 % No rule at page bottom unless we print one at the top with @title.
3763 \finishedtitlepagetrue
3765 % Most title ``pages'' are actually two pages long, with space
3766 % at the top of the second. We don't want the ragged left on the second.
3767 \let\oldpage = \page
3769 \iffinishedtitlepage\else
3772 \let\page = \oldpage
3779 \iffinishedtitlepage\else
3782 % It is important to do the page break before ending the group,
3783 % because the headline and footline are only empty inside the group.
3784 % If we use the new definition of \page, we always get a blank page
3785 % after the title page, which we certainly don't want.
3792 \def\finishtitlepage{%
3793 \vskip4pt \hrule height 2pt width \hsize
3794 \vskip\titlepagebottomglue
3795 \finishedtitlepagetrue
3798 % Settings used for typesetting titles: no hyphenation, no indentation,
3799 % don't worry much about spacing, ragged right. This should be used
3800 % inside a \vbox, and fonts need to be set appropriately first. \par should
3801 % be specified before the end of the \vbox, since a vbox is a group.
3803 \def\raggedtitlesettings{%
3805 \hyphenpenalty=10000
3811 % Macros to be used within @titlepage:
3813 \let\subtitlerm=\rmfont
3814 \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}
3816 \parseargdef\title{%
3818 \vbox{\titlefonts \raggedtitlesettings #1\par}%
3819 % print a rule at the page bottom also.
3820 \finishedtitlepagefalse
3821 \vskip4pt \hrule height 4pt width \hsize \vskip4pt
3824 \parseargdef\subtitle{%
3826 {\subtitlefont \rightline{#1}}%
3829 % @author should come last, but may come many times.
3830 % It can also be used inside @quotation.
3832 \parseargdef\author{%
3833 \def\temp{\quotation}%
3835 \def\quotationauthor{#1}% printed in \Equotation.
3838 \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi
3839 {\secfonts\rm \leftline{#1}}%
3844 % Set up page headings and footings.
3846 \let\thispage=\folio
3848 \newtoks\evenheadline % headline on even pages
3849 \newtoks\oddheadline % headline on odd pages
3850 \newtoks\evenchapheadline% headline on even pages with a new chapter
3851 \newtoks\oddchapheadline % headline on odd pages with a new chapter
3852 \newtoks\evenfootline % footline on even pages
3853 \newtoks\oddfootline % footline on odd pages
3855 % Now make \makeheadline and \makefootline in Plain TeX use those variables
3856 \headline={{\textfonts\rm\frenchspacingsetting
3858 \ifodd\pageno\the\oddchapheadline\else\the\evenchapheadline\fi
3860 \ifodd\pageno\the\oddheadline\else\the\evenheadline\fi
3863 \footline={{\textfonts\rm\frenchspacingsetting
3864 \ifodd\pageno \the\oddfootline \else \the\evenfootline \fi}%
3866 \let\HEADINGShook=\relax
3868 % Commands to set those variables.
3869 % For example, this is what @headings on does
3870 % @evenheading @thistitle|@thispage|@thischapter
3871 % @oddheading @thischapter|@thispage|@thistitle
3872 % @evenfooting @thisfile||
3873 % @oddfooting ||@thisfile
3876 \def\evenheading{\parsearg\evenheadingxxx}
3877 \def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish}
3878 \def\evenheadingyyy #1\|#2\|#3\|#4\finish{%
3879 \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}
3880 \global\evenchapheadline=\evenheadline}
3882 \def\oddheading{\parsearg\oddheadingxxx}
3883 \def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish}
3884 \def\oddheadingyyy #1\|#2\|#3\|#4\finish{%
3885 \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}%
3886 \global\oddchapheadline=\oddheadline}
3888 \parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}%
3890 \def\evenfooting{\parsearg\evenfootingxxx}
3891 \def\evenfootingxxx #1{\evenfootingyyy #1\|\|\|\|\finish}
3892 \def\evenfootingyyy #1\|#2\|#3\|#4\finish{%
3893 \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
3895 \def\oddfooting{\parsearg\oddfootingxxx}
3896 \def\oddfootingxxx #1{\oddfootingyyy #1\|\|\|\|\finish}
3897 \def\oddfootingyyy #1\|#2\|#3\|#4\finish{%
3898 \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}%
3900 % Leave some space for the footline. Hopefully ok to assume
3901 % @evenfooting will not be used by itself.
3902 \global\advance\txipageheight by -12pt
3903 \global\advance\vsize by -12pt
3906 \parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}}
3908 % @evenheadingmarks top \thischapter <- chapter at the top of a page
3909 % @evenheadingmarks bottom \thischapter <- chapter at the bottom of a page
3911 % The same set of arguments for:
3916 % @everyheadingmarks
3917 % @everyfootingmarks
3919 % These define \getoddheadingmarks, \getevenheadingmarks,
3920 % \getoddfootingmarks, and \getevenfootingmarks, each to one of
3921 % \gettopheadingmarks, \getbottomheadingmarks.
3923 \def\evenheadingmarks{\headingmarks{even}{heading}}
3924 \def\oddheadingmarks{\headingmarks{odd}{heading}}
3925 \def\evenfootingmarks{\headingmarks{even}{footing}}
3926 \def\oddfootingmarks{\headingmarks{odd}{footing}}
3927 \parseargdef\everyheadingmarks{\headingmarks{even}{heading}{#1}
3928 \headingmarks{odd}{heading}{#1} }
3929 \parseargdef\everyfootingmarks{\headingmarks{even}{footing}{#1}
3930 \headingmarks{odd}{footing}{#1} }
3931 % #1 = even/odd, #2 = heading/footing, #3 = top/bottom.
3932 \def\headingmarks#1#2#3 {%
3933 \expandafter\let\expandafter\temp \csname get#3headingmarks\endcsname
3934 \global\expandafter\let\csname get#1#2marks\endcsname \temp
3937 \everyheadingmarks bottom
3938 \everyfootingmarks bottom
3940 % @headings double turns headings on for double-sided printing.
3941 % @headings single turns headings on for single-sided printing.
3942 % @headings off turns them off.
3943 % @headings on same as @headings double, retained for compatibility.
3944 % @headings after turns on double-sided headings after this page.
3945 % @headings doubleafter turns on double-sided headings after this page.
3946 % @headings singleafter turns on single-sided headings after this page.
3947 % By default, they are off at the start of a document,
3948 % and turned `on' after @end titlepage.
3950 \parseargdef\headings{\csname HEADINGS#1\endcsname}
3952 \def\headingsoff{% non-global headings elimination
3953 \evenheadline={\hfil}\evenfootline={\hfil}\evenchapheadline={\hfil}%
3954 \oddheadline={\hfil}\oddfootline={\hfil}\oddchapheadline={\hfil}%
3957 \def\HEADINGSoff{{\globaldefs=1 \headingsoff}} % global setting
3959 % Set the page number to 1.
3962 \global\arabiccount = \pagecount
3965 \let\contentsalignmacro = \chappager
3967 % \def\HEADINGSon{\HEADINGSdouble} % defined by \CHAPPAGon
3969 % For double-sided printing, put current file name in lower left corner,
3970 % chapter name on inside top of right hand pages, document
3971 % title on inside top of left hand pages, and page numbers on outside top
3972 % edge of all pages.
3973 \def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdouble}
3974 \let\HEADINGSdoubleafter=\HEADINGSafter
3975 \def\HEADINGSdouble{%
3976 \global\evenfootline={\hfil}
3977 \global\oddfootline={\hfil}
3978 \global\evenheadline={\line{\folio\hfil\thistitle}}
3979 \global\oddheadline={\line{\thischapter\hfil\folio}}
3980 \global\evenchapheadline={\line{\folio\hfil\thistitle}}
3981 \global\oddchapheadline={\line{\hfil\folio}}
3982 \global\let\contentsalignmacro = \chapoddpage
3985 % For single-sided printing, chapter title goes across top left of page,
3986 % page number on top right.
3987 \def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsingle}
3988 \def\HEADINGSsingle{%
3989 \global\evenfootline={\hfil}
3990 \global\oddfootline={\hfil}
3991 \global\evenheadline={\line{\thischapter\hfil\folio}}
3992 \global\oddheadline={\line{\thischapter\hfil\folio}}
3993 \global\evenchapheadline={\line{\hfil\folio}}
3994 \global\oddchapheadline={\line{\hfil\folio}}
3995 \global\let\contentsalignmacro = \chappager
3998 % for @setchapternewpage off
3999 \def\HEADINGSsinglechapoff{%
4000 \global\evenfootline={\hfil}
4001 \global\oddfootline={\hfil}
4002 \global\evenheadline={\line{\thischapter\hfil\folio}}
4003 \global\oddheadline={\line{\thischapter\hfil\folio}}
4004 \global\evenchapheadline=\evenheadline
4005 \global\oddchapheadline=\oddheadline
4006 \global\let\contentsalignmacro = \chappager
4009 % Subroutines used in generating headings
4010 % This produces Day Month Year style of output.
4011 % Only define if not already defined, in case a txi-??.tex file has set
4012 % up a different format (e.g., txi-cs.tex does this).
4013 \ifx\today\thisisundefined
4017 \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr
4018 \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug
4019 \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec
4024 % @settitle line... specifies the title of the document, for headings.
4025 % It generates no output of its own.
4026 \def\thistitle{\putwordNoTitle}
4027 \def\settitle{\parsearg{\gdef\thistitle}}
4031 % Tables -- @table, @ftable, @vtable, @item(x).
4033 % default indentation of table text
4034 \newdimen\tableindent \tableindent=.8in
4035 % default indentation of @itemize and @enumerate text
4036 \newdimen\itemindent \itemindent=.3in
4037 % margin between end of table item and start of table text.
4038 \newdimen\itemmargin \itemmargin=.1in
4040 % used internally for \itemindent minus \itemmargin
4043 % Note @table, @ftable, and @vtable define @item, @itemx, etc., with
4045 % They also define \itemindex
4046 % to index the item name in whatever manner is desired (perhaps none).
4048 \newif\ifitemxneedsnegativevskip
4050 \def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi}
4052 \def\internalBitem{\smallbreak \parsearg\itemzzz}
4053 \def\internalBitemx{\itemxpar \parsearg\itemzzz}
4055 \def\itemzzz #1{\begingroup %
4056 \advance\hsize by -\rightskip
4057 \advance\hsize by -\tableindent
4058 \setbox0=\hbox{\itemindicate{#1}}%
4060 \nobreak % This prevents a break before @itemx.
4062 % If the item text does not fit in the space we have, put it on a line
4063 % by itself, and do not allow a page break either before or after that
4064 % line. We do not start a paragraph here because then if the next
4065 % command is, e.g., @kindex, the whatsit would get put into the
4066 % horizontal list on a line by itself, resulting in extra blank space.
4067 \ifdim \wd0>\itemmax
4069 % Make this a paragraph so we get the \parskip glue and wrapping,
4070 % but leave it ragged-right.
4072 \advance\leftskip by-\tableindent
4073 \advance\hsize by\tableindent
4074 \advance\rightskip by0pt plus1fil\relax
4075 \leavevmode\unhbox0\par
4078 % We're going to be starting a paragraph, but we don't want the
4079 % \parskip glue -- logically it's part of the @item we just started.
4080 \nobreak \vskip-\parskip
4082 % Stop a page break at the \parskip glue coming up. However, if
4083 % what follows is an environment such as @example, there will be no
4084 % \parskip glue; then the negative vskip we just inserted would
4085 % cause the example and the item to crash together. So we use this
4086 % bizarre value of 10001 as a signal to \aboveenvbreak to insert
4087 % \parskip glue after all. Section titles are handled this way also.
4091 \itemxneedsnegativevskipfalse
4093 % The item text fits into the space. Start a paragraph, so that the
4094 % following text (if any) will end up on the same line.
4096 % Do this with kerns and \unhbox so that if there is a footnote in
4097 % the item text, it can migrate to the main vertical list and
4098 % eventually be printed.
4099 \nobreak\kern-\tableindent
4100 \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0
4102 \nobreak\kern\dimen0
4104 \itemxneedsnegativevskiptrue
4108 \def\item{\errmessage{@item while not in a list environment}}
4109 \def\itemx{\errmessage{@itemx while not in a list environment}}
4111 % @table, @ftable, @vtable.
4113 \let\itemindex\gobble
4117 \def\itemindex ##1{\doind {fn}{\code{##1}}}%
4118 \tablecheck{ftable}%
4121 \def\itemindex ##1{\doind {vr}{\code{##1}}}%
4122 \tablecheck{vtable}%
4125 \ifnum \the\catcode`\^^M=\active
4127 \errmessage{This command won't work in this context; perhaps the problem is
4128 that we are \inenvironment\thisenv}%
4129 \def\next{\doignore{#1}}%
4136 \def\itemindicate{#1}%
4141 \makevalueexpandable
4142 \edef\temp{\noexpand\tablez #1\space\space\space}%
4146 \def\tablez #1 #2 #3 #4\endtablez{%
4148 \ifnum 0#1>0 \advance \leftskip by #1\mil \fi
4149 \ifnum 0#2>0 \tableindent=#2\mil \fi
4150 \ifnum 0#3>0 \advance \rightskip by #3\mil \fi
4151 \itemmax=\tableindent
4152 \advance \itemmax by -\itemmargin
4153 \advance \leftskip by \tableindent
4154 \exdentamount=\tableindent
4156 \parskip = \smallskipamount
4157 \ifdim \parskip=0pt \parskip=2pt \fi
4158 \let\item = \internalBitem
4159 \let\itemx = \internalBitemx
4161 \def\Etable{\endgraf\afterenvbreak}
4164 \let\Eitemize\Etable
4165 \let\Eenumerate\Etable
4167 % This is the counter used by @enumerate, which is really @itemize
4171 \envdef\itemize{\parsearg\doitemize}
4175 \itemmax=\itemindent
4176 \advance\itemmax by -\itemmargin
4177 \advance\leftskip by \itemindent
4178 \exdentamount=\itemindent
4180 \parskip=\smallskipamount
4181 \ifdim\parskip=0pt \parskip=2pt \fi
4183 % Try typesetting the item mark so that if the document erroneously says
4184 % something like @itemize @samp (intending @table), there's an error
4185 % right away at the @itemize. It's not the best error message in the
4186 % world, but it's better than leaving it to the @item. This means if
4187 % the user wants an empty mark, they have to say @w{} not just @w.
4188 \def\itemcontents{#1}%
4189 \setbox0 = \hbox{\itemcontents}%
4191 % @itemize with no arg is equivalent to @itemize @bullet.
4192 \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi
4194 \let\item=\itemizeitem
4197 % Definition of @item while inside @itemize and @enumerate.
4200 \advance\itemno by 1 % for enumerations
4201 {\let\par=\endgraf \smallbreak}% reasonable place to break
4203 % If the document has an @itemize directly after a section title, a
4204 % \nobreak will be last on the list, and \sectionheading will have
4205 % done a \vskip-\parskip. In that case, we don't want to zero
4206 % parskip, or the item text will crash with the heading. On the
4207 % other hand, when there is normal text preceding the item (as there
4208 % usually is), we do want to zero parskip, or there would be too much
4209 % space. In that case, we won't have a \nobreak before. At least
4210 % that's the theory.
4211 \ifnum\lastpenalty<10000 \parskip=0in \fi
4213 \hbox to 0pt{\hss \itemcontents \kern\itemmargin}%
4216 \vadjust{\penalty 1200}% not good to break after first line of item.
4218 % We can be in inner vertical mode in a footnote, although an
4219 % @itemize looks awful there.
4224 % \splitoff TOKENS\endmark defines \first to be the first token in
4225 % TOKENS, and \rest to be the remainder.
4227 \def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
4229 % Allow an optional argument of an uppercase letter, lowercase letter,
4230 % or number, to specify the first label in the enumerated list. No
4231 % argument is the same as `1'.
4233 \envparseargdef\enumerate{\enumeratey #1 \endenumeratey}
4234 \def\enumeratey #1 #2\endenumeratey{%
4235 % If we were given no argument, pretend we were given `1'.
4237 \ifx\thearg\empty \def\thearg{1}\fi
4239 % Detect if the argument is a single token. If so, it might be a
4240 % letter. Otherwise, the only valid thing it can be is a number.
4241 % (We will always have one token, because of the test we just made.
4242 % This is a good thing, since \splitoff doesn't work given nothing at
4243 % all -- the first parameter is undelimited.)
4244 \expandafter\splitoff\thearg\endmark
4246 % Only one token in the argument. It could still be anything.
4247 % A ``lowercase letter'' is one whose \lccode is nonzero.
4248 % An ``uppercase letter'' is one whose \lccode is both nonzero, and
4249 % not equal to itself.
4250 % Otherwise, we assume it's a number.
4252 % We need the \relax at the end of the \ifnum lines to stop TeX from
4253 % continuing to look for a <number>.
4255 \ifnum\lccode\expandafter`\thearg=0\relax
4256 \numericenumerate % a number (we hope)
4259 \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax
4260 \lowercaseenumerate % lowercase letter
4262 \uppercaseenumerate % uppercase letter
4266 % Multiple tokens in the argument. We hope it's a number.
4271 % An @enumerate whose labels are integers. The starting integer is
4274 \def\numericenumerate{%
4276 \startenumeration{\the\itemno}%
4279 % The starting (lowercase) letter is in \thearg.
4280 \def\lowercaseenumerate{%
4281 \itemno = \expandafter`\thearg
4283 % Be sure we're not beyond the end of the alphabet.
4285 \errmessage{No more lowercase letters in @enumerate; get a bigger
4292 % The starting (uppercase) letter is in \thearg.
4293 \def\uppercaseenumerate{%
4294 \itemno = \expandafter`\thearg
4296 % Be sure we're not beyond the end of the alphabet.
4298 \errmessage{No more uppercase letters in @enumerate; get a bigger
4305 % Call \doitemize, adding a period to the first argument and supplying the
4306 % common last two arguments. Also subtract one from the initial value in
4307 % \itemno, since @item increments \itemno.
4309 \def\startenumeration#1{%
4310 \advance\itemno by -1
4311 \doitemize{#1.}\flushcr
4315 % @multitable macros
4317 % Macros used to set up halign preamble:
4319 \let\endsetuptable\relax
4320 \def\xendsetuptable{\endsetuptable}
4321 \let\columnfractions\relax
4322 \def\xcolumnfractions{\columnfractions}
4325 % #1 is the @columnfraction, usually a decimal number like .5, but might
4326 % be just 1. We just use it, whatever it is.
4328 \def\pickupwholefraction#1 {%
4329 \global\advance\colcount by 1
4330 \expandafter\xdef\csname col\the\colcount\endcsname{#1\hsize}%
4337 \ifx\firstarg\xendsetuptable
4340 \ifx\firstarg\xcolumnfractions
4341 \global\setpercenttrue
4344 \let\go\pickupwholefraction
4346 \global\advance\colcount by 1
4347 \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a
4348 % separator; typically that is always in the input, anyway.
4349 \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
4352 \ifx\go\pickupwholefraction
4353 % Put the argument back for the \pickupwholefraction call, so
4354 % we'll always have a period there to be parsed.
4355 \def\go{\pickupwholefraction#1}%
4357 \let\go = \setuptable
4363 % @headitem starts a heading row, which we typeset in bold. Assignments
4364 % have to be global since we are inside the implicit group of an
4365 % alignment entry. \everycr below resets \everytab so we don't have to
4366 % undo it ourselves.
4367 \def\headitemfont{\b}% for people to use in the template row; not changeable
4369 \crcr % must appear first
4370 \gdef\headitemcrhook{\nobreak}% attempt to avoid page break after headings
4371 \global\everytab={\bf}% can't use \headitemfont since the parsing differs
4372 \the\everytab % for the first item
4375 % default for tables with no headings.
4376 \let\headitemcrhook=\relax
4378 \def\tab{\checkenv\multitable &\the\everytab}%
4380 \newtoks\everytab % insert after every tab.
4382 \envdef\multitable{%
4386 % @item within a multitable starts a normal row.
4387 % We use \def instead of \let so that if one of the multitable entries
4388 % contains an @itemize, we don't choke on the \item (seen as \crcr aka
4389 % \endtemplate) expanding \doitemize.
4401 \global\everytab={}% Reset from possible headitem.
4402 \global\colcount=0 % Reset the column counter.
4404 % Check for saved footnotes, etc.:
4407 % Perhaps a \nobreak, then reset:
4409 \global\let\headitemcrhook=\relax
4413 \parsearg\domultitable
4415 \def\domultitable#1{%
4416 % To parse everything between @multitable and @item:
4417 \setuptable#1 \endsetuptable
4419 % This preamble sets up a generic column definition, which will
4420 % be used as many times as user calls for columns.
4421 % \vtop will set a single line and will also let text wrap and
4422 % continue for many paragraphs if desired.
4424 \global\advance\colcount by 1
4427 \advance\hsize by -1\leftskip
4428 % Find the correct column width
4429 \hsize=\expandafter\csname col\the\colcount\endcsname
4431 \advance\rightskip by -1\rightskip % Zero leaving only any stretch
4433 \advance\hsize by\leftskip % Add indent of surrounding text
4435 % In order to keep entries from bumping into each other.
4438 % If a template has been used
4439 \advance\hsize by \leftskip
4442 \noindent\ignorespaces##\unskip\strut
4447 \egroup % end the \halign
4448 \global\setpercentfalse
4452 \message{conditionals,}
4454 % @iftex, @ifnotdocbook, @ifnothtml, @ifnotinfo, @ifnotlatex, @ifnotplaintext,
4455 % @ifnotxml always succeed. They currently do nothing; we don't
4456 % attempt to check whether the conditionals are properly nested. But we
4457 % have to remember that they are conditionals, so that @end doesn't
4458 % attempt to close an environment group.
4461 \expandafter\let\csname #1\endcsname = \relax
4462 \expandafter\let\csname iscond.#1\endcsname = 1
4465 \makecond{ifnotdocbook}
4466 \makecond{ifnothtml}
4467 \makecond{ifnotinfo}
4468 \makecond{ifnotlatex}
4469 \makecond{ifnotplaintext}
4472 % Ignore @ignore, @ifhtml, @ifinfo, and the like.
4474 \def\direntry{\doignore{direntry}}
4475 \def\documentdescription{\doignore{documentdescription}}
4476 \def\docbook{\doignore{docbook}}
4477 \def\html{\doignore{html}}
4478 \def\ifdocbook{\doignore{ifdocbook}}
4479 \def\ifhtml{\doignore{ifhtml}}
4480 \def\ifinfo{\doignore{ifinfo}}
4481 \def\iflatex{\doignore{iflatex}}
4482 \def\ifnottex{\doignore{ifnottex}}
4483 \def\ifplaintext{\doignore{ifplaintext}}
4484 \def\ifxml{\doignore{ifxml}}
4485 \def\ignore{\doignore{ignore}}
4486 \def\latex{\doignore{latex}}
4487 \def\menu{\doignore{menu}}
4488 \def\xml{\doignore{xml}}
4490 % Ignore text until a line `@end #1', keeping track of nested conditionals.
4492 % A count to remember the depth of nesting.
4493 \newcount\doignorecount
4495 \def\doignore#1{\begingroup
4496 % Scan in ``verbatim'' mode:
4498 \catcode`\@ = \other
4499 \catcode`\{ = \other
4500 \catcode`\} = \other
4502 % Make sure that spaces turn into tokens that match what \doignoretext wants.
4505 % Count number of #1's that we've seen.
4508 % Swallow text until we reach the matching `@end #1'.
4512 { \catcode`_=11 % We want to use \_STOP_ which cannot appear in texinfo source.
4515 \gdef\dodoignore#1{%
4516 % #1 contains the command name as a string, e.g., `ifinfo'.
4518 % Define a command to find the next `@end #1'.
4519 \long\def\doignoretext##1^^M@end #1{%
4520 \doignoretextyyy##1^^M@#1\_STOP_}%
4522 % And this command to find another #1 command, at the beginning of a
4523 % line. (Otherwise, we would consider a line `@c @ifset', for
4524 % example, to count as an @ifset for nesting.)
4525 \long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}%
4527 % And now expand that command.
4532 \def\doignoreyyy#1{%
4534 \ifx\temp\empty % Nothing found.
4535 \let\next\doignoretextzzz
4536 \else % Found a nested condition, ...
4537 \advance\doignorecount by 1
4538 \let\next\doignoretextyyy % ..., look for another.
4539 % If we're here, #1 ends with ^^M\ifinfo (for example).
4541 \next #1% the token \_STOP_ is present just after this macro.
4544 % We have to swallow the remaining "\_STOP_".
4546 \def\doignoretextzzz#1{%
4547 \ifnum\doignorecount = 0 % We have just found the outermost @end.
4548 \let\next\enddoignore
4549 \else % Still inside a nested condition.
4550 \advance\doignorecount by -1
4551 \let\next\doignoretext % Look for the next @end.
4556 % Finish off ignored text.
4558 % Ignore anything after the last `@end #1'; this matters in verbatim
4559 % environments, where otherwise the newline after an ignored conditional
4560 % would result in a blank line in the output.
4561 \gdef\enddoignore#1^^M{\endgroup\ignorespaces}%
4565 % @set VAR sets the variable VAR to an empty value.
4566 % @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
4568 % Since we want to separate VAR from REST-OF-LINE (which might be
4569 % empty), we can't just use \parsearg; we have to insert a space of our
4570 % own to delimit the rest of the line, and then take it out again if we
4572 % We rely on the fact that \parsearg sets \catcode`\ =10.
4574 \parseargdef\set{\setyyy#1 \endsetyyy}
4575 \def\setyyy#1 #2\endsetyyy{%
4577 \makevalueexpandable
4579 \edef\next{\gdef\makecsname{SET#1}}%
4587 % Remove the trailing space \setxxx inserted.
4588 \def\setzzz#1 \endsetzzz{\next{#1}}
4590 % @clear VAR clears (i.e., unsets) the variable VAR.
4592 \parseargdef\clear{%
4594 \makevalueexpandable
4595 \global\expandafter\let\csname SET#1\endcsname=\relax
4599 % @value{foo} gets the text saved in variable foo.
4600 \def\value{\begingroup\makevalueexpandable\valuexxx}
4601 \def\valuexxx#1{\expandablevalue{#1}\endgroup}
4603 \catcode`\-=\active \catcode`\_=\active
4605 \gdef\makevalueexpandable{%
4606 \let\value = \expandablevalue
4607 % We don't want these characters active, ...
4608 \catcode`\-=\other \catcode`\_=\other
4609 % ..., but we might end up with active ones in the argument if
4610 % we're called from @code, as @code{@value{foo-bar_}}, though.
4611 % So \let them to their normal equivalents.
4612 \let-\normaldash \let_\normalunderscore
4616 \def\expandablevalue#1{%
4617 \expandafter\ifx\csname SET#1\endcsname\relax
4618 {[No value for ``#1'']}%
4619 \message{Variable `#1', used in @value, is not set.}%
4621 \csname SET#1\endcsname
4625 % Like \expandablevalue, but completely expandable (the \message in the
4626 % definition above operates at the execution level of TeX). Used when
4627 % writing to auxiliary files, due to the expansion that \write does.
4628 % If flag is undefined, pass through an unexpanded @value command: maybe it
4629 % will be set by the time it is read back in.
4631 % NB flag names containing - or _ may not work here.
4633 \expandafter\ifx\csname SET#1\endcsname\relax
4636 \csname SET#1\endcsname
4640 % Used for @value's in index entries to form the sort key: expand the @value
4641 % if possible, otherwise sort late.
4642 \def\indexnofontsvalue#1{%
4643 \expandafter\ifx\csname SET#1\endcsname\relax
4646 \csname SET#1\endcsname
4650 % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
4653 % To get the special treatment we need for `@end ifset,' we call
4654 % \makecond and then redefine.
4657 \def\ifset{\parsearg{\doifset{\let\next=\ifsetfail}}}
4660 \makevalueexpandable
4662 \expandafter\ifx\csname SET#2\endcsname\relax
4663 #1% If not set, redefine \next.
4668 \def\ifsetfail{\doignore{ifset}}
4670 % @ifclear VAR ... @end executes the `...' iff VAR has never been
4671 % defined with @set, or has been undefined with @clear.
4673 % The `\else' inside the `\doifset' parameter is a trick to reuse the
4674 % above code: if the variable is not set, do nothing, if it is set,
4675 % then redefine \next to \ifclearfail.
4678 \def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}}
4679 \def\ifclearfail{\doignore{ifclear}}
4681 % @ifcommandisdefined CMD ... @end executes the `...' if CMD (written
4682 % without the @) is in fact defined. We can only feasibly check at the
4683 % TeX level, so something like `mathcode' is going to considered
4684 % defined even though it is not a Texinfo command.
4686 \makecond{ifcommanddefined}
4687 \def\ifcommanddefined{\parsearg{\doifcmddefined{\let\next=\ifcmddefinedfail}}}
4689 \def\doifcmddefined#1#2{{%
4690 \makevalueexpandable
4692 \expandafter\ifx\csname #2\endcsname\relax
4693 #1% If not defined, \let\next as above.
4698 \def\ifcmddefinedfail{\doignore{ifcommanddefined}}
4700 % @ifcommandnotdefined CMD ... handled similar to @ifclear above.
4701 \makecond{ifcommandnotdefined}
4702 \def\ifcommandnotdefined{%
4703 \parsearg{\doifcmddefined{\else \let\next=\ifcmdnotdefinedfail}}}
4704 \def\ifcmdnotdefinedfail{\doignore{ifcommandnotdefined}}
4706 % Set the `txicommandconditionals' variable, so documents have a way to
4707 % test if the @ifcommand...defined conditionals are available.
4708 \set txicommandconditionals
4710 % @dircategory CATEGORY -- specify a category of the dir file
4711 % which this file should belong to. Ignore this in TeX.
4712 \let\dircategory=\comment
4714 % @defininfoenclose.
4715 \let\definfoenclose=\comment
4719 % Index generation facilities
4721 % Define \newwrite to be identical to plain tex's \newwrite
4722 % except not \outer, so it can be used within macros and \if's.
4723 \edef\newwrite{\makecsname{ptexnewwrite}}
4725 % \newindex {IX} defines an index named IX.
4726 % It automatically defines \IXindex such that
4727 % \IXindex ...rest of line... puts an entry in the index IX.
4728 % It also defines \IXindfile to be the number of the output channel for
4729 % the file that accumulates this index. The file's extension is IX.
4732 \expandafter\chardef\csname#1indfile\endcsname=0
4733 \expandafter\xdef\csname#1index\endcsname{% % Define @#1index
4734 \noexpand\doindex{#1}}
4737 % @defindex foo == \newindex{foo}
4739 \def\defindex{\parsearg\newindex}
4741 % Define @defcodeindex, like @defindex except put all entries in @code.
4743 \def\defcodeindex{\parsearg\newcodeindex}
4745 \def\newcodeindex#1{%
4746 \expandafter\chardef\csname#1indfile\endcsname=0
4747 \expandafter\xdef\csname#1index\endcsname{%
4748 \noexpand\docodeindex{#1}}%
4751 % The default indices:
4752 \newindex{cp}% concepts,
4753 \newcodeindex{fn}% functions,
4754 \newcodeindex{vr}% variables,
4755 \newcodeindex{tp}% types,
4756 \newcodeindex{ky}% keys
4757 \newcodeindex{pg}% and programs.
4760 % @synindex foo bar makes index foo feed into index bar.
4761 % Do this instead of @defindex foo if you don't want it as a separate index.
4763 % @syncodeindex foo bar similar, but put all entries made for index foo
4766 \def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}}
4767 \def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}}
4769 % #1 is \doindex or \docodeindex, #2 the index getting redefined (foo),
4770 % #3 the target index (bar).
4771 \def\dosynindex#1#2#3{%
4772 \requireopenindexfile{#3}%
4773 % redefine \fooindfile:
4774 \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname
4775 \expandafter\let\csname#2indfile\endcsname=\temp
4776 % redefine \fooindex:
4777 \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}%
4780 % Define \doindex, the driver for all index macros.
4781 % Argument #1 is generated by the calling \fooindex macro,
4782 % and it is the two-letter name of the index.
4784 \def\doindex#1{\edef\indexname{#1}\parsearg\doindexxxx}
4785 \def\doindexxxx #1{\doind{\indexname}{#1}}
4787 % like the previous two, but they put @code around the argument.
4788 \def\docodeindex#1{\edef\indexname{#1}\parsearg\docodeindexxxx}
4789 \def\docodeindexxxx #1{\docind{\indexname}{#1}}
4792 % \definedummyword defines \#1 as \string\#1\space, thus effectively
4793 % preventing its expansion. This is used only for control words,
4794 % not control letters, because the \space would be incorrect for
4795 % control characters, but is needed to separate the control word
4796 % from whatever follows.
4798 % These can be used both for control words that take an argument and
4799 % those that do not. If it is followed by {arg} in the input, then
4800 % that will dutifully get written to the index (or wherever).
4802 % For control letters, we have \definedummyletter, which omits the
4805 \def\definedummyword #1{\def#1{\string#1\space}}%
4806 \def\definedummyletter#1{\def#1{\string#1}}%
4808 % Used for the aux, toc and index files to prevent expansion of Texinfo
4809 % commands. Most of the commands are controlled through the
4810 % \ifdummies conditional.
4815 \definedummyletter\@%
4816 \definedummyletter\ %
4817 \definedummyletter\{%
4818 \definedummyletter\}%
4819 \definedummyletter\&%
4821 \definedummyletter\_%
4822 \definedummyletter\-%
4824 \definedummyword\subentry
4826 % We want to disable all macros so that they are not expanded by \write.
4827 \let\commondummyword\definedummyword
4829 \let\value\dummyvalue
4835 \newif\ifindexnofonts
4837 \def\commondummyletter#1{%
4838 \expandafter\let\csname\string#1:impl\endcsname#1%
4840 \noexpand\ifindexnofonts
4843 \noexpand\ifdummies\string#1%
4845 \noexpand\jumptwofi % dispose of the \fi
4846 \expandafter\noexpand\csname\string#1:impl\endcsname
4851 \def\commondummyaccent#1{%
4852 \expandafter\let\csname\string#1:impl\endcsname#1%
4854 \noexpand\ifindexnofonts
4855 \noexpand\expandafter % dispose of \else ... \fi
4858 \noexpand\ifdummies\string#1%
4860 \noexpand\jumptwofi % dispose of the \fi
4861 \expandafter\noexpand\csname\string#1:impl\endcsname
4866 % Like \commondummyaccent but add a \space at the end of the dummy expansion
4867 % #2 is the expansion used for \indexnofonts. #2 is always followed by
4868 % \asis to remove a pair of following braces.
4869 \def\commondummyword#1#2{%
4870 \expandafter\let\csname\string#1:impl\endcsname#1%
4871 \expandafter\def\csname\string#1:ixnf\endcsname{#2\asis}%
4873 \noexpand\ifindexnofonts
4874 \noexpand\expandafter % dispose of \else ... \fi
4875 \expandafter\noexpand\csname\string#1:ixnf\endcsname
4877 \noexpand\ifdummies\string#1\space
4879 \noexpand\jumptwofi % dispose of the \fi \fi
4880 \expandafter\noexpand\csname\string#1:impl\endcsname
4884 \def\jumptwofi#1\fi\fi{\fi\fi#1}
4886 % For \atdummies and \indexnofonts. \atdummies sets
4887 % \dummiestrue and \indexnofonts sets \indexnofontstrue.
4889 % @-sign is always an escape character when reading auxiliary files
4892 \commondummyletter\!%
4893 \commondummyaccent\"%
4894 \commondummyaccent\'%
4895 \commondummyletter\*%
4896 \commondummyaccent\,%
4897 \commondummyletter\.%
4898 \commondummyletter\/%
4899 \commondummyletter\:%
4900 \commondummyaccent\=%
4901 \commondummyletter\?%
4902 \commondummyaccent\^%
4903 \commondummyaccent\`%
4904 \commondummyaccent\~%
4906 % Control letters and accents.
4907 \commondummyword\u {}%
4908 \commondummyword\v {}%
4909 \commondummyword\H {}%
4910 \commondummyword\dotaccent {}%
4911 \commondummyword\ogonek {}%
4912 \commondummyword\ringaccent {}%
4913 \commondummyword\tieaccent {}%
4914 \commondummyword\ubaraccent {}%
4915 \commondummyword\udotaccent {}%
4916 \commondummyword\dotless {}%
4918 % Texinfo font commands.
4919 \commondummyword\b {}%
4920 \commondummyword\i {}%
4921 \commondummyword\r {}%
4922 \commondummyword\sansserif {}%
4923 \commondummyword\sc {}%
4924 \commondummyword\slanted {}%
4925 \commondummyword\t {}%
4927 % Commands that take arguments.
4928 \commondummyword\abbr {}%
4929 \commondummyword\acronym {}%
4930 \commondummyword\anchor {}%
4931 \commondummyword\cite {}%
4932 \commondummyword\code {}%
4933 \commondummyword\command {}%
4934 \commondummyword\dfn {}%
4935 \commondummyword\dmn {}%
4936 \commondummyword\email {}%
4937 \commondummyword\emph {}%
4938 \commondummyword\env {}%
4939 \commondummyword\file {}%
4940 \commondummyword\image {}%
4941 \commondummyword\indicateurl{}%
4942 \commondummyword\inforef {}%
4943 \commondummyword\kbd {}%
4944 \commondummyword\key {}%
4945 \commondummyword\math {}%
4946 \commondummyword\option {}%
4947 \commondummyword\pxref {}%
4948 \commondummyword\ref {}%
4949 \commondummyword\samp {}%
4950 \commondummyword\strong {}%
4951 \commondummyword\tie {}%
4952 \commondummyword\U {}%
4953 \commondummyword\uref {}%
4954 \commondummyword\url {}%
4955 \commondummyword\var {}%
4956 \commondummyword\verb {}%
4957 \commondummyword\w {}%
4958 \commondummyword\xref {}%
4960 \commondummyword\AA {AA}%
4961 \commondummyword\AE {AE}%
4962 \commondummyword\DH {DZZ}%
4963 \commondummyword\L {L}%
4964 \commondummyword\O {O}%
4965 \commondummyword\OE {OE}%
4966 \commondummyword\TH {TH}%
4967 \commondummyword\aa {aa}%
4968 \commondummyword\ae {ae}%
4969 \commondummyword\dh {dzz}%
4970 \commondummyword\exclamdown {!}%
4971 \commondummyword\l {l}%
4972 \commondummyword\o {o}%
4973 \commondummyword\oe {oe}%
4974 \commondummyword\ordf {a}%
4975 \commondummyword\ordm {o}%
4976 \commondummyword\questiondown {?}%
4977 \commondummyword\ss {ss}%
4978 \commondummyword\th {th}%
4980 \commondummyword\LaTeX {LaTeX}%
4981 \commondummyword\TeX {TeX}%
4983 % Assorted special characters.
4984 \commondummyword\ampchar {\normalamp}%
4985 \commondummyword\atchar {\@}%
4986 \commondummyword\arrow {->}%
4987 \commondummyword\backslashchar {\realbackslash}%
4988 \commondummyword\bullet {bullet}%
4989 \commondummyword\comma {,}%
4990 \commondummyword\copyright {copyright}%
4991 \commondummyword\dots {...}%
4992 \commondummyword\enddots {...}%
4993 \commondummyword\entrybreak {}%
4994 \commondummyword\equiv {===}%
4995 \commondummyword\error {error}%
4996 \commondummyword\euro {euro}%
4997 \commondummyword\expansion {==>}%
4998 \commondummyword\geq {>=}%
4999 \commondummyword\guillemetleft {<<}%
5000 \commondummyword\guillemetright {>>}%
5001 \commondummyword\guilsinglleft {<}%
5002 \commondummyword\guilsinglright {>}%
5003 \commondummyword\lbracechar {\{}%
5004 \commondummyword\leq {<=}%
5005 \commondummyword\mathopsup {sup}%
5006 \commondummyword\minus {-}%
5007 \commondummyword\pounds {pounds}%
5008 \commondummyword\point {.}%
5009 \commondummyword\print {-|}%
5010 \commondummyword\quotedblbase {"}%
5011 \commondummyword\quotedblleft {"}%
5012 \commondummyword\quotedblright {"}%
5013 \commondummyword\quoteleft {`}%
5014 \commondummyword\quoteright {'}%
5015 \commondummyword\quotesinglbase {,}%
5016 \commondummyword\rbracechar {\}}%
5017 \commondummyword\registeredsymbol {R}%
5018 \commondummyword\result {=>}%
5019 \commondummyword\sub {}%
5020 \commondummyword\sup {}%
5021 \commondummyword\textdegree {o}%
5024 \let\indexlbrace\relax
5025 \let\indexrbrace\relax
5026 \let\indexatchar\relax
5027 \let\indexbackslash\relax
5031 @gdef@backslashdisappear{@def\{}}
5038 \gdef\indexnonalnumdisappear{%
5039 \ifflagclear{txiindexlquoteignore}{}{%
5040 % @set txiindexlquoteignore makes us ignore left quotes in the sort term.
5041 % (Introduced for FSFS 2nd ed.)
5045 \ifflagclear{txiindexbackslashignore}{}{%
5048 \ifflagclear{txiindexhyphenignore}{}{%
5051 \ifflagclear{txiindexlessthanignore}{}{%
5054 \ifflagclear{txiindexatsignignore}{}{%
5059 \gdef\indexnonalnumreappear{%
5066 % \indexnofonts is used when outputting the strings to sort the index
5067 % by, and when constructing control sequence names. It eliminates all
5068 % control sequences and just writes whatever the best ASCII sort string
5069 % would be for a given command (usually its argument).
5076 \def\_{\normalunderscore}%
5077 \def\-{}% @- shouldn't affect sorting
5079 \uccode`\1=`\{ \uppercase{\def\{{1}}%
5080 \uccode`\1=`\} \uppercase{\def\}{1}}%
5085 % We need to get rid of all macros, leaving only the arguments (if present).
5086 % Of course this is not nearly correct, but it is the best we can do for now.
5088 % Since macro invocations are followed by braces, we can just redefine them
5089 % to take a single TeX argument. The case of a macro invocation that
5090 % goes to end-of-line is not handled.
5092 \def\commondummyword##1{\let##1\asis}%
5094 \let\value\indexnofontsvalue
5100 % #1 is the index name, #2 is the entry text.
5105 \requireopenindexfile{#1}%
5106 \edef\writeto{\csname#1indfile\endcsname}%
5109 \safewhatsit\doindwrite
5114 % Same as \doind, but for code indices
5119 \requireopenindexfile{#1}%
5120 \edef\writeto{\csname#1indfile\endcsname}%
5123 \safewhatsit\docindwrite
5128 % Check if an index file has been opened, and if not, open it.
5129 \def\requireopenindexfile#1{%
5130 \ifnum\csname #1indfile\endcsname=0
5131 \expandafter\newwrite \csname#1indfile\endcsname
5133 % A .fls suffix would conflict with the file extension for the output
5134 % of -recorder, so use .f1s instead.
5135 \ifx\suffix\indexisfl\def\suffix{f1}\fi
5137 \immediate\openout\csname#1indfile\endcsname \jobname.\suffix
5138 % Using \immediate above here prevents an object entering into the current
5139 % box, which could confound checks such as those in \safewhatsit for
5141 \typeout{Writing index file \jobname.\suffix}%
5145 % Definition for writing index entry sort key.
5148 \gdef\indexwritesortas{%
5150 \indexnonalnumreappear
5151 \indexwritesortasxxx}
5152 \gdef\indexwritesortasxxx#1{%
5153 \xdef\indexsortkey{#1}\endgroup}
5156 \def\indexwriteseealso#1{
5157 \gdef\pagenumbertext{\string\seealso{#1}}%
5159 \def\indexwriteseeentry#1{
5160 \gdef\pagenumbertext{\string\seeentry{#1}}%
5163 % The default definitions
5165 \def\seealso#1{\i{\putwordSeeAlso}\ #1}% for sorted index file only
5166 \def\putwordSeeAlso{See also}
5167 \def\seeentry#1{\i{\putwordSee}\ #1}% for sorted index file only
5170 % Given index entry text like "aaa @subentry bbb @sortas{ZZZ}":
5171 % * Set \bracedtext to "{aaa}{bbb}"
5172 % * Set \fullindexsortkey to "aaa @subentry ZZZ"
5173 % * If @seealso occurs, set \pagenumbertext
5175 \def\splitindexentry#1{%
5176 \gdef\fullindexsortkey{}%
5181 \expandafter\doindexsegment#1\subentry\finish\subentry
5184 % append the results from the next segment
5185 \def\doindexsegment#1\subentry{%
5187 \ifx\segment\isfinish
5190 % Fully expand the segment, throwing away any @sortas directives, and
5192 \edef\trimmed{\segment}%
5193 \edef\trimmed{\expandafter\eatspaces\expandafter{\trimmed}}%
5195 \edef\trimmed{\noexpand\code{\trimmed}}%
5198 \xdef\bracedtext{\bracedtext{\trimmed}}%
5200 % Get the string to sort by. Process the segment with all
5201 % font commands turned off.
5203 \let\sortas\indexwritesortas
5204 \let\seealso\indexwriteseealso
5205 \let\seeentry\indexwriteseeentry
5207 % The braces around the commands are recognized by texindex.
5208 \def\lbracechar{{\string\indexlbrace}}%
5209 \def\rbracechar{{\string\indexrbrace}}%
5212 \def\@{{\string\indexatchar}}%
5214 \def\backslashchar{{\string\indexbackslash}}%
5215 \uccode`\~=`\\ \uppercase{\let~\backslashchar}%
5217 \let\indexsortkey\empty
5218 \global\let\pagenumbertext\empty
5219 % Execute the segment and throw away the typeset output. This executes
5220 % any @sortas or @seealso commands in this segment.
5221 \setbox\dummybox = \hbox{\segment}%
5222 \ifx\indexsortkey\empty{%
5223 \indexnonalnumdisappear
5224 \xdef\trimmed{\segment}%
5225 \xdef\trimmed{\expandafter\eatspaces\expandafter{\trimmed}}%
5226 \xdef\indexsortkey{\trimmed}%
5227 \ifx\indexsortkey\empty
5228 \message{Empty index sort key near line \the\inputlineno}%
5229 \xdef\indexsortkey{ }%
5233 % Append to \fullindexsortkey.
5234 \edef\tmp{\gdef\noexpand\fullindexsortkey{%
5235 \fullindexsortkey\sep\indexsortkey}}%
5238 \def\sep{\subentry}%
5240 \expandafter\doindexsegment
5243 \def\isfinish{\finish}%
5244 \newbox\dummybox % used above
5248 % Use \ instead of @ in index files. To support old texi2dvi and texindex.
5249 % This works without changing the escape character used in the toc or aux
5250 % files because the index entries are fully expanded here, and \string uses
5251 % the current value of \escapechar.
5252 \def\escapeisbackslash{\escapechar=`\\}
5254 % Use \ in index files by default. texi2dvi didn't support @ as the escape
5255 % character (as it checked for "\entry" in the files, and not "@entry"). When
5256 % the new version of texi2dvi has had a chance to become more prevalent, then
5257 % the escape character can change back to @ again. This should be an easy
5258 % change to make now because both @ and \ are only used as escape characters in
5259 % index files, never standing for themselves.
5261 \set txiindexescapeisbackslash
5263 % Write the entry in \indextext to the index file.
5266 \newif\ifincodeindex
5267 \def\doindwrite{\incodeindexfalse\doindwritex}
5268 \def\docindwrite{\incodeindextrue\doindwritex}
5275 \ifflagclear{txiindexescapeisbackslash}{}{\escapeisbackslash}%
5277 % For texindex which always views { and } as separators.
5278 \def\{{\lbracechar{}}%
5279 \def\}{\rbracechar{}}%
5280 \uccode`\~=`\\ \uppercase{\def~{\backslashchar{}}}%
5282 % Split the entry into primary entry and any subentries, and get the index
5284 \splitindexentry\indextext
5286 % Set up the complete index entry, with both the sort key and
5287 % the original text, including any font commands. We write
5288 % three arguments to \entry to the .?? file (four in the
5289 % subentry case), texindex reduces to two when writing the .??s
5294 \string\entry{\fullindexsortkey}%
5295 {\ifx\pagenumbertext\empty\noexpand\folio\else\pagenumbertext\fi}%
5301 % Put the index entry in the margin if desired (undocumented).
5302 \def\maybemarginindex{%
5303 \ifx\SETmarginindex\relax\else
5304 \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \relax\indextext}}%
5307 \let\SETmarginindex=\relax
5310 % Take care of unwanted page breaks/skips around a whatsit:
5312 % If a skip is the last thing on the list now, preserve it
5313 % by backing up by \lastskip, doing the \write, then inserting
5314 % the skip again. Otherwise, the whatsit generated by the
5315 % \write or \pdfdest will make \lastskip zero. The result is that
5316 % sequences like this:
5320 % will have extra space inserted, because the \medbreak in the
5321 % start of the @defun won't see the skip inserted by the @end of
5322 % the previous defun.
5324 % But don't do any of this if we're not in vertical mode. We
5325 % don't want to do a \vskip and prematurely end a paragraph.
5327 % Avoid page breaks due to these extra skips, too.
5329 % But wait, there is a catch there:
5330 % We'll have to check whether \lastskip is zero skip. \ifdim is not
5331 % sufficient for this purpose, as it ignores stretch and shrink parts
5332 % of the skip. The only way seems to be to check the textual
5333 % representation of the skip.
5335 % The following is almost like \def\zeroskipmacro{0.0pt} except that
5336 % the ``p'' and ``t'' characters have catcode \other, not 11 (letter).
5338 \edef\zeroskipmacro{\expandafter\the\csname z@skip\endcsname}
5340 \newskip\whatsitskip
5341 \newcount\whatsitpenalty
5345 \def\safewhatsit#1{\ifhmode
5348 % \lastskip and \lastpenalty cannot both be nonzero simultaneously.
5349 \whatsitskip = \lastskip
5350 \edef\lastskipmacro{\the\lastskip}%
5351 \whatsitpenalty = \lastpenalty
5353 % If \lastskip is nonzero, that means the last item was a
5354 % skip. And since a skip is discardable, that means this
5355 % -\whatsitskip glue we're inserting is preceded by a
5356 % non-discardable item, therefore it is not a potential
5357 % breakpoint, therefore no \nobreak needed.
5358 \ifx\lastskipmacro\zeroskipmacro
5365 \ifx\lastskipmacro\zeroskipmacro
5366 % If \lastskip was zero, perhaps the last item was a penalty, and
5367 % perhaps it was >=10000, e.g., a \nobreak. In that case, we want
5368 % to re-insert the same penalty (values >10000 are used for various
5369 % signals); since we just inserted a non-discardable item, any
5370 % following glue (such as a \parskip) would be a breakpoint. For example:
5371 % @deffn deffn-whatever
5372 % @vindex index-whatever
5374 % would allow a break between the index-whatever whatsit
5375 % and the "Description." paragraph.
5376 \ifnum\whatsitpenalty>9999 \penalty\whatsitpenalty \fi
5378 % On the other hand, if we had a nonzero \lastskip,
5379 % this make-up glue would be preceded by a non-discardable item
5380 % (the whatsit from the \write), so we must insert a \nobreak.
5381 \nobreak\vskip\whatsitskip
5385 % The index entry written in the file actually looks like
5386 % \entry {sortstring}{page}{topic}
5388 % \entry {sortstring}{page}{topic}{subtopic}
5389 % The texindex program reads in these files and writes files
5390 % containing these kinds of lines:
5392 % before the first topic whose initial is c
5393 % \entry {topic}{pagelist}
5394 % for a topic that is used without subtopics
5397 % for the beginning of a topic that is used with subtopics
5398 % \secondary {subtopic}{pagelist}
5399 % for each subtopic.
5400 % \secondary {subtopic}{}
5401 % for a subtopic with sub-subtopics
5402 % \tertiary {subtopic}{subsubtopic}{pagelist}
5403 % for each sub-subtopic.
5405 % Define the user-accessible indexing commands
5406 % @findex, @vindex, @kindex, @cindex.
5408 \def\findex {\fnindex}
5409 \def\kindex {\kyindex}
5410 \def\cindex {\cpindex}
5411 \def\vindex {\vrindex}
5412 \def\tindex {\tpindex}
5413 \def\pindex {\pgindex}
5415 % Define the macros used in formatting output of the sorted index material.
5417 % @printindex causes a particular index (the ??s file) to get printed.
5418 % It does not print any chapter heading (usually an @unnumbered).
5420 \parseargdef\printindex{\begingroup
5421 \dobreak \chapheadingskip{10000}%
5426 \everypar = {}% don't want the \kern\-parindent from indentation suppression.
5428 % See comment in \requireopenindexfile.
5429 \def\indexname{#1}\ifx\indexname\indexisfl\def\indexname{f1}\fi
5431 % See if the index file exists and is nonempty.
5432 \openin 1 \jobname.\indexname s
5434 % \enddoublecolumns gets confused if there is no text in the index,
5435 % and it loses the chapter title and the aux file entries for the
5436 % index. The easiest way to prevent this problem is to make sure
5437 % there is some text.
5438 \putwordIndexNonexistent
5439 \typeout{No file \jobname.\indexname s.}%
5441 % If the index file exists but is empty, then \openin leaves \ifeof
5442 % false. We have to make TeX try to read something from the file, so
5443 % it can discover if there is anything in it.
5444 \read 1 to \thisline
5446 \putwordIndexIsEmpty
5448 \expandafter\printindexzz\thisline\relax\relax\finish%
5454 % If the index file starts with a backslash, forgo reading the index
5455 % file altogether. If somebody upgrades texinfo.tex they may still have
5456 % old index files using \ as the escape character. Reading this would
5457 % at best lead to typesetting garbage, at worst a TeX syntax error.
5458 \def\printindexzz#1#2\finish{%
5459 \ifflagclear{txiindexescapeisbackslash}{%
5460 \uccode`\~=`\\ \uppercase{\if\noexpand~}\noexpand#1
5461 \ifflagclear{txiskipindexfileswithbackslash}{%
5463 ERROR: A sorted index file in an obsolete format was skipped.
5464 To fix this problem, please upgrade your version of 'texi2dvi'
5465 or 'texi2pdf' to that at <https://ftp.gnu.org/gnu/texinfo>.
5466 If you are using an old version of 'texindex' (part of the Texinfo
5467 distribution), you may also need to upgrade to a newer version (at least 6.0).
5468 You may be able to typeset the index if you run
5469 'texindex \jobname.\indexname' yourself.
5470 You could also try setting the 'txiindexescapeisbackslash' flag by
5471 running a command like
5472 'texi2dvi -t "@set txiindexescapeisbackslash" \jobname.texi'. If you do
5473 this, Texinfo will try to use index files in the old format.
5474 If you continue to have problems, deleting the index files and starting again
5475 might help (with 'rm \jobname.?? \jobname.??s')%
5478 (Skipped sorted index file in obsolete format)
5482 \input \jobname.\indexname s
5489 % Make @ an escape character to give macros a chance to work. This
5490 % should work because we (hopefully) don't otherwise use @ in index files.
5491 %\catcode`\@=12\relax
5493 \input \jobname.\indexname s
5498 % These macros are used by the sorted index file itself.
5499 % Change them to control the appearance of the index.
5501 {\catcode`\/=13 \catcode`\-=13 \catcode`\^=13 \catcode`\~=13 \catcode`\_=13
5502 \catcode`\|=13 \catcode`\<=13 \catcode`\>=13 \catcode`\+=13 \catcode`\"=13
5504 \gdef\initialglyphs{%
5505 % special control sequences used in the index sort key
5509 \def\indexbackslash{\math{\backslash}}%
5511 % Some changes for non-alphabetic characters. Using the glyphs from the
5512 % math fonts looks more consistent than the typewriter font used elsewhere
5513 % for these characters.
5514 \uccode`\~=`\\ \uppercase{\def~{\math{\backslash}}}
5516 % In case @\ is used for backslash
5517 \uppercase{\let\\=~}
5518 % Can't get bold backslash so don't use bold forward slash
5520 \def/{{\secrmnotbold \normalslash}}%
5521 \def-{{\normaldash\normaldash}}% en dash `--'
5522 \def^{{\chapbf \normalcaret}}%
5523 \def~{{\chapbf \normaltilde}}%
5525 \leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em }%
5529 \def+{$\normalplus$}%
5539 % Remove any glue we may have, we'll be inserting our own.
5542 % We like breaks before the index initials, so insert a bonus.
5543 % The glue before the bonus allows a little bit of space at the
5544 % bottom of a column to reduce an increase in inter-line spacing.
5546 \vskip 0pt plus 5\baselineskip
5548 \vskip 0pt plus -5\baselineskip
5550 % Typeset the initial. Making this add up to a whole number of
5551 % baselineskips increases the chance of the dots lining up from column
5552 % to column. It still won't often be perfect, because of the stretch
5553 % we need before each entry, but it's better.
5555 % No shrink because it confuses \balancecolumns.
5556 \vskip 1.67\baselineskip plus 1\baselineskip
5557 \leftline{\secfonts \kern-0.05em \secbf #1}%
5558 % \secfonts is inside the argument of \leftline so that the change of
5559 % \baselineskip will not affect any glue inserted before the vbox that
5560 % \leftline creates.
5561 % Do our best not to break after the initial.
5563 \vskip .33\baselineskip plus .1\baselineskip
5564 \egroup % \initialglyphs
5567 \newdimen\entryrightmargin
5568 \entryrightmargin=0pt
5570 % for PDF output, whether to make the text of the entry a link to the page
5571 % number. set for @contents and @shortcontents where there is only one
5573 \newif\iflinkentrytext
5575 % \entry typesets a paragraph consisting of the text (#1), dot leaders, and
5576 % then page number (#2) flushed to the right margin. It is used for index
5577 % and table of contents entries. The paragraph is indented by \leftskip.
5582 % Start a new paragraph if necessary, so our assignments below can't
5583 % affect previous text.
5586 % No extra space above this paragraph.
5589 % When reading the text of entry, convert explicit line breaks
5590 % from @* into spaces. The user might give these in long section
5591 % titles, for instance.
5592 \def\*{\unskip\space\ignorespaces}%
5593 \def\entrybreak{\hfil\break}% An undocumented command
5595 % Swallow the left brace of the text (first parameter):
5596 \afterassignment\doentry
5599 \def\entrybreak{\unskip\space\ignorespaces}%
5601 % Save the text of the entry in \boxA
5602 \global\setbox\boxA=\hbox\bgroup
5603 \bgroup % Instead of the swallowed brace.
5605 \aftergroup\finishentry
5606 % And now comes the text of the entry.
5607 % Not absorbing as a macro argument reduces the chance of problems
5608 % with catcodes occurring.
5611 % #1 is the page number
5612 \gdef\finishentry#1{%
5614 \dimen@ = \wd\boxA % Length of text of entry
5615 % add any leaders and page number to \boxA.
5616 \global\setbox\boxA=\hbox\bgroup
5619 \pdflinkpage{#1}{\unhbox\boxA}%
5627 % Get the width of the page numbers, and only use
5628 % leaders if they are present.
5629 \global\setbox\boxB = \hbox{#1}%
5630 \ifdim\wd\boxB = 0pt
5631 \null\nobreak\hfill\ %
5634 \null\nobreak\indexdotfill % Have leaders before the page number.
5638 \hskip\skip\thinshrinkable\the\toksA
5640 \hskip\skip\thinshrinkable #1%
5646 \ifdim\wd\boxB = 0pt
5647 \noindent\unhbox\boxA\par
5650 % We want the text of the entries to be aligned to the left, and the
5651 % page numbers to be aligned to the right.
5654 \advance\leftskip by 0pt plus 1fil
5655 \advance\leftskip by 0pt plus -1fill
5656 \rightskip = 0pt plus -1fil
5657 \advance\rightskip by 0pt plus 1fill
5658 % Cause last line, which could consist of page numbers on their own
5659 % if the list of page numbers is long, to be aligned to the right.
5660 \parfillskip=0pt plus -1fill
5662 \advance\rightskip by \entryrightmargin
5663 % Determine how far we can stretch into the margin.
5664 % This allows, e.g., "Appendix H GNU Free Documentation License" to
5665 % fit on one line in @letterpaper format.
5666 \ifdim\entryrightmargin>2.1em
5671 \advance \parfillskip by 0pt minus 1\dimen@i
5674 \advance\dimen@ii by -1\leftskip
5675 \advance\dimen@ii by -1\entryrightmargin
5676 \advance\dimen@ii by 1\dimen@i
5677 \ifdim\wd\boxA > \dimen@ii % If the entry doesn't fit in one line
5678 \ifdim\dimen@ > 0.8\dimen@ii % due to long index text
5679 % Try to split the text roughly evenly. \dimen@ will be the length of
5681 \dimen@ = 0.7\dimen@
5683 \ifnum\dimen@>\dimen@ii
5684 % If the entry is too long (for example, if it needs more than
5685 % two lines), use all the space in the first line.
5688 \advance\leftskip by 0pt plus 1fill % ragged right
5689 \advance \dimen@ by 1\rightskip
5690 \parshape = 2 0pt \dimen@ 0em \dimen@ii
5691 % Ideally we'd add a finite glue at the end of the first line only,
5692 % instead of using \parshape with explicit line lengths, but TeX
5693 % doesn't seem to provide a way to do such a thing.
5695 % Indent all lines but the first one.
5696 \advance\leftskip by 1em
5697 \advance\parindent by -1em
5699 \indent % start paragraph
5702 % Do not prefer a separate line ending with a hyphen to fewer lines.
5703 \finalhyphendemerits = 0
5705 % Word spacing - no stretch
5706 \spaceskip=\fontdimen2\font minus \fontdimen4\font
5708 \linepenalty=1000 % Discourage line breaks.
5709 \hyphenpenalty=5000 % Discourage hyphenation.
5711 \par % format the paragraph
5717 \newskip\thinshrinkable
5718 \skip\thinshrinkable=.15em minus .15em
5720 % Like plain.tex's \dotfill, except uses up at least 1 em.
5721 % The filll stretch here overpowers both the fil and fill stretch to push
5722 % the page number to the right.
5723 \def\indexdotfill{\cleaders
5724 \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1filll}
5727 \def\primary #1{\line{#1\hfil}}
5729 \def\secondary{\indententry{0.5cm}}
5730 \def\tertiary{\indententry{1cm}}
5732 \def\indententry#1#2#3{%
5739 % Define two-column mode, which we use to typeset indexes.
5740 % Adapted from the TeXbook, page 416, which is to say,
5741 % the manmac.tex format used to print the TeXbook itself.
5742 \catcode`\@=11 % private names
5745 \newdimen\doublecolumnhsize
5747 \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
5748 % If not much space left on page, start a new page.
5749 \ifdim\pagetotal>0.8\vsize\vfill\eject\fi
5751 % Grab any single-column material above us.
5755 \global\setbox\partialpage = \vbox{%
5756 % Unvbox the main output page.
5758 \kern-\topskip \kern\baselineskip
5761 \eject % run that output routine to set \partialpage
5763 % Use the double-column output routine for subsequent pages.
5764 \output = {\doublecolumnout}%
5766 % Change the page size parameters. We could do this once outside this
5767 % routine, in each of @smallbook, @afourpaper, and the default 8.5x11
5768 % format, but then we repeat the same computation. Repeating a couple
5769 % of assignments once per index is clearly meaningless for the
5770 % execution time, so we may as well do it in one place.
5772 % First we halve the line length, less a little for the gutter between
5773 % the columns. We compute the gutter based on the line length, so it
5774 % changes automatically with the paper format. The magic constant
5775 % below is chosen so that the gutter has the same value (well, +-<1pt)
5776 % as it did when we hard-coded it.
5778 % We put the result in a separate register, \doublecolumhsize, so we
5779 % can restore it in \pagesofar, after \hsize itself has (potentially)
5782 \doublecolumnhsize = \hsize
5783 \advance\doublecolumnhsize by -.04154\hsize
5784 \divide\doublecolumnhsize by 2
5785 \hsize = \doublecolumnhsize
5787 % Get the available space for the double columns -- the normal
5788 % (undoubled) page height minus any material left over from the
5790 \advance\vsize by -\ht\partialpage
5793 % For the benefit of balancing columns
5794 \advance\baselineskip by 0pt plus 0.5pt
5797 % The double-column output routine for all double-column pages except
5798 % the last, which is done by \balancecolumns.
5800 \def\doublecolumnout{%
5803 \splittopskip=\topskip \splitmaxdepth=\maxdepth
5807 % box0 will be the left-hand column, box2 the right.
5808 \setbox0=\vsplit\PAGE to\dimen@ \setbox2=\vsplit\PAGE to\dimen@
5809 \global\advance\vsize by 2\ht\partialpage
5810 \onepageout\pagesofar % empty except for the first time we are called
5812 \penalty\outputpenalty
5815 % Re-output the contents of the output page -- any previous material,
5816 % followed by the two boxes we just split, in box0 and box2.
5820 \hsize = \doublecolumnhsize
5821 \wd0=\hsize \wd2=\hsize
5822 \hbox to\txipagewidth{\box0\hfil\box2}%
5826 % Finished with double columns.
5827 \def\enddoublecolumns{%
5828 % The following penalty ensures that the page builder is exercised
5829 % _before_ we change the output routine. This is necessary in the
5830 % following situation:
5832 % The last section of the index consists only of a single entry.
5833 % Before this section, \pagetotal is less than \pagegoal, so no
5834 % break occurs before the last section starts. However, the last
5835 % section, consisting of \initial and the single \entry, does not
5836 % fit on the page and has to be broken off. Without the following
5837 % penalty the page builder will not be exercised until \eject
5838 % below, and by that time we'll already have changed the output
5839 % routine to the \balancecolumns version, so the next-to-last
5840 % double-column page will be processed with \balancecolumns, which
5841 % is wrong: The two columns will go to the main vertical list, with
5842 % the broken-off section in the recent contributions. As soon as
5843 % the output routine finishes, TeX starts reconsidering the page
5844 % break. The two columns and the broken-off section both fit on the
5845 % page, because the two columns now take up only half of the page
5846 % goal. When TeX sees \eject from below which follows the final
5847 % section, it invokes the new output routine that we've set after
5848 % \balancecolumns below; \onepageout will try to fit the two columns
5849 % and the final section into the vbox of \txipageheight (see
5850 % \pagebody), causing an overfull box.
5852 % Note that glue won't work here, because glue does not exercise the
5853 % page builder, unlike penalties (see The TeXbook, pp. 280-281).
5857 % Split the last of the double-column material.
5861 \eject % call the \output just set
5862 \ifdim\pagetotal=0pt
5863 % Having called \balancecolumns once, we do not
5864 % want to call it again. Therefore, reset \output to its normal
5865 % definition right away.
5866 \global\output=\expandafter{\the\defaultoutput}
5868 \endgroup % started in \begindoublecolumns
5869 % Leave the double-column material on the current page, no automatic
5871 \box\balancedcolumns
5873 % \pagegoal was set to the doubled \vsize above, since we restarted
5874 % the current page. We're now back to normal single-column
5875 % typesetting, so reset \pagegoal to the normal \vsize.
5876 \global\vsize = \txipageheight %
5877 \pagegoal = \txipageheight %
5879 % We had some left-over material. This might happen when \doublecolumnout
5880 % is called in \balancecolumns. Try again.
5881 \expandafter\enddoublecolumns
5884 \newbox\balancedcolumns
5885 \setbox\balancedcolumns=\vbox{shouldnt see this}%
5887 % Only called for the last of the double column material. \doublecolumnout
5889 \def\balancecolumns{%
5890 \setbox0 = \vbox{\unvbox\PAGE}% like \box255 but more efficient, see p.120.
5892 \ifdim\dimen@<7\baselineskip
5893 % Don't split a short final column in two.
5895 \global\setbox\balancedcolumns=\vbox{\pagesofar}%
5897 % double the leading vertical space
5898 \advance\dimen@ by \topskip
5899 \advance\dimen@ by-\baselineskip
5900 \divide\dimen@ by 2 % target to split to
5902 \splittopskip = \topskip
5903 % Loop until left column is at least as high as the right column.
5907 \global\setbox3 = \copy0
5908 \global\setbox1 = \vsplit3 to \dimen@
5910 \global\advance\dimen@ by 1pt
5913 % Now the left column is in box 1, and the right column in box 3.
5915 % Check whether the left column has come out higher than the page itself.
5916 % (Note that we have doubled \vsize for the double columns, so
5917 % the actual height of the page is 0.5\vsize).
5919 % It appears that we have been called upon to balance too much material.
5920 % Output some of it with \doublecolumnout, leaving the rest on the page.
5924 % Compare the heights of the two columns.
5926 % Column heights are too different, so don't make their bottoms
5927 % flush with each other.
5928 \setbox2=\vbox to \ht1 {\unvbox3\vfill}%
5929 \setbox0=\vbox to \ht1 {\unvbox1\vfill}%
5931 % Make column bottoms flush with each other.
5932 \setbox2=\vbox to\ht1{\unvbox3\unskip}%
5933 \setbox0=\vbox to\ht1{\unvbox1\unskip}%
5935 \global\setbox\balancedcolumns=\vbox{\pagesofar}%
5940 \catcode`\@ = \other
5943 \message{sectioning,}
5944 % Chapters, sections, etc.
5946 % Let's start with @part.
5947 \parseargdef\part{\partzzz{#1}}
5951 \vskip.3\vsize % move it down on the page a bit
5953 \noindent \titlefonts\rm #1\par % the text
5954 \let\lastnode=\empty % no node to associate with
5955 \writetocentry{part}{#1}{}% but put it in the toc
5956 \headingsoff % no headline or footline on the part page
5957 % This outputs a mark at the end of the page that clears \thischapter
5958 % and \thissection, as is done in \startcontents.
5959 \let\pchapsepmacro\relax
5960 \chapmacro{}{Yomitfromtoc}{}%
5965 % \unnumberedno is an oxymoron. But we count the unnumbered
5966 % sections so that we can refer to them unambiguously in the pdf
5967 % outlines by their "section number". We avoid collisions with chapter
5968 % numbers by starting them at 10000. (If a document ever has 10000
5969 % chapters, we're in trouble anyway, I'm sure.)
5970 \newcount\unnumberedno \unnumberedno = 10000
5972 \newcount\secno \secno=0
5973 \newcount\subsecno \subsecno=0
5974 \newcount\subsubsecno \subsubsecno=0
5976 % This counter is funny since it counts through charcodes of letters A, B, ...
5977 \newcount\appendixno \appendixno = `\@
5979 % \def\appendixletter{\char\the\appendixno}
5980 % We do the following ugly conditional instead of the above simple
5981 % construct for the sake of pdftex, which needs the actual
5982 % letter in the expansion, not just typeset.
5984 \def\appendixletter{%
5985 \ifnum\appendixno=`A A%
5986 \else\ifnum\appendixno=`B B%
5987 \else\ifnum\appendixno=`C C%
5988 \else\ifnum\appendixno=`D D%
5989 \else\ifnum\appendixno=`E E%
5990 \else\ifnum\appendixno=`F F%
5991 \else\ifnum\appendixno=`G G%
5992 \else\ifnum\appendixno=`H H%
5993 \else\ifnum\appendixno=`I I%
5994 \else\ifnum\appendixno=`J J%
5995 \else\ifnum\appendixno=`K K%
5996 \else\ifnum\appendixno=`L L%
5997 \else\ifnum\appendixno=`M M%
5998 \else\ifnum\appendixno=`N N%
5999 \else\ifnum\appendixno=`O O%
6000 \else\ifnum\appendixno=`P P%
6001 \else\ifnum\appendixno=`Q Q%
6002 \else\ifnum\appendixno=`R R%
6003 \else\ifnum\appendixno=`S S%
6004 \else\ifnum\appendixno=`T T%
6005 \else\ifnum\appendixno=`U U%
6006 \else\ifnum\appendixno=`V V%
6007 \else\ifnum\appendixno=`W W%
6008 \else\ifnum\appendixno=`X X%
6009 \else\ifnum\appendixno=`Y Y%
6010 \else\ifnum\appendixno=`Z Z%
6011 % The \the is necessary, despite appearances, because \appendixletter is
6012 % expanded while writing the .toc file. \char\appendixno is not
6013 % expandable, thus it is written literally, thus all appendixes come out
6014 % with the same letter (or @) in the toc without it.
6015 \else\char\the\appendixno
6016 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
6017 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
6019 % Each @chapter defines these (using marks) as the number+name, number
6020 % and name of the chapter. Page headings and footings can use
6021 % these. @section does likewise.
6023 \def\thischapternum{}
6024 \def\thischaptername{}
6026 \def\thissectionnum{}
6027 \def\thissectionname{}
6029 \newcount\absseclevel % used to calculate proper heading level
6030 \newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count
6032 % @raisesections: treat @section as chapter, @subsection as section, etc.
6033 \def\raisesections{\global\advance\secbase by -1}
6035 % @lowersections: treat @chapter as section, @section as subsection, etc.
6036 \def\lowersections{\global\advance\secbase by 1}
6038 % we only have subsub.
6039 \chardef\maxseclevel = 3
6041 % A numbered section within an unnumbered changes to unnumbered too.
6042 % To achieve this, remember the "biggest" unnum. sec. we are currently in:
6043 \chardef\unnlevel = \maxseclevel
6045 % Trace whether the current chapter is an appendix or not:
6046 % \chapheadtype is "N" or "A", unnumbered chapters are ignored.
6047 \def\chapheadtype{N}
6049 % Choose a heading macro
6050 % #1 is heading type
6051 % #2 is heading level
6052 % #3 is text for heading
6053 \def\genhead#1#2#3{%
6054 % Compute the abs. sec. level:
6056 \advance\absseclevel by \secbase
6057 % Make sure \absseclevel doesn't fall outside the range:
6058 \ifnum \absseclevel < 0
6061 \ifnum \absseclevel > 3
6068 \ifnum \absseclevel < \unnlevel
6069 \chardef\unnlevel = \absseclevel
6072 % Check for appendix sections:
6073 \ifnum \absseclevel = 0
6074 \edef\chapheadtype{\headtype}%
6076 \if \headtype A\if \chapheadtype N%
6077 \errmessage{@appendix... within a non-appendix chapter}%
6080 % Check for numbered within unnumbered:
6081 \ifnum \absseclevel > \unnlevel
6084 \chardef\unnlevel = 3
6087 % Now print the heading:
6091 \or \unnumberedseczzz{#3}%
6092 \or \unnumberedsubseczzz{#3}%
6093 \or \unnumberedsubsubseczzz{#3}%
6099 \or \appendixsectionzzz{#3}%
6100 \or \appendixsubseczzz{#3}%
6101 \or \appendixsubsubseczzz{#3}%
6107 \or \numberedsubseczzz{#3}%
6108 \or \numberedsubsubseczzz{#3}%
6112 \suppressfirstparagraphindent
6116 \def\numhead{\genhead N}
6117 \def\apphead{\genhead A}
6118 \def\unnmhead{\genhead U}
6120 % @chapter, @appendix, @unnumbered. Increment top-level counter, reset
6121 % all lower-level sectioning counters to zero.
6123 % Also set \chaplevelprefix, which we prepend to @float sequence numbers
6124 % (e.g., figures), q.v. By default (before any chapter), that is empty.
6125 \let\chaplevelprefix = \empty
6127 \outer\parseargdef\chapter{\numhead0{#1}} % normally numhead0 calls chapterzzz
6129 % section resetting is \global in case the chapter is in a group, such
6130 % as an @include file.
6131 \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
6132 \global\advance\chapno by 1
6135 \gdef\chaplevelprefix{\the\chapno.}%
6138 % \putwordChapter can contain complex things in translations.
6139 \toks0=\expandafter{\putwordChapter}%
6140 \message{\the\toks0 \space \the\chapno}%
6142 % Write the actual heading.
6143 \chapmacro{#1}{Ynumbered}{\the\chapno}%
6145 % So @section and the like are numbered underneath this chapter.
6146 \global\let\section = \numberedsec
6147 \global\let\subsection = \numberedsubsec
6148 \global\let\subsubsection = \numberedsubsubsec
6151 \outer\parseargdef\appendix{\apphead0{#1}} % normally calls appendixzzz
6153 \def\appendixzzz#1{%
6154 \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
6155 \global\advance\appendixno by 1
6156 \gdef\chaplevelprefix{\appendixletter.}%
6159 % \putwordAppendix can contain complex things in translations.
6160 \toks0=\expandafter{\putwordAppendix}%
6161 \message{\the\toks0 \space \appendixletter}%
6163 \chapmacro{#1}{Yappendix}{\appendixletter}%
6165 \global\let\section = \appendixsec
6166 \global\let\subsection = \appendixsubsec
6167 \global\let\subsubsection = \appendixsubsubsec
6170 % normally unnmhead0 calls unnumberedzzz:
6171 \outer\parseargdef\unnumbered{\unnmhead0{#1}}
6172 \def\unnumberedzzz#1{%
6173 \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
6174 \global\advance\unnumberedno by 1
6176 % Since an unnumbered has no number, no prefix for figures.
6177 \global\let\chaplevelprefix = \empty
6180 % This used to be simply \message{#1}, but TeX fully expands the
6181 % argument to \message. Therefore, if #1 contained @-commands, TeX
6182 % expanded them. For example, in `@unnumbered The @cite{Book}', TeX
6183 % expanded @cite (which turns out to cause errors because \cite is meant
6184 % to be executed, not expanded).
6186 % Anyway, we don't want the fully-expanded definition of @cite to appear
6187 % as a result of the \message, we just want `@cite' itself. We use
6188 % \the<toks register> to achieve this: TeX expands \the<toks> only once,
6189 % simply yielding the contents of <toks register>. (We also do this for
6192 \message{(\the\toks0)}%
6194 \chapmacro{#1}{Ynothing}{\the\unnumberedno}%
6196 \global\let\section = \unnumberedsec
6197 \global\let\subsection = \unnumberedsubsec
6198 \global\let\subsubsection = \unnumberedsubsubsec
6201 % @centerchap is like @unnumbered, but the heading is centered.
6202 \outer\parseargdef\centerchap{%
6203 \let\centerparametersmaybe = \centerparameters
6205 \let\centerparametersmaybe = \relax
6208 % @top is like @unnumbered.
6213 \outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz
6215 \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
6216 \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}%
6219 % normally calls appendixsectionzzz:
6220 \outer\parseargdef\appendixsection{\apphead1{#1}}
6221 \def\appendixsectionzzz#1{%
6222 \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
6223 \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}%
6225 \let\appendixsec\appendixsection
6227 % normally calls unnumberedseczzz:
6228 \outer\parseargdef\unnumberedsec{\unnmhead1{#1}}
6229 \def\unnumberedseczzz#1{%
6230 \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
6231 \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}%
6236 % normally calls numberedsubseczzz:
6237 \outer\parseargdef\numberedsubsec{\numhead2{#1}}
6238 \def\numberedsubseczzz#1{%
6239 \global\subsubsecno=0 \global\advance\subsecno by 1
6240 \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}%
6243 % normally calls appendixsubseczzz:
6244 \outer\parseargdef\appendixsubsec{\apphead2{#1}}
6245 \def\appendixsubseczzz#1{%
6246 \global\subsubsecno=0 \global\advance\subsecno by 1
6247 \sectionheading{#1}{subsec}{Yappendix}%
6248 {\appendixletter.\the\secno.\the\subsecno}%
6251 % normally calls unnumberedsubseczzz:
6252 \outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}}
6253 \def\unnumberedsubseczzz#1{%
6254 \global\subsubsecno=0 \global\advance\subsecno by 1
6255 \sectionheading{#1}{subsec}{Ynothing}%
6256 {\the\unnumberedno.\the\secno.\the\subsecno}%
6261 % normally numberedsubsubseczzz:
6262 \outer\parseargdef\numberedsubsubsec{\numhead3{#1}}
6263 \def\numberedsubsubseczzz#1{%
6264 \global\advance\subsubsecno by 1
6265 \sectionheading{#1}{subsubsec}{Ynumbered}%
6266 {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}%
6269 % normally appendixsubsubseczzz:
6270 \outer\parseargdef\appendixsubsubsec{\apphead3{#1}}
6271 \def\appendixsubsubseczzz#1{%
6272 \global\advance\subsubsecno by 1
6273 \sectionheading{#1}{subsubsec}{Yappendix}%
6274 {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}%
6277 % normally unnumberedsubsubseczzz:
6278 \outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}}
6279 \def\unnumberedsubsubseczzz#1{%
6280 \global\advance\subsubsecno by 1
6281 \sectionheading{#1}{subsubsec}{Ynothing}%
6282 {\the\unnumberedno.\the\secno.\the\subsecno.\the\subsubsecno}%
6285 % These macros control what the section commands do, according
6286 % to what kind of chapter we are in (ordinary, appendix, or unnumbered).
6287 % Define them by default for a numbered chapter.
6288 \let\section = \numberedsec
6289 \let\subsection = \numberedsubsec
6290 \let\subsubsection = \numberedsubsubsec
6292 % Define @majorheading, @heading and @subheading
6295 {\advance\chapheadingskip by 10pt \chapbreak }%
6296 \parsearg\chapheadingzzz
6299 \def\chapheading{\chapbreak \parsearg\chapheadingzzz}
6300 \def\chapheadingzzz#1{%
6301 \vbox{\chapfonts \raggedtitlesettings #1\par}%
6302 \nobreak\bigskip \nobreak
6303 \suppressfirstparagraphindent
6306 % @heading, @subheading, @subsubheading.
6307 \parseargdef\heading{\sectionheading{#1}{sec}{Yomitfromtoc}{}
6308 \suppressfirstparagraphindent}
6309 \parseargdef\subheading{\sectionheading{#1}{subsec}{Yomitfromtoc}{}
6310 \suppressfirstparagraphindent}
6311 \parseargdef\subsubheading{\sectionheading{#1}{subsubsec}{Yomitfromtoc}{}
6312 \suppressfirstparagraphindent}
6314 % These macros generate a chapter, section, etc. heading only
6315 % (including whitespace, linebreaking, etc. around it),
6316 % given all the information in convenient, parsed form.
6318 % Args are the skip and penalty (usually negative)
6319 \def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}
6321 % Parameter controlling skip before chapter headings (if needed)
6322 \newskip\chapheadingskip
6324 % Define plain chapter starts, and page on/off switching for it.
6325 \def\chapbreak{\dobreak \chapheadingskip {-4000}}
6328 \def\chappager{\par\vfill\supereject}
6330 % \chapoddpage - start on an odd page for a new chapter
6331 % Because \domark is called before \chapoddpage, the filler page will
6332 % get the headings for the next chapter, which is wrong. But we don't
6333 % care -- we just disable all headings on the filler page.
6345 \parseargdef\setchapternewpage{\csname CHAPPAG#1\endcsname\HEADINGSon}
6348 \global\let\contentsalignmacro = \chappager
6349 \global\let\pchapsepmacro=\chapbreak
6350 \global\def\HEADINGSon{\HEADINGSsinglechapoff}}
6353 \global\let\contentsalignmacro = \chappager
6354 \global\let\pchapsepmacro=\chappager
6355 \global\def\HEADINGSon{\HEADINGSsingle}}
6358 \global\let\contentsalignmacro = \chapoddpage
6359 \global\let\pchapsepmacro=\chapoddpage
6360 \global\def\HEADINGSon{\HEADINGSdouble}}
6362 \setchapternewpage on
6364 % \chapmacro - Chapter opening.
6366 % #1 is the text, #2 is the section type (Ynumbered, Ynothing,
6367 % Yappendix, Yomitfromtoc), #3 the chapter number.
6368 % Not used for @heading series.
6370 % To test against our argument.
6371 \def\Ynothingkeyword{Ynothing}
6372 \def\Yappendixkeyword{Yappendix}
6373 \def\Yomitfromtockeyword{Yomitfromtoc}
6376 % Definitions for @thischapter. These can be overridden in translation
6378 \def\thischapterAppendix{%
6379 \putwordAppendix{} \thischapternum: \thischaptername}
6381 \def\thischapterChapter{%
6382 \putwordChapter{} \thischapternum: \thischaptername}
6385 \def\chapmacro#1#2#3{%
6386 \expandafter\ifx\thisenv\titlepage\else
6387 \checkenv{}% chapters, etc., should not start inside an environment.
6389 % Insert the first mark before the heading break (see notes for \domark).
6390 \let\prevchapterdefs=\currentchapterdefs
6391 \let\prevsectiondefs=\currentsectiondefs
6392 \gdef\currentsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}%
6393 \gdef\thissection{}}%
6396 \ifx\temptype\Ynothingkeyword
6397 \gdef\currentchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
6398 \gdef\thischapter{\thischaptername}}%
6399 \else\ifx\temptype\Yomitfromtockeyword
6400 \gdef\currentchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
6401 \gdef\thischapter{}}%
6402 \else\ifx\temptype\Yappendixkeyword
6404 \xdef\currentchapterdefs{%
6405 \gdef\noexpand\thischaptername{\the\toks0}%
6406 \gdef\noexpand\thischapternum{\appendixletter}%
6407 \let\noexpand\thischapter\noexpand\thischapterAppendix
6411 \xdef\currentchapterdefs{%
6412 \gdef\noexpand\thischaptername{\the\toks0}%
6413 \gdef\noexpand\thischapternum{\the\chapno}%
6414 \let\noexpand\thischapter\noexpand\thischapterChapter
6418 % Output the mark. Pass it through \safewhatsit, to take care of
6419 % the preceding space.
6422 % Insert the chapter heading break.
6425 % Now the second mark, after the heading break. No break points
6426 % between here and the heading.
6427 \let\prevchapterdefs=\currentchapterdefs
6428 \let\prevsectiondefs=\currentsectiondefs
6433 \let\footnote=\errfootnoteheading % give better error message
6435 % Have to define \currentsection before calling \donoderef, because the
6436 % xref code eventually uses it. On the other hand, it has to be called
6437 % after \pchapsepmacro, or the headline will change too soon.
6438 \gdef\currentsection{#1}%
6440 % Only insert the separating space if we have a chapter/appendix
6441 % number, and don't print the unnumbered ``number''.
6442 \ifx\temptype\Ynothingkeyword
6444 \def\toctype{unnchap}%
6445 \else\ifx\temptype\Yomitfromtockeyword
6446 \setbox0 = \hbox{}% contents like unnumbered, but no toc entry
6448 \else\ifx\temptype\Yappendixkeyword
6449 \setbox0 = \hbox{\putwordAppendix{} #3\enspace}%
6452 \setbox0 = \hbox{#3\enspace}%
6453 \def\toctype{numchap}%
6456 % Write the toc entry for this chapter. Must come before the
6457 % \donoderef, because we include the current node name in the toc
6458 % entry, and \donoderef resets it to empty.
6459 \writetocentry{\toctype}{#1}{#3}%
6461 % For pdftex, we have to write out the node definition (aka, make
6462 % the pdfdest) after any page break, but before the actual text has
6463 % been typeset. If the destination for the pdf outline is after the
6464 % text, then jumping from the outline may wind up with the text not
6465 % being visible, for instance under high magnification.
6468 % Typeset the actual heading.
6469 \nobreak % Avoid page breaks at the interline glue.
6470 \vbox{\raggedtitlesettings \hangindent=\wd0 \centerparametersmaybe
6473 \nobreak\bigskip % no page break after a chapter title
6477 % @centerchap -- centered and unnumbered.
6478 \let\centerparametersmaybe = \relax
6479 \def\centerparameters{%
6480 \advance\rightskip by 3\rightskip
6481 \leftskip = \rightskip
6486 % Section titles. These macros combine the section number parts and
6487 % call the generic \sectionheading to do the printing.
6489 \newskip\secheadingskip
6490 \def\secheadingbreak{\dobreak \secheadingskip{-1000}}
6492 % Subsection titles.
6493 \newskip\subsecheadingskip
6494 \def\subsecheadingbreak{\dobreak \subsecheadingskip{-500}}
6496 % Subsubsection titles.
6497 \def\subsubsecheadingskip{\subsecheadingskip}
6498 \def\subsubsecheadingbreak{\subsecheadingbreak}
6500 % Definition for @thissection. This can be overridden in translation
6502 \def\thissectionDef{%
6503 \putwordSection{} \thissectionnum: \thissectionname}
6507 % Print any size, any type, section title.
6509 % #1 is the text of the title,
6510 % #2 is the section level (sec/subsec/subsubsec),
6511 % #3 is the section type (Ynumbered, Ynothing, Yappendix, Yomitfromtoc),
6512 % #4 is the section number.
6514 \def\seckeyword{sec}
6516 \def\sectionheading#1#2#3#4{%
6518 \def\sectionlevel{#2}%
6521 % It is ok for the @heading series commands to appear inside an
6522 % environment (it's been historically allowed, though the logic is
6523 % dubious), but not the others.
6524 \ifx\temptype\Yomitfromtockeyword\else
6525 \checkenv{}% non-@*heading should not be in an environment.
6527 \let\footnote=\errfootnoteheading
6529 % Switch to the right set of fonts.
6530 \csname #2fonts\endcsname \rm
6532 % Insert first mark before the heading break (see notes for \domark).
6533 \let\prevsectiondefs=\currentsectiondefs
6534 \ifx\temptype\Ynothingkeyword
6535 \ifx\sectionlevel\seckeyword
6536 \gdef\currentsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}%
6537 \gdef\thissection{\thissectionname}}%
6539 \else\ifx\temptype\Yomitfromtockeyword
6540 % Don't redefine \thissection.
6541 \else\ifx\temptype\Yappendixkeyword
6542 \ifx\sectionlevel\seckeyword
6544 \xdef\currentsectiondefs{%
6545 \gdef\noexpand\thissectionname{\the\toks0}%
6546 \gdef\noexpand\thissectionnum{#4}%
6547 \let\noexpand\thissection\noexpand\thissectionDef
6551 \ifx\sectionlevel\seckeyword
6553 \xdef\currentsectiondefs{%
6554 \gdef\noexpand\thissectionname{\the\toks0}%
6555 \gdef\noexpand\thissectionnum{#4}%
6556 \let\noexpand\thissection\noexpand\thissectionDef
6561 % Go into vertical mode. Usually we'll already be there, but we
6562 % don't want the following whatsit to end up in a preceding paragraph
6563 % if the document didn't happen to have a blank line.
6566 % Output the mark. Pass it through \safewhatsit, to take care of
6567 % the preceding space.
6570 % Insert space above the heading.
6571 \csname #2headingbreak\endcsname
6573 % Now the second mark, after the heading break. No break points
6574 % between here and the heading.
6575 \global\let\prevsectiondefs=\currentsectiondefs
6578 % Only insert the space after the number if we have a section number.
6579 \ifx\temptype\Ynothingkeyword
6582 \gdef\currentsection{#1}%
6583 \else\ifx\temptype\Yomitfromtockeyword
6584 % for @headings -- no section number, don't include in toc,
6585 % and don't redefine \currentsection.
6588 \let\sectionlevel=\empty
6589 \else\ifx\temptype\Yappendixkeyword
6590 \setbox0 = \hbox{#4\enspace}%
6592 \gdef\currentsection{#1}%
6594 \setbox0 = \hbox{#4\enspace}%
6596 \gdef\currentsection{#1}%
6599 % Write the toc entry (before \donoderef). See comments in \chapmacro.
6600 \writetocentry{\toctype\sectionlevel}{#1}{#4}%
6602 % Write the node reference (= pdf destination for pdftex).
6603 % Again, see comments in \chapmacro.
6606 % Interline glue will be inserted when the vbox is completed.
6607 % That glue will be a valid breakpoint for the page, since it'll be
6608 % preceded by a whatsit (usually from the \donoderef, or from the
6609 % \writetocentry if there was no node). We don't want to allow that
6610 % break, since then the whatsits could end up on page n while the
6611 % section is on page n+1, thus toc/etc. are wrong. Debian bug 276000.
6614 % Output the actual section heading.
6615 \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright
6616 \hangindent=\wd0 % zero if no section number
6619 % Add extra space after the heading -- half of whatever came above it.
6620 % Don't allow stretch, though.
6621 \kern .5 \csname #2headingskip\endcsname
6623 % Do not let the kern be a potential breakpoint, as it would be if it
6624 % was followed by glue.
6627 % We'll almost certainly start a paragraph next, so don't let that
6628 % glue accumulate. (Not a breakpoint because it's preceded by a
6629 % discardable item.) However, when a paragraph is not started next
6630 % (\startdefun, \cartouche, \center, etc.), this needs to be wiped out
6631 % or the negative glue will cause weirdly wrong output, typically
6632 % obscuring the section heading with something else.
6635 % This is so the last item on the main vertical list is a known
6636 % \penalty > 10000, so \startdefun, etc., can recognize the situation
6637 % and do the needful.
6643 % Table of contents.
6646 % Write an entry to the toc file, opening it if necessary.
6647 % Called from @chapter, etc.
6649 % Example usage: \writetocentry{sec}{Section Name}{\the\chapno.\the\secno}
6650 % We append the current node name (if any) and page number as additional
6651 % arguments for the \{chap,sec,...}entry macros which will eventually
6652 % read this. The node name is used in the pdf outlines as the
6653 % destination to jump to.
6655 % We open the .toc file for writing here instead of at @setfilename (or
6656 % any other fixed time) so that @contents can be anywhere in the document.
6657 % But if #1 is `omit', then we don't do anything. This is used for the
6658 % table of contents chapter openings themselves.
6660 \newif\iftocfileopened
6661 \def\omitkeyword{omit}%
6663 \def\writetocentry#1#2#3{%
6664 \edef\writetoctype{#1}%
6665 \ifx\writetoctype\omitkeyword \else
6666 \iftocfileopened\else
6667 \immediate\openout\tocfile = \jobname.toc
6668 \global\tocfileopenedtrue
6674 \write\tocfile{@#1entry{#2}{#3}{\lastnode}{\noexpand\folio}}}%
6680 % Tell \shipout to create a pdf destination on each page, if we're
6681 % writing pdf. These are used in the table of contents. We can't
6682 % just write one on every page because the title pages are numbered
6683 % 1 and 2 (the page numbers aren't printed), and so are the first
6684 % two pages of the document. Thus, we'd have two destinations named
6685 % `1', and two named `2'.
6687 \global\pdfmakepagedesttrue
6692 % These characters do not print properly in the Computer Modern roman
6693 % fonts, so we must take special care. This is more or less redundant
6694 % with the Texinfo input format setup at the end of this file.
6696 \def\activecatcodes{%
6709 % Read the toc file, which is essentially Texinfo input.
6713 \input \tocreadfilename
6716 \newskip\contentsrightmargin \contentsrightmargin=1in
6717 \newcount\savepageno
6718 \newcount\lastnegativepageno \lastnegativepageno = -1
6720 % Prepare to read what we've written to \tocfile.
6722 \def\startcontents#1{%
6723 % If @setchapternewpage on, and @headings double, the contents should
6724 % start on an odd page, unlike chapters.
6726 \immediate\closeout\tocfile
6728 % Don't need to put `Contents' or `Short Contents' in the headline.
6729 % It is abundantly clear what they are.
6730 \chapmacro{#1}{Yomitfromtoc}{}%
6732 \savepageno = \pageno
6733 \begingroup % Set up to handle contents files properly.
6734 \raggedbottom % Worry more about breakpoints than the bottom.
6735 \entryrightmargin=\contentsrightmargin % Don't use the full line length.
6737 % Roman numerals for page numbers.
6738 \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi
6739 \def\thistitle{}% no title in double-sided headings
6740 % Record where the Roman numerals started.
6741 \ifnum\romancount=0 \global\romancount=\pagecount \fi
6745 % \raggedbottom in plain.tex hardcodes \topskip so override it
6747 \def\raggedbottom{\advance\topskip by 0pt plus60pt \r@ggedbottomtrue}
6750 % redefined for the two-volume lispref. We always output on
6751 % \jobname.toc even if this is redefined.
6753 \def\tocreadfilename{\jobname.toc}
6755 % Normal (long) toc.
6758 \startcontents{\putwordTOC}%
6759 \openin 1 \tocreadfilename\space
6764 \contentsalignmacro % in case @setchapternewpage odd is in effect
6773 % And just the chapters.
6774 \def\summarycontents{%
6775 \startcontents{\putwordShortTOC}%
6777 \let\partentry = \shortpartentry
6778 \let\numchapentry = \shortchapentry
6779 \let\appentry = \shortchapentry
6780 \let\unnchapentry = \shortunnchapentry
6781 % We want a true roman here for the page numbers.
6783 \let\rm=\shortcontrm \let\bf=\shortcontbf
6784 \let\sl=\shortcontsl \let\tt=\shortconttt
6786 \hyphenpenalty = 10000
6787 \advance\baselineskip by 1pt % Open it up a little.
6788 \def\numsecentry##1##2##3##4{}
6789 \let\appsecentry = \numsecentry
6790 \let\unnsecentry = \numsecentry
6791 \let\numsubsecentry = \numsecentry
6792 \let\appsubsecentry = \numsecentry
6793 \let\unnsubsecentry = \numsecentry
6794 \let\numsubsubsecentry = \numsecentry
6795 \let\appsubsubsecentry = \numsecentry
6796 \let\unnsubsubsecentry = \numsecentry
6797 \openin 1 \tocreadfilename\space
6803 \contentsalignmacro % in case @setchapternewpage odd is in effect
6807 \let\shortcontents = \summarycontents
6809 % Get ready to use Arabic numerals again
6810 \def\contentsendroman{%
6811 \lastnegativepageno = \pageno
6812 \global\pageno = \savepageno
6814 % If \romancount > \arabiccount, the contents are at the end of the
6815 % document. Otherwise, advance where the Arabic numerals start for
6817 \ifnum\romancount>\arabiccount\else\global\arabiccount=\pagecount\fi
6820 % Typeset the label for a chapter or appendix for the short contents.
6821 % The arg is, e.g., `A' for an appendix, or `3' for a chapter.
6823 \def\shortchaplabel#1{%
6824 % This space should be enough, since a single number is .5em, and the
6825 % widest letter (M) is 1em, at least in the Computer Modern fonts.
6826 % But use \hss just in case.
6827 % (This space doesn't include the extra space that gets added after
6828 % the label; that gets put in by \shortchapentry above.)
6830 % We'd like to right-justify chapter numbers, but that looks strange
6831 % with appendix letters. And right-justifying numbers and
6832 % left-justifying letters looks strange when there is less than 10
6833 % chapters. Have to read the whole toc once to know how many chapters
6834 % there are before deciding ...
6835 \hbox to 1em{#1\hss}%
6838 % These macros generate individual entries in the table of contents.
6839 % The first argument is the chapter or section name.
6840 % The last argument is the page number.
6841 % The arguments in between are the chapter number, section number, ...
6843 % Parts, in the main contents. Replace the part number, which doesn't
6844 % exist, with an empty box. Let's hope all the numbers have the same width.
6845 % Also ignore the page number, which is conventionally not printed.
6846 \def\numeralbox{\setbox0=\hbox{8}\hbox to \wd0{\hfil}}
6847 \def\partentry#1#2#3#4{%
6848 % Add stretch and a bonus for breaking the page before the part heading.
6849 % This reduces the chance of the page being broken immediately after the
6850 % part heading, before a following chapter heading.
6851 \vskip 0pt plus 5\baselineskip
6853 \vskip 0pt plus -5\baselineskip
6854 \dochapentry{\numeralbox\labelspace#1}{}%
6857 % Parts, in the short toc.
6858 \def\shortpartentry#1#2#3#4{%
6860 \vskip.5\baselineskip plus.15\baselineskip minus.1\baselineskip
6861 \shortchapentry{{\bf #1}}{\numeralbox}{}{}%
6864 % Chapters, in the main contents.
6865 \def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}}
6867 % Chapters, in the short toc.
6868 % See comments in \dochapentry re vbox and related settings.
6869 \def\shortchapentry#1#2#3#4{%
6870 \tocentry{\shortchaplabel{#2}\labelspace #1}{#4}%
6873 % Appendices, in the main contents.
6874 % Need the word Appendix, and a fixed-size box.
6876 \def\appendixbox#1{%
6877 % We use M since it's probably the widest letter.
6878 \setbox0 = \hbox{\putwordAppendix{} M}%
6879 \hbox to \wd0{\putwordAppendix{} #1\hss}}
6881 \def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\hskip.7em#1}{#4}}
6883 % Unnumbered chapters.
6884 \def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}}
6885 \def\shortunnchapentry#1#2#3#4{\tocentry{#1}{#4}}
6888 \def\numsecentry#1#2#3#4{\dosecentry{#2\labelspace#1}{#4}}
6889 \let\appsecentry=\numsecentry
6890 \def\unnsecentry#1#2#3#4{\dosecentry{#1}{#4}}
6893 \def\numsubsecentry#1#2#3#4{\dosubsecentry{#2\labelspace#1}{#4}}
6894 \let\appsubsecentry=\numsubsecentry
6895 \def\unnsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}}
6897 % And subsubsections.
6898 \def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#2\labelspace#1}{#4}}
6899 \let\appsubsubsecentry=\numsubsubsecentry
6900 \def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#4}}
6902 % This parameter controls the indentation of the various levels.
6903 % Same as \defaultparindent.
6904 \newdimen\tocindent \tocindent = 15pt
6906 % Now for the actual typesetting. In all these, #1 is the text and #2 is the
6909 % If the toc has to be broken over pages, we want it to be at chapters
6910 % if at all possible; hence the \penalty.
6911 \def\dochapentry#1#2{%
6912 \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip
6914 % Move the page numbers slightly to the right
6915 \advance\entryrightmargin by -0.05em
6919 \nobreak\vskip .25\baselineskip plus.1\baselineskip
6922 \def\dosecentry#1#2{\begingroup
6923 \secentryfonts \leftskip=\tocindent
6927 \def\dosubsecentry#1#2{\begingroup
6928 \subsecentryfonts \leftskip=2\tocindent
6932 \def\dosubsubsecentry#1#2{\begingroup
6933 \subsubsecentryfonts \leftskip=3\tocindent
6937 % We use the same \entry macro as for the index entries.
6938 \let\tocentry = \entry
6940 % Space between chapter (or whatever) number and the title.
6941 \def\labelspace{\hskip1em \relax}
6943 \def\chapentryfonts{\secfonts \rm}
6944 \def\secentryfonts{\textfonts}
6945 \def\subsecentryfonts{\textfonts}
6946 \def\subsubsecentryfonts{\textfonts}
6949 \message{environments,}
6950 % @foo ... @end foo.
6952 % @tex ... @end tex escapes into raw TeX temporarily.
6953 % One exception: @ is still an escape character, so that @end tex works.
6954 % But \@ or @@ will get a plain @ character.
6958 \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
6959 \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
6960 \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie
6970 % ' is active in math mode (mathcode"8000). So reset it, and all our
6971 % other math active characters (just in case), to plain's definitions.
6974 % Inverse of the list at the beginning of the file.
6976 \let\bullet=\ptexbullet
6981 \let\equiv=\ptexequiv
6984 \let\indent=\ptexindent
6985 \let\noindent=\ptexnoindent
6992 %\let\sup=\ptexsup % do not redefine, we want @sup to work in math mode
6994 \expandafter \let\csname top\endcsname=\ptextop % we've made it outer
6995 \let\frenchspacing=\plainfrenchspacing
6997 \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
6998 \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}%
7001 % There is no need to define \Etex.
7003 % Define @lisp ... @end lisp.
7004 % @lisp environment forms a group so it can rebind things,
7005 % including the definition of @end lisp (which normally is erroneous).
7007 % Amount to narrow the margins by for @lisp.
7008 \newskip\lispnarrowing \lispnarrowing=0.4in
7010 % This is the definition that ^^M gets inside @lisp, @example, and other
7011 % such environments. \null is better than a space, since it doesn't
7013 \def\lisppar{\null\endgraf}
7015 % This space is always present above and below environments.
7016 \newskip\envskipamount \envskipamount = 0pt
7018 % Make spacing and below environment symmetrical. We use \parskip here
7019 % to help in doing that, since in @example-like environments \parskip
7020 % is reset to zero; thus the \afterenvbreak inserts no space -- but the
7021 % start of the next paragraph will insert \parskip.
7023 \def\aboveenvbreak{{%
7024 % =10000 instead of <10000 because of a special case in \itemzzz and
7025 % \sectionheading, q.v.
7026 \ifnum \lastpenalty=10000 \else
7027 \advance\envskipamount by \parskip
7029 \ifdim\lastskip<\envskipamount
7031 \ifnum\lastpenalty<10000
7032 % Penalize breaking before the environment, because preceding text
7033 % often leads into it.
7036 \vskip\envskipamount
7041 \def\afterenvbreak{{%
7042 % =10000 instead of <10000 because of a special case in \itemzzz and
7043 % \sectionheading, q.v.
7044 \ifnum \lastpenalty=10000 \else
7045 \advance\envskipamount by \parskip
7047 \ifdim\lastskip<\envskipamount
7049 % it's not a good place to break if the last penalty was \nobreak
7051 \ifnum\lastpenalty<10000 \penalty-50 \fi
7052 \vskip\envskipamount
7057 % \nonarrowing is a flag. If "set", @lisp etc don't narrow margins; it will
7058 % also clear it, so that its embedded environments do the narrowing again.
7059 \let\nonarrowing=\relax
7061 % @cartouche ... @end cartouche: draw rectangle w/rounded corners around
7062 % environment contents.
7065 \def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth
7066 \def\ctr{{\hskip 6pt\circle\char'010}}
7067 \def\cbl{{\circle\char'012\hskip -6pt}}
7068 \def\cbr{{\hskip 6pt\circle\char'011}}
7069 \def\carttop{\hbox to \cartouter{\hskip\lskip
7070 \ctl\leaders\hrule height\circthick\hfil\ctr
7072 \def\cartbot{\hbox to \cartouter{\hskip\lskip
7073 \cbl\leaders\hrule height\circthick\hfil\cbr
7076 \newskip\lskip\newskip\rskip
7078 % only require the font if @cartouche is actually used
7079 \def\cartouchefontdefs{%
7080 \font\circle=lcircle10\relax
7081 \circthick=\fontdimen8\circle
7084 \newdimen\cartouter\newdimen\cartinner
7085 \newskip\normbskip\newskip\normpskip\newskip\normlskip
7087 \envparseargdef\cartouche{%
7089 \ifhmode\par\fi % can't be in the midst of a paragraph.
7091 \lskip=\leftskip \rskip=\rightskip
7092 \leftskip=0pt\rightskip=0pt % we want these *outside*.
7094 % Set paragraph width for text inside cartouche. There are
7095 % left and right margins of 3pt each plus two vrules 0.4pt each.
7096 \cartinner=\hsize \advance\cartinner by-\lskip
7097 \advance\cartinner by-\rskip
7098 \advance\cartinner by -6.8pt
7100 % For drawing top and bottom of cartouche. Each corner char
7101 % adds 6pt and we take off the width of a rule to line up with the
7102 % right boundary perfectly.
7104 \advance\cartouter by 11.6pt
7106 \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
7108 % If this cartouche directly follows a sectioning command, we need the
7109 % \parskip glue (backspaced over by default) or the cartouche can
7110 % collide with the section heading.
7111 \ifnum\lastpenalty>10000 \vskip\parskip \penalty\lastpenalty \fi
7113 \setbox\groupbox=\vtop\bgroup
7114 \baselineskip=0pt\parskip=0pt\lineskip=0pt
7121 \baselineskip=\normbskip
7122 \lineskip=\normlskip
7126 \centerV{\hfil \bf #1 \hfil}%
7145 % This macro is called at the beginning of all the @example variants,
7147 \newdimen\nonfillparindent
7150 \ifdim\hfuzz < 12pt \hfuzz = 12pt \fi % Don't be fussy
7151 \sepspaces % Make spaces be word-separators rather than space tokens.
7152 \let\par = \lisppar % don't ignore blank lines
7153 \obeylines % each line of input is a line of output
7155 % Turn off paragraph indentation but redefine \indent to emulate
7156 % the normal \indent.
7157 \nonfillparindent=\parindent
7159 \let\indent\nonfillindent
7161 \emergencystretch = 0pt % don't try to avoid overfull boxes
7162 \ifx\nonarrowing\relax
7163 \advance \leftskip by \lispnarrowing
7164 \exdentamount=\lispnarrowing
7166 \let\nonarrowing = \relax
7168 \let\exdent=\nofillexdent
7173 % We want to swallow spaces (but not other tokens) after the fake
7174 % @indent in our nonfill-environments, where spaces are normally
7175 % active and set to @tie, resulting in them not being ignored after
7177 \gdef\nonfillindent{\futurelet\temp\nonfillindentcheck}%
7178 \gdef\nonfillindentcheck{%
7180 \expandafter\nonfillindentgobble%
7182 \leavevmode\nonfillindentbox%
7186 \def\nonfillindentgobble#1{\nonfillindent}
7187 \def\nonfillindentbox{\hbox to \nonfillparindent{\hss}}
7189 % If you want all examples etc. small: @set dispenvsize small.
7190 % If you want even small examples the full size: @set dispenvsize nosmall.
7191 % This affects the following displayed environments:
7192 % @example, @display, @format, @lisp, @verbatim
7194 \def\smallword{small}
7195 \def\nosmallword{nosmall}
7196 \let\SETdispenvsize\relax
7197 \def\setnormaldispenv{%
7198 \ifx\SETdispenvsize\smallword
7199 % end paragraph for sake of leading, in case document has no blank
7200 % line. This is redundant with what happens in \aboveenvbreak, but
7201 % we need to do it before changing the fonts, and it's inconvenient
7202 % to change the fonts afterward.
7203 \ifnum \lastpenalty=10000 \else \endgraf \fi
7204 \smallexamplefonts \rm
7207 \def\setsmalldispenv{%
7208 \ifx\SETdispenvsize\nosmallword
7210 \ifnum \lastpenalty=10000 \else \endgraf \fi
7211 \smallexamplefonts \rm
7215 % We often define two environments, @foo and @smallfoo.
7216 % Let's do it in one command. #1 is the env name, #2 the definition.
7217 \def\makedispenvdef#1#2{%
7218 \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2}%
7219 \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2}%
7220 \expandafter\let\csname E#1\endcsname \afterenvbreak
7221 \expandafter\let\csname Esmall#1\endcsname \afterenvbreak
7224 % Define two environment synonyms (#1 and #2) for an environment.
7225 \def\maketwodispenvdef#1#2#3{%
7226 \makedispenvdef{#1}{#3}%
7227 \makedispenvdef{#2}{#3}%
7230 % @lisp: indented, narrowed, typewriter font;
7231 % @example: same as @lisp.
7233 % @smallexample and @smalllisp: use smaller fonts.
7234 % Originally contributed by Pavel@xerox.
7236 \maketwodispenvdef{lisp}{example}{%
7239 \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
7242 % @display/@smalldisplay: same as @lisp except keep current font.
7244 \makedispenvdef{display}{%
7249 % @format/@smallformat: same as @display except don't narrow margins.
7251 \makedispenvdef{format}{%
7252 \let\nonarrowing = t%
7257 % @flushleft: same as @format, but doesn't obey \SETdispenvsize.
7259 \let\nonarrowing = t%
7263 \let\Eflushleft = \afterenvbreak
7267 \envdef\flushright{%
7268 \let\nonarrowing = t%
7270 \advance\leftskip by 0pt plus 1fill\relax
7273 \let\Eflushright = \afterenvbreak
7276 % @raggedright does more-or-less normal line breaking but no right
7277 % justification. From plain.tex.
7278 \envdef\raggedright{%
7279 \rightskip0pt plus2.4em \spaceskip.3333em \xspaceskip.5em\relax
7281 \let\Eraggedright\par
7284 % @quotation does normal linebreaking (hence we can't use \nonfillstart)
7285 % and narrows the margins. We keep \parskip nonzero in general, since
7286 % we're doing normal filling. So, when using \aboveenvbreak and
7287 % \afterenvbreak, temporarily make \parskip 0.
7289 \makedispenvdef{quotation}{\quotationstart}
7291 \def\quotationstart{%
7292 \indentedblockstart % same as \indentedblock, but increase right margin too.
7293 \ifx\nonarrowing\relax
7294 \advance\rightskip by \lispnarrowing
7296 \parsearg\quotationlabel
7299 % We have retained a nonzero parskip for the environment, since we're
7300 % doing normal filling.
7304 \ifx\quotationauthor\thisisundefined\else
7306 \leftline{\kern 2\leftskip \sl ---\quotationauthor}%
7308 {\parskip=0pt \afterenvbreak}%
7310 \def\Esmallquotation{\Equotation}
7312 % If we're given an argument, typeset it in bold with a colon after.
7313 \def\quotationlabel#1{%
7315 \ifx\temp\empty \else
7320 % @indentedblock is like @quotation, but indents only on the left and
7321 % has no optional argument.
7323 \makedispenvdef{indentedblock}{\indentedblockstart}
7325 \def\indentedblockstart{%
7326 {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
7329 % @cartouche defines \nonarrowing to inhibit narrowing at next level down.
7330 \ifx\nonarrowing\relax
7331 \advance\leftskip by \lispnarrowing
7332 \exdentamount = \lispnarrowing
7334 \let\nonarrowing = \relax
7338 % Keep a nonzero parskip for the environment, since we're doing normal filling.
7340 \def\Eindentedblock{%
7342 {\parskip=0pt \afterenvbreak}%
7344 \def\Esmallindentedblock{\Eindentedblock}
7347 % LaTeX-like @verbatim...@end verbatim and @verb{<char>...<char>}
7348 % If we want to allow any <char> as delimiter,
7349 % we need the curly braces so that makeinfo sees the @verb command, eg:
7350 % `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org
7352 % [Knuth]: Donald Ervin Knuth, 1996. The TeXbook.
7354 % [Knuth] p.344; only we need to do the other characters Texinfo sets
7355 % active too. Otherwise, they get lost as the first character on a
7358 \do\ \do\\\do\{\do\}\do\$\do\&%
7359 \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~%
7360 \do\<\do\>\do\|\do\@\do+\do\"%
7361 % Don't do the quotes -- if we do, @set txicodequoteundirected and
7362 % @set txicodequotebacktick will not have effect on @verb and
7363 % @verbatim, and ?` and !` ligatures won't get disabled.
7368 \def\uncatcodespecials{%
7369 \def\do##1{\catcode`##1=\other}\dospecials}
7371 % Setup for the @verb command.
7373 % Eight spaces for a tab
7375 \catcode`\^^I=\active
7376 \gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }}
7381 \def\par{\leavevmode\endgraf}%
7385 % Respect line breaks,
7386 % print special symbols as themselves, and
7387 % make each space count
7388 % must do in this order:
7389 \obeylines \uncatcodespecials \sepspaces
7392 % Setup for the @verbatim environment
7394 % Real tab expansion.
7395 \newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount
7397 % We typeset each line of the verbatim in an \hbox, so we can handle
7400 \def\starttabbox{\setbox\verbbox=\hbox\bgroup}
7403 \catcode`\^^I=\active
7405 \catcode`\^^I=\active
7406 \def^^I{\leavevmode\egroup
7407 \dimen\verbbox=\wd\verbbox % the width so far, or since the previous tab
7408 \divide\dimen\verbbox by\tabw
7409 \multiply\dimen\verbbox by\tabw % compute previous multiple of \tabw
7410 \advance\dimen\verbbox by\tabw % advance to next multiple of \tabw
7411 \wd\verbbox=\dimen\verbbox
7412 \leavevmode\box\verbbox \starttabbox
7417 % start the verbatim environment.
7418 \def\setupverbatim{%
7419 \let\nonarrowing = t%
7421 \tt % easiest (and conventionally used) font for verbatim
7422 \def\par{\egroup\leavevmode\box\verbbox\endgraf\starttabbox}%
7425 % Respect line breaks,
7426 % print special symbols as themselves, and
7427 % make each space count.
7428 % Must do in this order:
7429 \obeylines \uncatcodespecials \sepspaces
7432 % Do the @verb magic: verbatim text is quoted by unique
7433 % delimiter characters. Before first delimiter expect a
7434 % right brace, after last delimiter expect closing brace:
7436 % \def\doverb'{'<char>#1<char>'}'{#1}
7438 % [Knuth] p. 382; only eat outer {}
7440 \catcode`[=1\catcode`]=2\catcode`\{=\other\catcode`\}=\other
7441 \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next]
7444 \def\verb{\begingroup\setupverb\doverb}
7447 % Do the @verbatim magic: define the macro \doverbatim so that
7448 % the (first) argument ends when '@end verbatim' is reached, ie:
7450 % \def\doverbatim#1@end verbatim{#1}
7452 % For Texinfo it's a lot easier than for LaTeX,
7453 % because texinfo's \verbatim doesn't stop at '\end{verbatim}':
7454 % we need not redefine '\', '{' and '}'.
7456 % Inspired by LaTeX's verbatim command set [latex.ltx]
7461 % ignore everything up to the first ^^M, that's the newline at the end
7462 % of the @verbatim input line itself. Otherwise we get an extra blank
7463 % line in the output.
7464 \xdef\doverbatim#1^^M#2@end verbatim{%
7465 \starttabbox#2\egroup\noexpand\end\gobble verbatim}%
7466 % We really want {...\end verbatim} in the body of the macro, but
7467 % without the active space; thus we have to use \xdef and \gobble.
7468 % The \egroup ends the \verbbox started at the end of the last line in
7473 \setnormaldispenv\setupverbatim\doverbatim
7475 \let\Everbatim = \afterenvbreak
7478 % @verbatiminclude FILE - insert text of file in verbatim environment.
7480 \def\verbatiminclude{\parseargusing\filenamecatcodes\doverbatiminclude}
7482 \def\doverbatiminclude#1{%
7484 \makevalueexpandable
7487 \indexnofonts % Allow `@@' and other weird things in file names.
7488 \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}%
7489 \edef\tmp{\noexpand\input #1 }
7491 }\expandafter\starttabbox\tmp\egroup
7496 % @copying ... @end copying.
7497 % Save the text away for @insertcopying later.
7499 % We save the uninterpreted tokens, rather than creating a box.
7500 % Saving the text in a box would be much easier, but then all the
7501 % typesetting commands (@smallbook, font changes, etc.) have to be done
7502 % beforehand -- and a) we want @copying to be done first in the source
7503 % file; b) letting users define the frontmatter in as flexible order as
7504 % possible is desirable.
7506 \def\copying{\checkenv{}\begingroup\macrobodyctxt\docopying}
7508 \gdef\docopying#1@end copying{\endgroup\def\copyingtext{#1}}
7511 \def\insertcopying{%
7513 \parindent = 0pt % paragraph indentation looks wrong on title page
7514 \scanexp\copyingtext
7522 \newskip\defbodyindent \defbodyindent=.4in
7523 \newskip\defargsindent \defargsindent=50pt
7524 \newskip\deflastargmargin \deflastargmargin=18pt
7525 \newcount\defunpenalty
7527 % Start the processing of @deffn:
7529 \ifnum\lastpenalty<10000
7531 \defunpenalty=10003 % Will keep this @deffn together with the
7532 % following @def command, see below.
7534 % If there are two @def commands in a row, we'll have a \nobreak,
7535 % which is there to keep the function description together with its
7536 % header. But if there's nothing but headers, we need to allow a
7537 % break somewhere. Check specifically for penalty 10002, inserted
7538 % by \printdefunline, instead of 10000, since the sectioning
7539 % commands also insert a nobreak penalty, and we don't want to allow
7540 % a break between a section heading and a defun.
7542 % As a further refinement, we avoid "club" headers by signalling
7543 % with penalty of 10003 after the very first @deffn in the
7544 % sequence (see above), and penalty of 10002 after any following
7546 \ifnum\lastpenalty=10002 \penalty2000 \else \defunpenalty=10002 \fi
7548 % Similarly, after a section heading, do not allow a break.
7549 % But do insert the glue.
7550 \medskip % preceded by discardable penalty, so not a breakpoint
7554 \advance\leftskip by \defbodyindent
7555 \exdentamount=\defbodyindent
7558 % Called as \printdefunline \deffooheader{text}
7560 \def\printdefunline#1#2{%
7563 % call \deffooheader:
7566 \interlinepenalty = 10000
7567 \advance\rightskip by 0pt plus 1fil\relax
7569 \nobreak\vskip -\parskip
7570 \penalty\defunpenalty % signal to \startdefun and \deffoox
7571 % Some of the @defun-type tags do not enable magic parentheses,
7572 % rendering the following check redundant. But we don't optimize.
7577 \def\Edefun{\endgraf\medbreak}
7579 % @defblock, @defline do not automatically create index entries
7583 \let\Edefblock\Edefun
7587 \parseargusing\activeparens{\printdefunline\deflineheader}%
7589 \def\deflineheader#1 #2 #3\endheader{%
7590 \printdefname{#1}{}{#2}\magicamp\defunargs{#3\unskip}%
7594 \parseargusing\activeparens{\printdefunline\deflineheader}%
7597 % \makedefun{deffoo} (\deffooheader parameters) { (\deffooheader expansion) }
7599 % Define \deffoo, \deffoox \Edeffoo and \deffooheader.
7601 \expandafter\let\csname E#1\endcsname = \Edefun
7602 \edef\temp{\noexpand\domakedefun
7603 \makecsname{#1}\makecsname{#1x}\makecsname{#1header}}%
7606 \def\domakedefun#1#2#3{%
7609 \doingtypefnfalse % distinguish typed functions from all else
7610 \parseargusing\activeparens{\printdefunline#3}%
7613 % First, check whether we are in the right environment:
7616 % As in \startdefun, allow line break if we have multiple x headers
7617 % in a row. It's not a great place, though.
7618 \ifnum\lastpenalty=10002 \penalty3000 \else \defunpenalty=10002 \fi
7620 \doingtypefnfalse % distinguish typed functions from all else
7621 \parseargusing\activeparens{\printdefunline#3}%
7623 \def#3% definition of \deffooheader follows
7626 \newif\ifdoingtypefn % doing typed function?
7627 \newif\ifrettypeownline % typeset return type on its own line?
7629 % @deftypefnnewline on|off says whether the return type of typed functions
7630 % are printed on their own line. This affects @deftypefn, @deftypefun,
7631 % @deftypeop, and @deftypemethod.
7633 \parseargdef\deftypefnnewline{%
7636 \expandafter\let\csname SETtxideftypefnnl\endcsname
7638 \else\ifx\temp\offword
7639 \expandafter\let\csname SETtxideftypefnnl\endcsname
7642 \errhelp = \EMsimple
7643 \errmessage{Unknown @txideftypefnnl value `\temp',
7648 % Untyped functions:
7650 % @deffn category name args
7651 \makedefun{deffn}#1 #2 #3\endheader{%
7652 \doind{fn}{\code{#2}}%
7653 \printdefname{#1}{}{#2}\magicamp\defunargs{#3\unskip}%
7656 % @defop category class name args
7657 \makedefun{defop}#1 {\defopheaderx{#1\ \putwordon}}
7658 \def\defopheaderx#1#2 #3 #4\endheader{%
7659 \doind{fn}{\code{#3}\space\putwordon\ \code{#2}}%
7660 \printdefname{#1\ \code{#2}}{}{#3}\magicamp\defunargs{#4\unskip}%
7665 % @deftypefn category type name args
7666 \makedefun{deftypefn}#1 #2 #3 #4\endheader{%
7667 \doind{fn}{\code{#3}}%
7669 \printdefname{#1}{#2}{#3}\defunargs{#4\unskip}%
7672 % @deftypeop category class type name args
7673 \makedefun{deftypeop}#1 {\deftypeopheaderx{#1\ \putwordon}}
7674 \def\deftypeopheaderx#1#2 #3 #4 #5\endheader{%
7675 \doind{fn}{\code{#4}\space\putwordon\ \code{#1\ \code{#2}}}%
7677 \printdefname{#1\ \code{#2}}{#3}{#4}\defunargs{#5\unskip}%
7682 % @deftypevr category type var args
7683 \makedefun{deftypevr}#1 #2 #3 #4\endheader{%
7684 \doind{vr}{\code{#3}}%
7685 \printdefname{#1}{#2}{#3}\defunargs{#4\unskip}%
7688 % @deftypecv category class type var args
7689 \makedefun{deftypecv}#1 {\deftypecvheaderx{#1\ \putwordof}}
7690 \def\deftypecvheaderx#1#2 #3 #4 #5\endheader{%
7691 \doind{vr}{\code{#4}\space\putwordof\ \code{#2}}%
7692 \printdefname{#1\ \code{#2}}{#3}{#4}\defunargs{#5\unskip}%
7695 % Untyped variables:
7697 % @defvr category var args
7698 \makedefun{defvr}#1 {\deftypevrheader{#1} {} }
7700 % @defcv category class var args
7701 \makedefun{defcv}#1 {\defcvheaderx{#1\ \putwordof}}
7702 \def\defcvheaderx#1#2 {\deftypecvheaderx{#1}#2 {} }
7706 % @deftp category name args
7707 \makedefun{deftp}#1 #2 #3\endheader{%
7708 \doind{tp}{\code{#2}}%
7709 \printdefname{#1}{}{#2}\defunargs{#3\unskip}%
7712 % Remaining @defun-like shortcuts:
7713 \makedefun{defun}{\deffnheader{\putwordDeffunc} }
7714 \makedefun{defmac}{\deffnheader{\putwordDefmac} }
7715 \makedefun{defspec}{\deffnheader{\putwordDefspec} }
7716 \makedefun{deftypefun}{\deftypefnheader{\putwordDeffunc} }
7717 \makedefun{defvar}{\defvrheader{\putwordDefvar} }
7718 \makedefun{defopt}{\defvrheader{\putwordDefopt} }
7719 \makedefun{deftypevar}{\deftypevrheader{\putwordDefvar} }
7720 \makedefun{defmethod}{\defopheaderx\putwordMethodon}
7721 \makedefun{deftypemethod}{\deftypeopheaderx\putwordMethodon}
7722 \makedefun{defivar}{\defcvheaderx\putwordInstanceVariableof}
7723 \makedefun{deftypeivar}{\deftypecvheaderx\putwordInstanceVariableof}
7725 % \printdefname, which formats the name of the @def (not the args).
7726 % #1 is the category, such as "Function".
7727 % #2 is the return type, if any.
7728 % #3 is the function name.
7730 % We are followed by (but not passed) the arguments, if any.
7732 \def\printdefname#1#2#3{%
7734 % Get the values of \leftskip and \rightskip as they were outside the @def...
7735 \advance\leftskip by -\defbodyindent
7737 % Determine if we are typesetting the return type of a typed function
7738 % on a line by itself.
7739 \rettypeownlinefalse
7740 \ifdoingtypefn % doing a typed function specifically?
7741 % then check user option for putting return type on its own line:
7742 \ifflagclear{txideftypefnnl}{}{\rettypeownlinetrue}%
7745 % How we'll format the category name. Putting it in brackets helps
7746 % distinguish it from the body text that may end up on the next line
7749 \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi}
7751 % Figure out line sizes for the paragraph shape. We'll always have at
7755 % The first line needs space for \box0; but if \rightskip is nonzero,
7756 % we need only space for the part of \box0 which exceeds it:
7757 \dimen0=\hsize \advance\dimen0 by -\wd0 \advance\dimen0 by \rightskip
7759 % If doing a return type on its own line, we'll have another line.
7761 \advance\tempnum by 1
7762 \def\maybeshapeline{0in \hsize}%
7764 \def\maybeshapeline{}%
7767 % The continuations:
7768 \dimen2=\hsize \advance\dimen2 by -\defargsindent
7770 % The final paragraph shape:
7771 \parshape \tempnum 0in \dimen0 \maybeshapeline \defargsindent \dimen2
7773 % Put the category name at the right margin.
7776 \hfil\box0 \kern-\hsize
7777 % \hsize has to be shortened this way:
7779 % Intentionally do not respect \rightskip, since we need the space.
7782 % Allow all lines to be underfull without complaint:
7783 \tolerance=10000 \hbadness=10000
7784 \exdentamount=\defbodyindent
7786 % defun fonts. We use typewriter by default (used to be bold) because:
7787 % . we're printing identifiers, they should be in tt in principle.
7788 % . in languages with many accents, such as Czech or French, it's
7789 % common to leave accents off identifiers. The result looks ok in
7790 % tt, but exceedingly strange in rm.
7791 % . we don't want -- and --- to be treated as ligatures.
7792 % . this still does not fix the ?` and !` ligatures, but so far no
7793 % one has made identifiers using them :).
7795 \def\temp{#2}% text of the return type
7796 \ifx\temp\empty\else
7797 \tclose{\temp}% typeset the return type
7799 % put return type on its own line; prohibit line break following:
7800 \hfil\vadjust{\nobreak}\break
7802 \space % type on same line, so just followed by a space
7804 \fi % no return type
7805 #3% output function name
7807 \ifflagclear{txidefnamenospace}{%
7808 {\rm\enskip}% hskip 0.5 em of \rmfont
7812 % arguments will be output next, if any.
7815 % Print arguments. Use slanted for @def*, typewriter for @deftype*.
7818 \df \ifdoingtypefn \tt \else \sl \fi
7819 \ifflagclear{txicodevaristt}{}%
7820 {\def\var##1{{\setregularquotes \ttsl ##1}}}%
7825 % We want ()&[] to print specially on the defun line.
7828 \catcode`\(=\active \catcode`\)=\active
7829 \catcode`\[=\active \catcode`\]=\active
7833 % Make control sequences which act like normal parenthesis chars.
7834 \let\lparen = ( \let\rparen = )
7836 % Be sure that we always have a definition for `(', etc. For example,
7837 % if the fn name has parens in it, \boldbrax will not be in effect yet,
7838 % so TeX would otherwise complain about undefined control sequence.
7841 \gdef\defcharsdefault{%
7842 \let(=\lparen \let)=\rparen
7843 \let[=\lbrack \let]=\rbrack
7846 \globaldefs=1 \defcharsdefault
7848 \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}
7849 \gdef\magicamp{\let&=\amprm}
7853 \newcount\parencount
7855 % If we encounter &foo, then turn on ()-hacking afterwards
7857 \def\amprm#1 {\ampseentrue{\rm\ }}
7861 % At the first level, print parens in roman,
7862 % otherwise use the default font.
7863 \ifnum \parencount=1 \rm \fi
7865 % The \sf parens (in \boldbrax) actually are a little bolder than
7866 % the contained text. This is especially needed for [ and ] .
7870 \def\infirstlevel#1{%
7877 \def\bfafterword#1 {#1 \bf}
7880 \global\advance\parencount by 1
7882 \infirstlevel \bfafterword
7887 \global\advance\parencount by -1
7890 \newcount\brackcount
7892 \global\advance\brackcount by 1
7897 \global\advance\brackcount by -1
7900 \def\checkparencounts{%
7901 \ifnum\parencount=0 \else \badparencount \fi
7902 \ifnum\brackcount=0 \else \badbrackcount \fi
7904 % these should not use \errmessage; the glibc manual, at least, actually
7905 % has such constructs (when documenting function pointers).
7906 \def\badparencount{%
7907 \message{Warning: unbalanced parentheses in @def...}%
7908 \global\parencount=0
7910 \def\badbrackcount{%
7911 \message{Warning: unbalanced square brackets in @def...}%
7912 \global\brackcount=0
7919 % To do this right we need a feature of e-TeX, \scantokens,
7920 % which we arrange to emulate with a temporary file in ordinary TeX.
7921 \ifx\eTeXversion\thisisundefined
7922 \newwrite\macscribble
7925 \immediate\openout\macscribble=\jobname.tmp
7926 \immediate\write\macscribble{\the\toks0}%
7927 \immediate\closeout\macscribble
7934 % Used at the time of macro expansion.
7935 % Argument is macro body with arguments substituted
7938 % expand the expansion of \eatleadingcr twice to maybe remove a leading
7939 % newline (and \else and \fi tokens), then call \eatspaces on the result.
7940 \def\xeatspaces##1{%
7941 \E\E\E\E\E\E\E\eatspaces\E\E\E\E\E\E\E{\eatleadingcr##1%
7945 % Process the macro body under the current catcode regime.
7946 \scantokens{#1@comment}%
7948 % The \comment is to remove the \newlinechar added by \scantokens, and
7949 % can be noticed by \parsearg. Note \c isn't used because this means cedilla
7953 % Used for copying and captions
7955 \expandafter\scanmacro\expandafter{#1}%
7958 \newcount\paramno % Count of parameters
7959 \newtoks\macname % Macro name
7960 \newif\ifrecursive % Is it recursive?
7962 % List of all defined macros in the form
7963 % \commondummyword\macro1\commondummyword\macro2...
7964 % Currently is also contains all @aliases; the list can be split
7965 % if there is a need.
7968 % Add the macro to \macrolist
7969 \def\addtomacrolist#1{\expandafter \addtomacrolistxxx \csname#1\endcsname}
7970 \def\addtomacrolistxxx#1{%
7971 \toks0 = \expandafter{\macrolist\commondummyword#1}%
7972 \xdef\macrolist{\the\toks0}%
7976 % This does \let #1 = #2, with \csnames; that is,
7977 % \let \csname#1\endcsname = \csname#2\endcsname
7978 % (except of course we have to play expansion games).
7982 \csname#1\expandafter\endcsname
7986 % Trim leading and trailing spaces off a string.
7987 % Concepts from aro-bend problem 15 (see CTAN).
7989 \gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }}
7990 \gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@}
7991 \gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @}
7993 \unbrace{\gdef\trim@@@ #1 } #2@{#1}
7996 {\catcode`\^^M=\other%
7997 \gdef\eatleadingcr#1{\if\noexpand#1\noexpand^^M\else\E#1\fi}}%
7998 % Warning: this won't work for a delimited argument
7999 % or for an empty argument
8001 % Trim a single trailing ^^M off a string.
8002 {\catcode`\^^M=\other \catcode`\Q=3%
8003 \gdef\eatcr #1{\eatcra #1Q^^MQ}%
8004 \gdef\eatcra#1^^MQ{\eatcrb#1Q}%
8005 \gdef\eatcrb#1Q#2Q{#1}%
8008 % Macro bodies are absorbed as an argument in a context where
8009 % all characters are catcode 10, 11 or 12, except \ which is active
8010 % (as in normal texinfo). It is necessary to change the definition of \
8011 % to recognize macro arguments; this is the job of \mbodybackslash.
8013 % Non-ASCII encodings make 8-bit characters active, so un-activate
8014 % them to avoid their expansion. Must do this non-globally, to
8015 % confine the change to the current group.
8017 % It's necessary to have hard CRs when the macro is executed. This is
8018 % done by making ^^M (\endlinechar) catcode 12 when reading the macro
8019 % body, and then making it the \newlinechar in \scanmacro.
8021 \def\scanctxt{% used as subroutine
8031 \catcode`\^^M=\other
8033 \passthroughcharstrue
8036 \def\macrobodyctxt{% used for @macro definitions and @copying
8043 % Used when scanning braced macro arguments. Note, however, that catcode
8044 % changes here are ineffectual if the macro invocation was nested inside
8045 % an argument to another Texinfo command.
8051 \def\macrolineargctxt{% used for whole-line arguments without braces
8057 % \mbodybackslash is the definition of \ in @macro bodies.
8058 % It maps \foo\ => \csname macarg.foo\endcsname => #N
8059 % where N is the macro parameter number.
8060 % We define \csname macarg.\endcsname to be \realbackslash, so
8061 % \\ in macro replacement text gets you a backslash.
8063 {\catcode`@=0 @catcode`@\=@active
8064 @gdef@usembodybackslash{@let\=@mbodybackslash}
8065 @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname}
8067 \expandafter\def\csname macarg.\endcsname{\realbackslash}
8069 \def\margbackslash#1{\char`\#1 }
8071 \def\macro{\recursivefalse\parsearg\macroxxx}
8072 \def\rmacro{\recursivetrue\parsearg\macroxxx}
8075 \getargs{#1}% now \macname is the macname and \argl the arglist
8076 \ifx\argl\empty % no arguments
8079 \expandafter\parsemargdef \argl;%
8080 \if\paramno>256\relax
8081 \ifx\eTeXversion\thisisundefined
8082 \errhelp = \EMsimple
8083 \errmessage{You need eTeX to compile a file with macros with more than 256 arguments}
8087 \if1\csname ismacro.\the\macname\endcsname
8088 \message{Warning: redefining \the\macname}%
8090 \expandafter\ifx\csname \the\macname\endcsname \relax
8091 \else \errmessage{Macro name \the\macname\space already defined}\fi
8092 \global\cslet{macsave.\the\macname}{\the\macname}%
8093 \global\expandafter\let\csname ismacro.\the\macname\endcsname=1%
8094 \addtomacrolist{\the\macname}%
8096 \begingroup \macrobodyctxt \usembodybackslash
8097 \ifrecursive \expandafter\parsermacbody
8098 \else \expandafter\parsemacbody
8101 \parseargdef\unmacro{%
8102 \if1\csname ismacro.#1\endcsname
8103 \global\cslet{#1}{macsave.#1}%
8104 \global\expandafter\let \csname ismacro.#1\endcsname=0%
8105 % Remove the macro name from \macrolist:
8107 \expandafter\let\csname#1\endcsname \relax
8108 \let\commondummyword\unmacrodo
8109 \xdef\macrolist{\macrolist}%
8112 \errmessage{Macro #1 not defined}%
8116 % Called by \do from \dounmacro on each macro. The idea is to omit any
8117 % macro definitions that have been changed to \relax.
8123 \noexpand\commondummyword \noexpand#1%
8127 % \getargs -- Parse the arguments to a @macro line. Set \macname to
8128 % the name of the macro, and \argl to the braced argument list.
8129 \def\getargs#1{\getargsxxx#1{}}
8130 \def\getargsxxx#1#{\getmacname #1 \relax\getmacargs}
8131 \def\getmacname#1 #2\relax{\macname={#1}}
8132 \def\getmacargs#1{\def\argl{#1}}
8133 % This made use of the feature that if the last token of a
8134 % <parameter list> is #, then the preceding argument is delimited by
8135 % an opening brace, and that opening brace is not consumed.
8137 % Parse the optional {params} list to @macro or @rmacro.
8138 % Set \paramno to the number of arguments,
8139 % and \paramlist to a parameter text for the macro (e.g. #1,#2,#3 for a
8140 % three-param macro.) Define \macarg.BLAH for each BLAH in the params
8141 % list to some hook where the argument is to be expanded. If there are
8142 % less than 10 arguments that hook is to be replaced by ##N where N
8143 % is the position in that list, that is to say the macro arguments are to be
8144 % defined `a la TeX in the macro body.
8146 % That gets used by \mbodybackslash (above).
8148 % If there are 10 or more arguments, a different technique is used: see
8149 % \parsemmanyargdef.
8151 \def\parsemargdef#1;{%
8152 \paramno=0\def\paramlist{}%
8154 % \hash is redefined to `#' later to get it into definitions
8155 \let\xeatspaces\relax
8157 \parsemargdefxxx#1,;,%
8158 \ifnum\paramno<10\relax\else
8160 \parsemmanyargdef@@#1,;,% 10 or more arguments
8163 \def\parsemargdefxxx#1,{%
8164 \if#1;\let\next=\relax
8165 \else \let\next=\parsemargdefxxx
8166 \advance\paramno by 1
8167 \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname
8168 {\xeatspaces{\hash\the\paramno\noexpand\xempty{}}}%
8169 \edef\paramlist{\paramlist\hash\the\paramno,}%
8171 % the \xempty{} is to give \eatleadingcr an argument in the case of an
8172 % empty macro argument.
8174 % \parsemacbody, \parsermacbody
8176 % Read recursive and nonrecursive macro bodies. (They're different since
8177 % rec and nonrec macros end differently.)
8179 % We are in \macrobodyctxt, and the \xdef causes backslashshes in the macro
8180 % body to be transformed.
8181 % Set \macrobody to the body of the macro, and call \macrodef.
8183 {\catcode`\ =\other\long\gdef\parsemacbody#1@end macro{%
8184 \xdef\macrobody{\eatcr{#1}}\endgroup\macrodef}}%
8185 {\catcode`\ =\other\long\gdef\parsermacbody#1@end rmacro{%
8186 \xdef\macrobody{\eatcr{#1}}\endgroup\macrodef}}%
8188 % Make @ a letter, so that we can make private-to-Texinfo macro names.
8189 \edef\texiatcatcode{\the\catcode`\@}
8190 \catcode `@=11\relax
8192 %%%%%%%%%%%%%% Code for > 10 arguments only %%%%%%%%%%%%%%%%%%
8194 % If there are 10 or more arguments, a different technique is used, where the
8195 % hook remains in the body, and when macro is to be expanded the body is
8196 % processed again to replace the arguments.
8198 % In that case, the hook is \the\toks N-1, and we simply set \toks N-1 to the
8199 % argument N value and then \edef the body (nothing else will expand because of
8200 % the catcode regime under which the body was input).
8202 % If you compile with TeX (not eTeX), and you have macros with 10 or more
8203 % arguments, no macro can have more than 256 arguments (else error).
8205 % In case that there are 10 or more arguments we parse again the arguments
8206 % list to set new definitions for the \macarg.BLAH macros corresponding to
8207 % each BLAH argument. It was anyhow needed to parse already once this list
8208 % in order to count the arguments, and as macros with at most 9 arguments
8209 % are by far more frequent than macro with 10 or more arguments, defining
8210 % twice the \macarg.BLAH macros does not cost too much processing power.
8211 \def\parsemmanyargdef@@#1,{%
8212 \if#1;\let\next=\relax
8214 \let\next=\parsemmanyargdef@@
8215 \edef\tempb{\eatspaces{#1}}%
8216 \expandafter\def\expandafter\tempa
8217 \expandafter{\csname macarg.\tempb\endcsname}%
8218 % Note that we need some extra \noexpand\noexpand, this is because we
8219 % don't want \the to be expanded in the \parsermacbody as it uses an
8221 \expandafter\edef\tempa
8222 {\noexpand\noexpand\noexpand\the\toks\the\paramno}%
8223 \advance\paramno by 1\relax
8230 \long\def\nillm@{\nil@}%
8232 % This macro is expanded during the Texinfo macro expansion, not during its
8233 % definition. It gets all the arguments' values and assigns them to macros
8236 % #1 is the macro name
8237 % #2 is the list of argument names
8238 % #3 is the list of argument values
8239 \def\getargvals@#1#2#3{%
8240 \def\macargdeflist@{}%
8241 \def\saveparamlist@{#2}% Need to keep a copy for parameter expansion.
8242 \def\paramlist{#2,\nil@}%
8246 \def\argvaluelist{#3,\nil@}%
8255 \ifx\paramlist\nilm@
8256 % Some sanity check needed here that \argvaluelist is also empty.
8257 \ifx\argvaluelist\nillm@
8259 \errhelp = \EMsimple
8260 \errmessage{Too many arguments in macro `\macroname'!}%
8262 \let\next\macargexpandinbody@
8264 \ifx\argvaluelist\nillm@
8265 % No more arguments values passed to macro. Set remaining named-arg
8267 \let\next\setemptyargvalues@
8269 % pop current arg name into \@tempb
8270 \def\@tempa##1{\pop@{\@tempb}{\paramlist}##1\endargs@}%
8271 \expandafter\@tempa\expandafter{\paramlist}%
8272 % pop current argument value into \@tempc
8273 \def\@tempa##1{\longpop@{\@tempc}{\argvaluelist}##1\endargs@}%
8274 \expandafter\@tempa\expandafter{\argvaluelist}%
8275 % Here \@tempb is the current arg name and \@tempc is the current arg value.
8276 % First place the new argument macro definition into \@tempd
8277 \expandafter\macname\expandafter{\@tempc}%
8278 \expandafter\let\csname macarg.\@tempb\endcsname\relax
8279 \expandafter\def\expandafter\@tempe\expandafter{%
8280 \csname macarg.\@tempb\endcsname}%
8281 \edef\@tempd{\long\def\@tempe{\the\macname}}%
8282 \push@\@tempd\macargdeflist@
8283 \let\next\getargvals@@
8290 \expandafter\expandafter\expandafter\def
8291 \expandafter\expandafter\expandafter#2%
8292 \expandafter\expandafter\expandafter{%
8296 % Replace arguments by their values in the macro body, and place the result
8299 \def\macvalstoargs@{%
8300 % To do this we use the property that token registers that are \the'ed
8301 % within an \edef expand only once. So we are going to place all argument
8302 % values into respective token registers.
8304 % First we save the token context, and initialize argument numbering.
8307 % Then, for each argument number #N, we place the corresponding argument
8308 % value into a new token list register \toks#N
8309 \expandafter\putargsintokens@\saveparamlist@,;,%
8310 % Then, we expand the body so that argument are replaced by their
8311 % values. The trick for values not to be expanded themselves is that they
8312 % are within tokens and that tokens expand only once in an \edef .
8313 \edef\@tempc{\csname mac.\macroname .body\endcsname}%
8314 % Now we restore the token stack pointer to free the token list registers
8315 % which we have used, but we make sure that expanded body is saved after
8319 \expandafter\def\expandafter\@tempa\expandafter{\@tempc}%
8322 % Define the named-macro outside of this group and then close this group.
8324 \def\macargexpandinbody@{%
8328 % First the replace in body the macro arguments by their values, the result
8331 % Then we point at the \norecurse or \gobble (for recursive) macro value
8333 \expandafter\let\expandafter\@tempb\csname mac.\macroname .recurse\endcsname
8334 % Depending on whether it is recursive or not, we need some tailing
8341 % And now we do the real job:
8342 \edef\@tempd{\noexpand\@tempb{\macroname}\noexpand\scanmacro{\@tempa}\@tempc}%
8346 \def\putargsintokens@#1,{%
8347 \if#1;\let\next\relax
8349 \let\next\putargsintokens@
8350 % First we allocate the new token list register, and give it a temporary
8352 \toksdef\@tempb\the\paramno
8353 % Then we place the argument value into that token list register.
8354 \expandafter\let\expandafter\@tempa\csname macarg.#1\endcsname
8355 \expandafter\@tempb\expandafter{\@tempa}%
8356 \advance\paramno by 1\relax
8361 % Trailing missing arguments are set to empty.
8363 \def\setemptyargvalues@{%
8364 \ifx\paramlist\nilm@
8365 \let\next\macargexpandinbody@
8367 \expandafter\setemptyargvaluesparser@\paramlist\endargs@
8368 \let\next\setemptyargvalues@
8373 \def\setemptyargvaluesparser@#1,#2\endargs@{%
8374 \expandafter\def\expandafter\@tempa\expandafter{%
8375 \expandafter\def\csname macarg.#1\endcsname{}}%
8376 \push@\@tempa\macargdeflist@
8380 % #1 is the element target macro
8381 % #2 is the list macro
8382 % #3,#4\endargs@ is the list value
8383 \def\pop@#1#2#3,#4\endargs@{%
8387 \long\def\longpop@#1#2#3,#4\endargs@{%
8393 %%%%%%%%%%%%%% End of code for > 10 arguments %%%%%%%%%%%%%%%%%%
8396 % This defines a Texinfo @macro or @rmacro, called by \parsemacbody.
8397 % \macrobody has the body of the macro in it, with placeholders for
8398 % its parameters, looking like "\xeatspaces{\hash 1}".
8399 % \paramno is the number of parameters
8400 % \paramlist is a TeX parameter text, e.g. "#1,#2,#3,"
8401 % There are four cases: macros of zero, one, up to nine, and many arguments.
8402 % \xdef is used so that macro definitions will survive the file
8403 % they're defined in: @include reads the file inside a group.
8406 \let\hash=##% convert placeholders to macro parameter chars
8408 \long\def\xeatspaces##1{##1}%
8409 % We don't use \xeatspaces for single-argument macros, because we
8410 % want to keep ends of lines. This definition removes \xeatspaces
8411 % when \macrobody is expanded below.
8413 \def\xeatspaces{\string\xeatspaces}%
8414 % This expands \xeatspaces as a sequence of character tokens, which
8415 % stops \scantokens inserting an extra space after the control sequence.
8419 \expandafter\xdef\csname\the\macname\endcsname{%
8421 \noexpand\spaceisspace
8422 \noexpand\endlineisspace
8423 \noexpand\expandafter % skip any whitespace after the macro name.
8424 \expandafter\noexpand\csname\the\macname @@@\endcsname}%
8425 \expandafter\xdef\csname\the\macname @@@\endcsname{%
8427 \noexpand\scanmacro{\macrobody}}%
8429 \expandafter\xdef\csname\the\macname\endcsname{%
8431 \noexpand\braceorline
8432 \expandafter\noexpand\csname\the\macname @@@\endcsname}%
8433 \expandafter\xdef\csname\the\macname @@@\endcsname##1{%
8435 \noexpand\scanmacro{\macrobody}%
8438 \ifnum\paramno<10\relax
8439 % @MACNAME sets the context for reading the macro argument
8440 % @MACNAME@@ gets the argument, processes backslashes and appends a
8442 % @MACNAME@@@ removes braces surrounding the argument list.
8443 % @MACNAME@@@@ scans the macro body with arguments substituted.
8444 \expandafter\xdef\csname\the\macname\endcsname{%
8446 \noexpand\expandafter % This \expandafter skip any spaces after the
8447 \noexpand\macroargctxt % macro before we change the catcode of space.
8448 \noexpand\expandafter
8449 \expandafter\noexpand\csname\the\macname @@\endcsname}%
8450 \expandafter\xdef\csname\the\macname @@\endcsname##1{%
8451 \noexpand\passargtomacro
8452 \expandafter\noexpand\csname\the\macname @@@\endcsname{##1,}}%
8453 \expandafter\xdef\csname\the\macname @@@\endcsname##1{%
8454 \expandafter\noexpand\csname\the\macname @@@@\endcsname ##1}%
8455 \expandafter\expandafter
8457 \expandafter\expandafter
8458 \csname\the\macname @@@@\endcsname\paramlist{%
8459 \endgroup\noexpand\scanmacro{\macrobody}}%
8461 \expandafter\xdef\csname\the\macname\endcsname{%
8462 \noexpand\getargvals@{\the\macname}{\argl}%
8464 \global\expandafter\let\csname mac.\the\macname .body\endcsname\macrobody
8465 \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\gobble
8469 \catcode `\@\texiatcatcode\relax % end private-to-Texinfo catcodes
8471 \def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}}
8474 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8476 {\catcode`\@=0 \catcode`\\=13 % We need to manipulate \ so use @ as escape
8477 @catcode`@_=11 % private names
8478 @catcode`@!=11 % used as argument separator
8480 % \passargtomacro#1#2 -
8481 % Call #1 with a list of tokens #2, with any doubled backslashes in #2
8482 % compressed to one.
8484 % This implementation works by expansion, and not execution (so we cannot use
8485 % \def or similar). This reduces the risk of this failing in contexts where
8486 % complete expansion is done with no execution (for example, in writing out to
8487 % an auxiliary file for an index entry).
8489 % State is kept in the input stream: the argument passed to
8490 % @look_ahead, @gobble_and_check_finish and @add_segment is
8492 % THE_MACRO ARG_RESULT ! {PENDING_BS} NEXT_TOKEN (... rest of input)
8495 % THE_MACRO - name of the macro we want to call
8496 % ARG_RESULT - argument list we build to pass to that macro
8497 % PENDING_BS - either a backslash or nothing
8498 % NEXT_TOKEN - used to look ahead in the input stream to see what's coming next
8500 @gdef@passargtomacro#1#2{%
8501 @add_segment #1!{}@relax#2\@_finish\%
8503 @gdef@_finish{@_finishx} @global@let@_finishx@relax
8505 % #1 - THE_MACRO ARG_RESULT
8508 % #4 used to look ahead
8510 % If the next token is not a backslash, process the rest of the argument;
8511 % otherwise, remove the next token.
8512 @gdef@look_ahead#1!#2#3#4{%
8514 @expandafter@gobble_and_check_finish
8516 @expandafter@add_segment
8520 % #1 - THE_MACRO ARG_RESULT
8523 % #4 should be a backslash, which is gobbled.
8526 % Double backslash found. Add a single backslash, and look ahead.
8527 @gdef@gobble_and_check_finish#1!#2#3#4#5{%
8528 @add_segment#1\!{}#5#5%
8533 % #1 - THE_MACRO ARG_RESULT
8536 % #4 is input stream until next backslash
8538 % Input stream is either at the start of the argument, or just after a
8539 % backslash sequence, either a lone backslash, or a doubled backslash.
8540 % NEXT_TOKEN contains the first token in the input stream: if it is \finish,
8541 % finish; otherwise, append to ARG_RESULT the segment of the argument up until
8542 % the next backslash. PENDING_BACKSLASH contains a backslash to represent
8543 % a backslash just before the start of the input stream that has not been
8544 % added to ARG_RESULT.
8545 @gdef@add_segment#1!#2#3#4\{%
8549 % append the pending backslash to the result, followed by the next segment
8550 @expandafter@is_fi@look_ahead#1#2#4!{\}@fi
8551 % this @fi is discarded by @look_ahead.
8552 % we can't get rid of it with \expandafter because we don't know how
8558 % #3 discards the res of the conditional in @add_segment, and @is_fi ends the
8560 @gdef@call_the_macro#1#2!#3@fi{@is_fi #1{#2}}
8563 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8565 % \braceorline MAC is used for a one-argument macro MAC. It checks
8566 % whether the next non-whitespace character is a {. It sets the context
8567 % for reading the argument (slightly different in the two cases). Then,
8568 % to read the argument, in the whole-line case, it then calls the regular
8569 % \parsearg MAC; in the lbrace case, it calls \passargtomacro MAC.
8571 \def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx}
8572 \def\braceorlinexxx{%
8575 \expandafter\passargtomacro
8577 \macrolineargctxt\expandafter\parsearg
8583 \parseargdef\linemacro{%
8584 \getargs{#1}% now \macname is the macname and \argl the arglist
8588 \def\paramlist{\hash 1\endlinemacro}%
8590 \expandafter\linegetparamlist\argl;%
8592 \begingroup \macrobodyctxt \usembodybackslash
8596 % Build up \paramlist which will be used as the parameter text for the macro.
8597 % At the end it will be like "#1 #2 #3\endlinemacro".
8598 \def\linegetparamlist#1;{%
8599 \paramno=0\def\paramlist{}%
8601 \linegetparamlistxxx#1,;,%
8603 \def\linegetparamlistxxx#1,{%
8604 \if#1;\let\next=\linegetparamlistxxxx
8605 \else \let\next=\linegetparamlistxxx
8606 \advance\paramno by 1
8607 \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname
8608 {\hash\the\paramno}%
8609 \edef\paramlist{\paramlist\hash\the\paramno\space}%
8611 \def\linegetparamlistxxxx{%
8612 \expandafter\fixparamlist\paramlist\fixparamlist
8614 % Replace final space token
8615 \def\fixparamlist#1 \fixparamlist{%
8616 \def\paramlist{#1\endlinemacro}%
8619 % Read the body of the macro, replacing backslash-surrounded variables
8621 {\catcode`\ =\other\long\gdef\parselinemacrobody#1@end linemacro{%
8622 \xdef\macrobody{#1}%
8627 % Make the definition
8630 \expandafter\xdef\csname\the\macname\endcsname{%
8633 \expandafter\noexpand\csname\the\macname @@\endcsname
8635 \expandafter\xdef\csname\the\macname @@\endcsname##1{%
8637 \expandafter\noexpand
8638 \csname\the\macname @@@\endcsname##1\noexpand\endlinemacro
8640 \expandafter\expandafter
8642 \expandafter\expandafter\csname\the\macname @@@\endcsname\paramlist{%
8643 \newlinechar=13 % split \macrobody into lines
8644 \noexpand\scantokens{\macrobody}%
8651 % We need some trickery to remove the optional spaces around the equal
8652 % sign. Make them active and then expand them all to nothing.
8654 \def\alias{\parseargusing\obeyspaces\aliasxxx}
8655 \def\aliasxxx #1{\aliasyyy#1\relax}
8656 \def\aliasyyy #1=#2\relax{%
8658 \expandafter\let\obeyedspace=\empty
8659 \addtomacrolist{#1}%
8660 \xdef\next{\global\let\makecsname{#1}=\makecsname{#2}}%
8666 \message{cross references,}
8669 \newif\ifhavexrefs % True if xref values are known.
8670 \newif\ifwarnedxrefs % True if we warned once that they aren't known.
8672 % @inforef is relatively simple.
8673 \def\inforef #1{\inforefzzz #1,,,,**}
8674 \def\inforefzzz #1,#2,#3,#4**{%
8675 \putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
8676 node \samp{\ignorespaces#1{}}}
8678 % @node's only job in TeX is to define \lastnode, which is used in
8679 % cross-references. The @node line might or might not have commas, and
8680 % might or might not have spaces before the first comma, like:
8681 % @node foo , bar , ...
8682 % We don't want such trailing spaces in the node name.
8684 \parseargdef\node{\checkenv{}\donode #1 ,\finishnodeparse}
8686 % also remove a trailing comma, in case of something like this:
8687 % @node Help-Cross, , , Cross-refs
8688 \def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse}
8689 \def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}\omittopnode}
8691 % Used so that the @top node doesn't have to be wrapped in an @ifnottex
8693 % \doignore goes to more effort to skip nested conditionals but we don't need
8696 \ifx\lastnode\wordTop
8697 \expandafter\ignorenode\fi
8701 % Until the next @node, @part or @bye command, divert output to a box that
8703 \def\ignorenode{\setbox\dummybox\vbox\bgroup
8704 \def\part{\egroup\part}%
8705 \def\node{\egroup\node}%
8710 \gdef\ignorenodebye{\let\bye\ignorenodebyedef}
8711 \gdef\ignorenodebyedef{\egroup(`Top' node ignored)\bye}}
8712 % The redefinition of \bye here is because it is declared \outer
8714 \let\lastnode=\empty
8716 % Write a cross-reference definition for the current node. #1 is the
8717 % type (Ynumbered, Yappendix, Ynothing).
8720 \ifx\lastnode\empty\else
8721 \setref{\lastnode}{#1}%
8722 \global\let\lastnode=\empty
8726 % @anchor{NAME} -- define xref target at arbitrary point.
8728 \newcount\savesfregister
8730 \def\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi}
8731 \def\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi}
8732 \def\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces}
8734 % \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an
8735 % anchor), which consists of three parts:
8736 % 1) NAME-title - the current sectioning name taken from \currentsection,
8737 % or the anchor name.
8738 % 2) NAME-snt - section number and type, passed as the SNT arg, or
8739 % empty for anchors.
8740 % 3) NAME-pg - the page number.
8742 % This is called from \donoderef, \anchor, and \dofloat. In the case of
8743 % floats, there is an additional part, which is not written here:
8744 % 4) NAME-lof - the text as it should appear in a @listoffloats.
8751 \atdummies % preserve commands, but don't expand them
8752 % match definition in \xrdef, \refx, \xrefX.
8754 \edef\writexrdef##1##2{%
8755 \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef
8756 ##1}{##2}}% these are parameters of \writexrdef
8758 \toks0 = \expandafter{\currentsection}%
8759 \immediate \writexrdef{title}{\the\toks0 }%
8760 \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc.
8761 \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, at \shipout
8766 % @xrefautosectiontitle on|off says whether @section(ing) names are used
8767 % automatically in xrefs, if the third arg is not explicitly specified.
8768 % This was provided as a "secret" @set xref-automatic-section-title
8769 % variable, now it's official.
8771 \parseargdef\xrefautomaticsectiontitle{%
8774 \expandafter\let\csname SETxref-automatic-section-title\endcsname
8776 \else\ifx\temp\offword
8777 \expandafter\let\csname SETxref-automatic-section-title\endcsname
8780 \errhelp = \EMsimple
8781 \errmessage{Unknown @xrefautomaticsectiontitle value `\temp',
8787 % @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is
8788 % the node name, #2 the name of the Info cross-reference, #3 the printed
8789 % node name, #4 the name of the Info file, #5 the name of the printed
8790 % manual. All but the node name can be omitted.
8792 \def\pxref{\putwordsee{} \xrefXX}
8793 \def\xref{\putwordSee{} \xrefXX}
8796 \def\xrefXX#1{\def\xrefXXarg{#1}\futurelet\tokenafterxref\xrefXXX}
8797 \def\xrefXXX{\expandafter\xrefX\expandafter[\xrefXXarg,,,,,,,]}
8800 \newbox\printedrefnamebox
8801 \newbox\infofilenamebox
8802 \newbox\printedmanualbox
8804 \def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
8807 % Get args without leading/trailing spaces.
8808 \def\printedrefname{\ignorespaces #3}%
8809 \setbox\printedrefnamebox = \hbox{\printedrefname\unskip}%
8811 \def\infofilename{\ignorespaces #4}%
8812 \setbox\infofilenamebox = \hbox{\infofilename\unskip}%
8814 \def\printedmanual{\ignorespaces #5}%
8815 \setbox\printedmanualbox = \hbox{\printedmanual\unskip}%
8817 % If the printed reference name (arg #3) was not explicitly given in
8818 % the @xref, figure out what we want to use.
8819 \ifdim \wd\printedrefnamebox = 0pt
8820 % No printed node name was explicitly given.
8821 \expandafter\ifx\csname SETxref-automatic-section-title\endcsname \relax
8822 % Not auto section-title: use node name inside the square brackets.
8823 \def\printedrefname{\ignorespaces #1}%
8825 % Auto section-title: use chapter/section title inside
8826 % the square brackets if we have it.
8827 \ifdim \wd\printedmanualbox > 0pt
8828 % It is in another manual, so we don't have it; use node name.
8829 \def\printedrefname{\ignorespaces #1}%
8832 % We (should) know the real title if we have the xref values.
8833 \def\printedrefname{\refx{#1-title}}%
8835 % Otherwise just copy the Info node name.
8836 \def\printedrefname{\ignorespaces #1}%
8842 % Make link in pdf output.
8844 % For pdfTeX and LuaTeX
8846 \makevalueexpandable
8848 % This expands tokens, so do it after making catcode changes, so _
8849 % etc. don't get their TeX definitions. This ignores all spaces in
8850 % #4, including (wrongly) those in the middle of the filename.
8853 % This (wrongly) does not take account of leading or trailing
8854 % spaces in #1, which should be ignored.
8855 \setpdfdestname{#1}%
8857 \ifx\pdfdestname\empty
8858 \def\pdfdestname{Top}% no empty targets
8862 \startlink attr{/Border [0 0 0]}%
8863 \ifnum\filenamelength>0
8864 goto file{\the\filename.pdf} name{\pdfdestname}%
8866 goto name{\pdfmkpgn{\pdfdestname}}%
8869 \setcolor{\linkcolor}%
8871 \ifx\XeTeXrevision\thisisundefined
8875 \makevalueexpandable
8877 % This expands tokens, so do it after making catcode changes, so _
8878 % etc. don't get their TeX definitions. This ignores all spaces in
8879 % #4, including (wrongly) those in the middle of the filename.
8882 % This (wrongly) does not take account of leading or trailing
8883 % spaces in #1, which should be ignored.
8884 \setpdfdestname{#1}%
8886 \ifx\pdfdestname\empty
8887 \def\pdfdestname{Top}% no empty targets
8891 \ifnum\filenamelength>0
8892 % With default settings,
8893 % XeTeX (xdvipdfmx) replaces link destination names with integers.
8894 % In this case, the replaced destination names of
8895 % remote PDFs are no longer known. In order to avoid a replacement,
8896 % you can use xdvipdfmx's command line option `-C 0x0010'.
8897 % If you use XeTeX 0.99996+ (TeX Live 2016+),
8898 % this command line option is no longer necessary
8899 % because we can use the `dvipdfmx:config' special.
8900 \special{pdf:bann << /Border [0 0 0] /Type /Annot /Subtype /Link /A
8901 << /S /GoToR /F (\the\filename.pdf) /D (\pdfdestname) >> >>}%
8903 \special{pdf:bann << /Border [0 0 0] /Type /Annot /Subtype /Link /A
8904 << /S /GoTo /D (\pdfdestname) >> >>}%
8907 \setcolor{\linkcolor}%
8911 % Have to otherify everything special to allow the \csname to
8912 % include an _ in the xref name, etc.
8916 \expandafter\global\expandafter\let\expandafter\Xthisreftitle
8917 \csname XR#1-title\endcsname
8920 % Float references are printed completely differently: "Figure 1.2"
8921 % instead of "[somenode], p.3". \iffloat distinguishes them by
8922 % \Xthisreftitle being set to a magic string.
8923 \iffloat\Xthisreftitle
8924 % If the user specified the print name (third arg) to the ref,
8925 % print it instead of our usual "Figure 1.2".
8926 \ifdim\wd\printedrefnamebox = 0pt
8932 % If the user also gave the printed manual name (fifth arg), append
8934 \ifdim \wd\printedmanualbox > 0pt
8935 \space \putwordin{} \cite{\printedmanual}%
8938 % node/anchor (non-float) references.
8940 % If we use \unhbox to print the node names, TeX does not insert
8941 % empty discretionaries after hyphens, which means that it will not
8942 % find a line break at a hyphen in a node names. Since some manuals
8943 % are best written with fairly long node names, containing hyphens,
8944 % this is a loss. Therefore, we give the text of the node name
8945 % again, so it is as if TeX is seeing it for the first time.
8947 \ifdim \wd\printedmanualbox > 0pt
8948 % Cross-manual reference with a printed manual name.
8950 \crossmanualxref{\cite{\printedmanual\unskip}}%
8952 \else\ifdim \wd\infofilenamebox > 0pt
8953 % Cross-manual reference with only an info filename (arg 4), no
8954 % printed manual name (arg 5). This is essentially the same as
8955 % the case above; we output the filename, since we have nothing else.
8957 \crossmanualxref{\code{\infofilename\unskip}}%
8960 % Reference within this manual.
8962 % Only output a following space if the -snt ref is nonempty, as the ref
8963 % will be empty for @unnumbered and @anchor.
8964 \setbox2 = \hbox{\ignorespaces \refx{#1-snt}}%
8965 \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
8967 % output the `[mynode]' via the macro below so it can be overridden.
8968 \xrefprintnodename\printedrefname
8970 \ifflagclear{txiomitxrefpg}{%
8971 % We always want a comma
8973 % output the `page 3'.
8974 \turnoffactive \putpageref{#1}%
8975 % Add a , if xref followed by a space
8976 \if\space\noexpand\tokenafterxref ,%
8977 \else\ifx\ \tokenafterxref ,% @TAB
8978 \else\ifx\*\tokenafterxref ,% @*
8979 \else\ifx\ \tokenafterxref ,% @SPACE
8981 \tokenafterxref ,% @NL
8982 \else\ifx\tie\tokenafterxref ,% @tie
8990 % can be overridden in translation files
8992 \space\putwordpage\tie\refx{#1-pg}}
8994 % Output a cross-manual xref to #1. Used just above (twice).
8996 % Only include the text "Section ``foo'' in" if the foo is neither
8997 % missing or Top. Thus, @xref{,,,foo,The Foo Manual} outputs simply
8998 % "see The Foo Manual", the idea being to refer to the whole manual.
9000 % But, this being TeX, we can't easily compare our node name against the
9001 % string "Top" while ignoring the possible spaces before and after in
9002 % the input. By adding the arbitrary 7sp below, we make it much less
9003 % likely that a real node name would have the same width as "Top" (e.g.,
9004 % in a monospaced font). Hopefully it will never happen in practice.
9006 % For the same basic reason, we retypeset the "Top" at every
9007 % reference, since the current font is indeterminate.
9009 \def\crossmanualxref#1{%
9010 \setbox\toprefbox = \hbox{Top\kern7sp}%
9011 \setbox2 = \hbox{\ignorespaces \printedrefname \unskip \kern7sp}%
9012 \ifdim \wd2 > 7sp % nonempty?
9013 \ifdim \wd2 = \wd\toprefbox \else % same as Top?
9014 \putwordSection{} ``\printedrefname'' \putwordin{}\space
9020 % This macro is called from \xrefX for the `[nodename]' part of xref
9021 % output. It's a separate macro only so it can be changed more easily,
9022 % since square brackets don't work well in some documents. Particularly
9023 % one that Bob is working on :).
9025 \def\xrefprintnodename#1{[#1]}
9027 % Things referred to by \setref.
9033 \putwordChapter@tie \the\chapno
9034 \else \ifnum\subsecno=0
9035 \putwordSection@tie \the\chapno.\the\secno
9036 \else \ifnum\subsubsecno=0
9037 \putwordSection@tie \the\chapno.\the\secno.\the\subsecno
9039 \putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno
9044 \putwordAppendix@tie @char\the\appendixno{}%
9045 \else \ifnum\subsecno=0
9046 \putwordSection@tie @char\the\appendixno.\the\secno
9047 \else \ifnum\subsubsecno=0
9048 \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno
9051 @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno
9055 % \refx{NAME} - reference a cross-reference string named NAME.
9062 \expandafter\global\expandafter\let\expandafter\thisrefX
9063 \csname XR#1\endcsname
9066 % If not defined, say something at least.
9067 \angleleft un\-de\-fined\angleright
9070 {\toks0 = {#1}% avoid expansion of possibly-complex value
9071 \message{\linenumber Undefined cross reference `\the\toks0'.}}%
9074 \global\warnedxrefstrue
9075 \message{Cross reference values unknown; you must run TeX again.}%
9080 % It's defined, so just use it.
9085 % This is the macro invoked by entries in the aux file. Define a control
9086 % sequence for a cross-reference target (we prepend XR to the control sequence
9087 % name to avoid collisions). The value is the page number. If this is a float
9088 % type, we have more work to do.
9091 {% Expand the node or anchor name to remove control sequences.
9092 % \turnoffactive stops 8-bit characters being changed to commands
9093 % like @'e. \refx does the same to retrieve the value in the definition.
9097 \xdef\safexrefname{#1}%
9101 \expandafter\gdef\csname XR\safexrefname\endcsname{#2}%
9103 % We put the \gdef inside a group to avoid the definitions building up on
9104 % TeX's save stack, which can cause it to run out of space for aux files with
9105 % thousands of lines. \gdef doesn't use the save stack, but \csname does
9106 % when it defines an unknown control sequence as \relax.
9108 % Was that xref control sequence that we just defined for a float?
9109 \expandafter\iffloat\csname XR\safexrefname\endcsname
9110 % it was a float, and we have the (safe) float type in \iffloattype.
9111 \expandafter\let\expandafter\floatlist
9112 \csname floatlist\iffloattype\endcsname
9114 % Is this the first time we've seen this float type?
9115 \expandafter\ifx\floatlist\relax
9116 \toks0 = {\do}% yes, so just \do
9118 % had it before, so preserve previous elements in list.
9119 \toks0 = \expandafter{\floatlist\do}%
9122 % Remember this xref in the control sequence \floatlistFLOATTYPE,
9123 % for later use in \listoffloats.
9124 \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0
9129 % If working on a large document in chapters, it is convenient to
9130 % be able to disable indexing, cross-referencing, and contents, for test runs.
9131 % This is done with @novalidate at the beginning of the file.
9133 \newif\iflinks \linkstrue % by default we want the aux files.
9134 \let\novalidate = \linksfalse
9136 % Used when writing to the aux file, or when using data from it.
9137 \def\requireauxfile{%
9140 % Open the new aux file. TeX will close it automatically at exit.
9141 \immediate\openout\auxfile=\jobname.aux
9143 \global\let\requireauxfile=\relax % Only do this once.
9146 % Read the last existing aux file, if any. No error if none exists.
9149 \openin 1 \jobname.aux
9152 \global\havexrefstrue
9157 \def\setupdatafile{%
9158 \catcode`\^^@=\other
9159 \catcode`\^^A=\other
9160 \catcode`\^^B=\other
9161 \catcode`\^^C=\other
9162 \catcode`\^^D=\other
9163 \catcode`\^^E=\other
9164 \catcode`\^^F=\other
9165 \catcode`\^^G=\other
9166 \catcode`\^^H=\other
9167 \catcode`\^^K=\other
9168 \catcode`\^^L=\other
9169 \catcode`\^^N=\other
9170 \catcode`\^^P=\other
9171 \catcode`\^^Q=\other
9172 \catcode`\^^R=\other
9173 \catcode`\^^S=\other
9174 \catcode`\^^T=\other
9175 \catcode`\^^U=\other
9176 \catcode`\^^V=\other
9177 \catcode`\^^W=\other
9178 \catcode`\^^X=\other
9179 \catcode`\^^Z=\other
9180 \catcode`\^^[=\other
9181 \catcode`\^^\=\other
9182 \catcode`\^^]=\other
9183 \catcode`\^^^=\other
9184 \catcode`\^^_=\other
9187 % Special characters. Should be turned off anyway, but...
9200 \catcode`+=\other % avoid \+ for paranoia even though we've turned it off
9204 % @ is our escape character in .aux files, and we need braces.
9210 \def\readdatafile#1{%
9217 \message{insertions,}
9218 % including footnotes.
9220 \newcount \footnoteno
9222 % The trailing space in the following definition for supereject is
9223 % vital for proper filling; pages come out unaligned when you do a
9224 % pagealignmacro call if that space before the closing brace is
9225 % removed. (Generally, numeric constants should always be followed by a
9226 % space to prevent strange expansion errors.)
9227 \def\supereject{\par\penalty -20000\footnoteno =0 }
9229 % @footnotestyle is meaningful for Info output only.
9230 \let\footnotestyle=\comment
9234 % Auto-number footnotes. Otherwise like plain.
9236 \global\advance\footnoteno by \@ne
9237 \edef\thisfootno{$^{\the\footnoteno}$}%
9239 % In case the footnote comes at the end of a sentence, preserve the
9240 % extra spacing after we do the footnote number.
9242 \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi
9244 % Remove inadvertent blank space before typesetting the footnote number.
9250 % Don't bother with the trickery in plain.tex to not require the
9251 % footnote text as a parameter. Our footnotes don't need to be so general.
9253 % Oh yes, they do; otherwise, @ifset (and anything else that uses
9254 % \parseargline) fails inside footnotes because the tokens are fixed when
9255 % the footnote is read. --karl, 16nov96.
9258 \insert\footins\bgroup
9260 % Nested footnotes are not supported in TeX, that would take a lot
9261 % more work. (\startsavinginserts does not suffice.)
9262 \let\footnote=\errfootnotenest
9264 % We want to typeset this text as a normal paragraph, even if the
9265 % footnote reference occurs in (for example) a display environment.
9266 % So reset some parameters.
9267 \hsize=\txipagewidth
9268 \interlinepenalty\interfootnotelinepenalty
9269 \splittopskip\ht\strutbox % top baseline for broken footnotes
9270 \splitmaxdepth\dp\strutbox
9271 \floatingpenalty\@MM
9276 \parindent\defaultparindent
9280 % Because we use hanging indentation in footnotes, a @noindent appears
9281 % to exdent this text, so make it be a no-op. makeinfo does not use
9282 % hanging indentation so @noindent can still be needed within footnote
9283 % text after an @example or the like (not that this is good style).
9284 \let\noindent = \relax
9286 % Hang the footnote text off the number. Use \everypar in case the
9287 % footnote extends for more than one paragraph.
9288 \everypar = {\hang}%
9289 \textindent{\thisfootno}%
9291 % Don't crash into the line above the footnote text. Since this
9292 % expands into a box, it must come within the paragraph, lest it
9293 % provide a place where TeX can split the footnote.
9296 % Invoke rest of plain TeX footnote routine.
9297 \futurelet\next\fo@t
9299 }%end \catcode `\@=11
9301 \def\errfootnotenest{%
9303 \errmessage{Nested footnotes not supported in texinfo.tex,
9304 even though they work in makeinfo; sorry}
9307 \def\errfootnoteheading{%
9309 \errmessage{Footnotes in chapters, sections, etc., are not supported}
9312 % In case a @footnote appears in a vbox, save the footnote text and create
9313 % the real \insert just after the vbox finished. Otherwise, the insertion
9315 % Similarly, if a @footnote appears inside an alignment, save the footnote
9316 % text to a box and make the \insert when a row of the table is finished.
9317 % And the same can be done for other insert classes. --kasal, 16nov03.
9319 % Replace the \insert primitive by a cheating macro.
9320 % Deeper inside, just make sure that the saved insertions are not spilled
9323 \def\startsavinginserts{%
9324 \ifx \insert\ptexinsert
9325 \let\insert\saveinsert
9327 \let\checkinserts\relax
9331 % This \insert replacement works for both \insert\footins{foo} and
9332 % \insert\footins\bgroup foo\egroup, but it doesn't work for \insert27{foo}.
9335 \edef\next{\noexpand\savetobox \makeSAVEname#1}%
9336 \afterassignment\next
9337 % swallow the left brace
9340 \def\makeSAVEname#1{\makecsname{SAVE\expandafter\gobble\string#1}}
9341 \def\savetobox#1{\global\setbox#1 = \vbox\bgroup \unvbox#1}
9343 \def\checksaveins#1{\ifvoid#1\else \placesaveins#1\fi}
9345 \def\placesaveins#1{%
9346 \ptexinsert \csname\expandafter\gobblesave\string#1\endcsname
9350 % eat @SAVE -- beware, all of them have catcode \other:
9352 \def\dospecials{\do S\do A\do V\do E} \uncatcodespecials % ;-)
9353 \gdef\gobblesave @SAVE{}
9357 \def\newsaveins #1{%
9358 \edef\next{\noexpand\newsaveinsX \makeSAVEname#1}%
9361 \def\newsaveinsX #1{%
9362 \csname newbox\endcsname #1%
9363 \expandafter\def\expandafter\checkinserts\expandafter{\checkinserts
9368 \let\checkinserts\empty
9373 % @image. We use the macros from epsf.tex to support this.
9374 % If epsf.tex is not installed and @image is used, we complain.
9376 % Check for and read epsf.tex up front. If we read it only at @image
9377 % time, we might be inside a group, and then its definitions would get
9378 % undone and the next image would fail.
9379 \openin 1 = epsf.tex
9381 % Do not bother showing banner with epsf.tex v2.7k (available in
9382 % doc/epsf.tex and on ctan).
9383 \def\epsfannounce{\toks0 = }%
9388 % We will only complain once about lack of epsf.tex.
9389 \newif\ifwarnednoepsf
9390 \newhelp\noepsfhelp{epsf.tex must be installed for images to
9391 work. It is also included in the Texinfo distribution, or you can get
9392 it from https://ctan.org/texarchive/macros/texinfo/texinfo/doc/epsf.tex.}
9395 \ifx\epsfbox\thisisundefined
9396 \ifwarnednoepsf \else
9397 \errhelp = \noepsfhelp
9398 \errmessage{epsf.tex not found, images will be ignored}%
9399 \global\warnednoepsftrue
9402 \imagexxx #1,,,,,\finish
9406 % Approximate height of a line in the standard text font.
9408 \setbox0=\vbox{\tenrm H}
9412 % Arguments to @image:
9413 % #1 is (mandatory) image filename; we tack on .eps extension.
9414 % #2 is (optional) width, #3 is (optional) height.
9415 % #4 is (ignored optional) html alt text.
9416 % #5 is (ignored optional) extension.
9417 % #6 is just the usual extra ignored arg for parsing stuff.
9419 \def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup
9420 \catcode`\^^M = 5 % in case we're inside an example
9421 \normalturnoffactive % allow _ et al. in names
9422 \makevalueexpandable
9426 % Usually we'll have text after the image which will insert
9427 % \parskip glue, so insert it here too to equalize the space
9431 % Place image in a \vtop for a top page margin that is (close to) correct,
9432 % as \topskip glue is relative to the first baseline.
9433 \vtop\bgroup \kern -\capheight \vskip-\parskip
9436 \ifx\centersub\centerV
9437 % For @center @image, enter vertical mode and add vertical space
9438 % Enter an extra \parskip because @center doesn't add space itself.
9439 \vbox\bgroup\vskip\parskip\medskip\vskip\parskip
9441 % Enter horizontal mode so that indentation from an enclosing
9442 % environment such as @quotation is respected.
9443 % However, if we're at the top level, we don't want the
9444 % normal paragraph indentation.
9450 % For pdfTeX and LuaTeX <= 0.80
9451 \dopdfimage{#1}{#2}{#3}%
9453 \ifx\XeTeXrevision\thisisundefined
9455 % \epsfbox itself resets \epsf?size at each figure.
9456 \setbox0 = \hbox{\ignorespaces #2}%
9457 \ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
9458 \setbox0 = \hbox{\ignorespaces #3}%
9459 \ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
9463 \doxeteximage{#1}{#2}{#3}%
9469 \medskip % space after a standalone image
9471 \ifx\centersub\centerV % @center @image
9473 \egroup % close \vbox
9478 % @float FLOATTYPE,LABEL,LOC ... @end float for displayed figures, tables,
9479 % etc. We don't actually implement floating yet, we always include the
9480 % float "here". But it seemed the best name for the future.
9482 \envparseargdef\float{\eatcommaspace\eatcommaspace\dofloat#1, , ,\finish}
9484 % There may be a space before second and/or third parameter; delete it.
9485 \def\eatcommaspace#1, {#1,}
9487 % #1 is the optional FLOATTYPE, the text label for this float, typically
9488 % "Figure", "Table", "Example", etc. Can't contain commas. If omitted,
9489 % this float will not be numbered and cannot be referred to.
9491 % #2 is the optional xref label. Also must be present for the float to
9494 % #3 is the optional positioning argument; for now, it is ignored. It
9495 % will somehow specify the positions allowed to float to (here, top, bottom).
9497 % We keep a separate counter for each FLOATTYPE, which we reset at each
9498 % chapter-level command.
9499 \let\resetallfloatnos=\empty
9501 \def\dofloat#1,#2,#3,#4\finish{%
9502 \let\thiscaption=\empty
9503 \let\thisshortcaption=\empty
9505 % don't lose footnotes inside @float.
9507 % BEWARE: when the floats start float, we have to issue warning whenever an
9508 % insert appears inside a float which could possibly float. --kasal, 26may04
9512 % We can't be used inside a paragraph.
9517 \def\floatlabel{#2}%
9518 \def\floatloc{#3}% we do nothing with this yet.
9520 \ifx\floattype\empty
9521 \let\safefloattype=\empty
9524 % the floattype might have accents or other special characters,
9525 % but we need to use it in a control sequence name.
9528 \xdef\safefloattype{\floattype}%
9532 % If label is given but no type, we handle that as the empty type.
9533 \ifx\floatlabel\empty \else
9534 % We want each FLOATTYPE to be numbered separately (Figure 1,
9535 % Table 1, Figure 2, ...). (And if no label, no number.)
9537 \expandafter\getfloatno\csname\safefloattype floatno\endcsname
9538 \global\advance\floatno by 1
9541 % This magic value for \currentsection is output by \setref as the
9542 % XREFLABEL-title value. \xrefX uses it to distinguish float
9543 % labels (which have a completely different output format) from
9544 % node and anchor labels. And \xrdef uses it to construct the
9547 \edef\currentsection{\floatmagic=\safefloattype}%
9548 \setref{\floatlabel}{Yfloat}%
9552 % start with \parskip glue, I guess.
9555 % Don't suppress indentation if a float happens to start a section.
9556 \restorefirstparagraphindent
9559 % we have these possibilities:
9560 % @float Foo,lbl & @caption{Cap}: Foo 1.1: Cap
9561 % @float Foo,lbl & no caption: Foo 1.1
9562 % @float Foo & @caption{Cap}: Foo: Cap
9563 % @float Foo & no caption: Foo
9564 % @float ,lbl & Caption{Cap}: 1.1: Cap
9565 % @float ,lbl & no caption: 1.1
9566 % @float & @caption{Cap}: Cap
9567 % @float & no caption:
9570 \let\floatident = \empty
9572 % In all cases, if we have a float type, it comes first.
9573 \ifx\floattype\empty \else \def\floatident{\floattype}\fi
9575 % If we have an xref label, the number comes next.
9576 \ifx\floatlabel\empty \else
9577 \ifx\floattype\empty \else % if also had float type, need tie first.
9578 \appendtomacro\floatident{\tie}%
9581 \appendtomacro\floatident{\chaplevelprefix\the\floatno}%
9584 % Start the printed caption with what we've constructed in
9585 % \floatident, but keep it separate; we need \floatident again.
9586 \let\captionline = \floatident
9588 \ifx\thiscaption\empty \else
9589 \ifx\floatident\empty \else
9590 \appendtomacro\captionline{: }% had ident, so need a colon between
9594 \appendtomacro\captionline{\scanexp\thiscaption}%
9597 % If we have anything to print, print it, with space before.
9598 % Eventually this needs to become an \insert.
9599 \ifx\captionline\empty \else
9603 % Space below caption.
9607 % If have an xref label, write the list of floats info. Do this
9608 % after the caption, to avoid chance of it being a breakpoint.
9609 \ifx\floatlabel\empty \else
9610 % Write the text that goes in the lof to the aux file as
9611 % \floatlabel-lof. Besides \floatident, we include the short
9612 % caption if specified, else the full caption if specified, else nothing.
9617 \ifx\thisshortcaption\empty
9618 \def\gtemp{\thiscaption}%
9620 \def\gtemp{\thisshortcaption}%
9622 \immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident
9623 \ifx\gtemp\empty \else : \gtemp \fi}}%
9626 \egroup % end of \vtop
9631 % Append the tokens #2 to the definition of macro #1, not expanding either.
9633 \def\appendtomacro#1#2{%
9634 \expandafter\def\expandafter#1\expandafter{#1#2}%
9637 % @caption, @shortcaption
9639 \def\caption{\docaption\thiscaption}
9640 \def\shortcaption{\docaption\thisshortcaption}
9641 \def\docaption{\checkenv\float \bgroup\scanctxt\docaptionz}
9642 \def\docaptionz#1#2{\egroup \def#1{#2}}
9644 % The parameter is the control sequence identifying the counter we are
9645 % going to use. Create it if it doesn't exist and assign it to \floatno.
9648 % Haven't seen this figure type before.
9649 \csname newcount\endcsname #1%
9651 % Remember to reset this floatno at the next chap.
9652 \expandafter\gdef\expandafter\resetallfloatnos
9653 \expandafter{\resetallfloatnos #1=0 }%
9658 % \setref calls this to get the XREFLABEL-snt value. We want an @xref
9659 % to the FLOATLABEL to expand to "Figure 3.1". We call \setref when we
9660 % first read the @float command.
9662 \def\Yfloat{\floattype@tie \chaplevelprefix\the\floatno}%
9664 % Magic string used for the XREFLABEL-title value, so \xrefX can
9665 % distinguish floats from other xref types.
9666 \def\floatmagic{!!float!!}
9668 % #1 is the control sequence we are passed; we expand into a conditional
9669 % which is true if #1 represents a float ref. That is, the magic
9670 % \currentsection value which we \setref above.
9672 \def\iffloat#1{\expandafter\doiffloat#1==\finish}
9674 % #1 is (maybe) the \floatmagic string. If so, #2 will be the
9675 % (safe) float type for this float. We set \iffloattype to #2.
9677 \def\doiffloat#1=#2=#3\finish{%
9679 \def\iffloattype{#2}%
9680 \ifx\temp\floatmagic
9683 % @listoffloats FLOATTYPE - print a list of floats like a table of contents.
9685 \parseargdef\listoffloats{%
9686 \def\floattype{#1}% floattype
9688 % the floattype might have accents or other special characters,
9689 % but we need to use it in a control sequence name.
9692 \xdef\safefloattype{\floattype}%
9695 % \xrdef saves the floats as a \do-list in \floatlistSAFEFLOATTYPE.
9696 \expandafter\ifx\csname floatlist\safefloattype\endcsname \relax
9698 % if the user said @listoffloats foo but never @float foo.
9699 \message{\linenumber No `\safefloattype' floats to list.}%
9703 \leftskip=\tocindent % indent these entries like a toc
9704 \let\do=\listoffloatsdo
9705 \csname floatlist\safefloattype\endcsname
9710 % This is called on each entry in a list of floats. We're passed the
9711 % xref label, in the form LABEL-title, which is how we save it in the
9712 % aux file. We strip off the -title and look up \XRLABEL-lof, which
9713 % has the text we're supposed to typeset here.
9715 % Figures without xref labels will not be included in the list (since
9716 % they won't appear in the aux file).
9718 \def\listoffloatsdo#1{\listoffloatsdoentry#1\finish}
9719 \def\listoffloatsdoentry#1-title\finish{{%
9720 % Can't fully expand XR#1-lof because it can contain anything. Just
9721 % pass the control sequence. On the other hand, XR#1-pg is just the
9722 % page number, and we want to fully expand that so we can get a link
9724 \toksA = \expandafter{\csname XR#1-lof\endcsname}%
9726 % use the same \entry macro we use to generate the TOC and index.
9727 \edef\writeentry{\noexpand\entry{\the\toksA}{\csname XR#1-pg\endcsname}}%
9732 \message{localization,}
9734 % For single-language documents, @documentlanguage is usually given very
9735 % early, just after @documentencoding. Single argument is the language
9736 % (de) or locale (de_DE) abbreviation.
9739 \catcode`\_ = \active
9741 \parseargdef\documentlanguage{%
9742 \tex % read txi-??.tex file in plain TeX.
9743 % Read the file by the name they passed if it exists.
9744 \let_ = \normalunderscore % normal _ character for filename test
9745 \openin 1 txi-#1.tex
9747 \documentlanguagetrywithoutunderscore #1_\finish
9749 \globaldefs = 1 % everything in the txi-LL files needs to persist
9753 \endgroup % end raw TeX
9756 % If they passed de_DE, and txi-de_DE.tex doesn't exist,
9759 \gdef\documentlanguagetrywithoutunderscore#1_#2\finish{%
9760 \openin 1 txi-#1.tex
9762 \errhelp = \nolanghelp
9763 \errmessage{Cannot read language file txi-#1.tex}%
9765 \globaldefs = 1 % everything in the txi-LL files needs to persist
9770 }% end of special _ catcode
9772 \newhelp\nolanghelp{The given language definition file cannot be found or
9773 is empty. Maybe you need to install it? Putting it in the current
9774 directory should work if nowhere else does.}
9776 % This macro is called from txi-??.tex files; the first argument is the
9777 % \language name to set (without the "\lang@" prefix), the second and
9778 % third args are \{left,right}hyphenmin.
9780 % The language names to pass are determined when the format is built.
9781 % See the etex.log file created at that time, e.g.,
9782 % /usr/local/texlive/2008/texmf-var/web2c/pdftex/etex.log.
9784 % With TeX Live 2008, etex now includes hyphenation patterns for all
9785 % available languages. This means we can support hyphenation in
9786 % Texinfo, at least to some extent. (This still doesn't solve the
9787 % accented characters problem.)
9790 \def\txisetlanguage#1#2#3{%
9791 % do not set the language if the name is undefined in the current TeX.
9792 \expandafter\ifx\csname lang@#1\endcsname \relax
9793 \message{no patterns for #1}%
9795 \global\language = \csname lang@#1\endcsname
9797 % but there is no harm in adjusting the hyphenmin values regardless.
9798 \global\lefthyphenmin = #2\relax
9799 \global\righthyphenmin = #3\relax
9802 % XeTeX and LuaTeX can handle Unicode natively.
9803 % Their default I/O uses UTF-8 sequences instead of a byte-wise operation.
9804 % Other TeX engines' I/O (pdfTeX, etc.) is byte-wise.
9806 \newif\iftxinativeunicodecapable
9807 \newif\iftxiusebytewiseio
9809 \ifx\XeTeXrevision\thisisundefined
9810 \ifx\luatexversion\thisisundefined
9811 \txinativeunicodecapablefalse
9812 \txiusebytewiseiotrue
9814 \txinativeunicodecapabletrue
9815 \txiusebytewiseiofalse
9818 \txinativeunicodecapabletrue
9819 \txiusebytewiseiofalse
9822 % Set I/O by bytes instead of UTF-8 sequence for XeTeX and LuaTex
9823 % for non-UTF-8 (byte-wise) encodings.
9825 \def\setbytewiseio{%
9826 \ifx\XeTeXrevision\thisisundefined
9828 \XeTeXdefaultencoding "bytes" % For subsequent files to be read
9829 \XeTeXinputencoding "bytes" % For document root file
9830 % Unfortunately, there seems to be no corresponding XeTeX command for
9831 % output encoding. This is a problem for auxiliary index and TOC files.
9832 % The only solution would be perhaps to write out @U{...} sequences in
9833 % place of non-ASCII characters.
9836 \ifx\luatexversion\thisisundefined
9839 local utf8_char, byte, gsub = unicode.utf8.char, string.byte, string.gsub
9840 local function convert_char (char)
9841 return utf8_char(byte(char))
9844 local function convert_line (line)
9845 return gsub(line, ".", convert_char)
9848 callback.register("process_input_buffer", convert_line)
9850 local function convert_line_out (line)
9852 for c in string.utfvalues(line) do
9853 line_out = line_out .. string.char(c)
9858 callback.register("process_output_buffer", convert_line_out)
9862 \txiusebytewiseiotrue
9866 % Helpers for encodings.
9867 % Set the catcode of characters 128 through 255 to the specified number.
9869 \def\setnonasciicharscatcode#1{%
9871 \loop\ifnum\count255<256
9872 \global\catcode\count255=#1\relax
9873 \advance\count255 by 1
9877 \def\setnonasciicharscatcodenonglobal#1{%
9879 \loop\ifnum\count255<256
9880 \catcode\count255=#1\relax
9881 \advance\count255 by 1
9885 % @documentencoding sets the definition of non-ASCII characters
9886 % according to the specified encoding.
9888 \def\documentencoding{\parseargusing\filenamecatcodes\documentencodingzzz}
9889 \def\documentencodingzzz#1{%
9891 % Encoding being declared for the document.
9892 \def\declaredencoding{\csname #1.enc\endcsname}%
9894 % Supported encodings: names converted to tokens in order to be able
9895 % to compare them with \ifx.
9896 \def\ascii{\csname US-ASCII.enc\endcsname}%
9897 \def\latnine{\csname ISO-8859-15.enc\endcsname}%
9898 \def\latone{\csname ISO-8859-1.enc\endcsname}%
9899 \def\lattwo{\csname ISO-8859-2.enc\endcsname}%
9900 \def\utfeight{\csname UTF-8.enc\endcsname}%
9902 \ifx \declaredencoding \ascii
9905 \else \ifx \declaredencoding \lattwo
9906 \iftxinativeunicodecapable
9909 \setnonasciicharscatcode\active
9912 \else \ifx \declaredencoding \latone
9913 \iftxinativeunicodecapable
9916 \setnonasciicharscatcode\active
9919 \else \ifx \declaredencoding \latnine
9920 \iftxinativeunicodecapable
9923 \setnonasciicharscatcode\active
9926 \else \ifx \declaredencoding \utfeight
9927 \iftxinativeunicodecapable
9928 % For native Unicode handling (XeTeX and LuaTeX)
9929 \nativeunicodechardefs
9931 % For treating UTF-8 as byte sequences (TeX, eTeX and pdfTeX).
9932 % Since we already invoke \utfeightchardefs at the top level,
9933 % making non-ascii chars active is sufficient.
9934 \setnonasciicharscatcode\active
9938 \message{Ignoring unknown document encoding: #1.}%
9946 \ifx\XeTeXrevision\thisisundefined
9948 \ifx \declaredencoding \utfeight
9950 \ifx \declaredencoding \ascii
9952 \message{Warning: XeTeX with non-UTF-8 encodings cannot handle %
9953 non-ASCII characters in auxiliary files.}%
9959 % A message to be logged when using a character that isn't available
9960 % the default font encoding (OT1).
9962 \def\missingcharmsg#1{\message{Character missing, sorry: #1.}}
9964 % Take account of \c (plain) vs. \, (Texinfo) difference.
9965 \def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi}
9978 % Make non-ASCII characters active for defining the character definition
9980 \setnonasciicharscatcode\active
9982 % Latin1 (ISO-8859-1) character definitions.
9983 \gdef\latonechardefs{%
9985 \gdefchar^^a1{\exclamdown}
9986 \gdefchar^^a2{{\tcfont \char162}} % cent
9987 \gdefchar^^a3{\pounds{}}
9988 \gdefchar^^a4{{\tcfont \char164}} % currency
9989 \gdefchar^^a5{{\tcfont \char165}} % yen
9990 \gdefchar^^a6{{\tcfont \char166}} % broken bar
9993 \gdefchar^^a9{\copyright{}}
9994 \gdefchar^^aa{\ordf}
9995 \gdefchar^^ab{\guillemetleft{}}
9996 \gdefchar^^ac{\ensuremath\lnot}
9998 \gdefchar^^ae{\registeredsymbol{}}
10001 \gdefchar^^b0{\textdegree}
10002 \gdefchar^^b1{$\pm$}
10003 \gdefchar^^b2{$^2$}
10004 \gdefchar^^b3{$^3$}
10005 \gdefchar^^b4{\'{}}
10006 \gdefchar^^b5{$\mu$}
10008 \gdefchar^^b7{\ensuremath\cdot}
10009 \gdefchar^^b8{\cedilla\ }
10010 \gdefchar^^b9{$^1$}
10011 \gdefchar^^ba{\ordm}
10012 \gdefchar^^bb{\guillemetright{}}
10013 \gdefchar^^bc{$1\over4$}
10014 \gdefchar^^bd{$1\over2$}
10015 \gdefchar^^be{$3\over4$}
10016 \gdefchar^^bf{\questiondown}
10023 \gdefchar^^c5{\ringaccent A}
10025 \gdefchar^^c7{\cedilla C}
10042 \gdefchar^^d7{$\times$}
10057 \gdefchar^^e5{\ringaccent a}
10059 \gdefchar^^e7{\cedilla c}
10064 \gdefchar^^ec{\`{\dotless i}}
10065 \gdefchar^^ed{\'{\dotless i}}
10066 \gdefchar^^ee{\^{\dotless i}}
10067 \gdefchar^^ef{\"{\dotless i}}
10076 \gdefchar^^f7{$\div$}
10087 % Latin9 (ISO-8859-15) encoding character definitions.
10088 \gdef\latninechardefs{%
10089 % Encoding is almost identical to Latin1.
10092 \gdefchar^^a4{\euro{}}
10093 \gdefchar^^a6{\v S}
10094 \gdefchar^^a8{\v s}
10095 \gdefchar^^b4{\v Z}
10096 \gdefchar^^b8{\v z}
10102 % Latin2 (ISO-8859-2) character definitions.
10103 \gdef\lattwochardefs{%
10104 \gdefchar^^a0{\tie}
10105 \gdefchar^^a1{\ogonek{A}}
10106 \gdefchar^^a2{\u{}}
10108 \gdefchar^^a4{\missingcharmsg{CURRENCY SIGN}}
10109 \gdefchar^^a5{\v L}
10112 \gdefchar^^a8{\"{}}
10113 \gdefchar^^a9{\v S}
10114 \gdefchar^^aa{\cedilla S}
10115 \gdefchar^^ab{\v T}
10118 \gdefchar^^ae{\v Z}
10119 \gdefchar^^af{\dotaccent Z}
10121 \gdefchar^^b0{\textdegree}
10122 \gdefchar^^b1{\ogonek{a}}
10123 \gdefchar^^b2{\ogonek{ }}
10125 \gdefchar^^b4{\'{}}
10126 \gdefchar^^b5{\v l}
10128 \gdefchar^^b7{\v{}}
10129 \gdefchar^^b8{\cedilla\ }
10130 \gdefchar^^b9{\v s}
10131 \gdefchar^^ba{\cedilla s}
10132 \gdefchar^^bb{\v t}
10134 \gdefchar^^bd{\H{}}
10135 \gdefchar^^be{\v z}
10136 \gdefchar^^bf{\dotaccent z}
10141 \gdefchar^^c3{\u A}
10145 \gdefchar^^c7{\cedilla C}
10146 \gdefchar^^c8{\v C}
10148 \gdefchar^^ca{\ogonek{E}}
10150 \gdefchar^^cc{\v E}
10153 \gdefchar^^cf{\v D}
10157 \gdefchar^^d2{\v N}
10160 \gdefchar^^d5{\H O}
10162 \gdefchar^^d7{$\times$}
10163 \gdefchar^^d8{\v R}
10164 \gdefchar^^d9{\ringaccent U}
10166 \gdefchar^^db{\H U}
10169 \gdefchar^^de{\cedilla T}
10175 \gdefchar^^e3{\u a}
10179 \gdefchar^^e7{\cedilla c}
10180 \gdefchar^^e8{\v c}
10182 \gdefchar^^ea{\ogonek{e}}
10184 \gdefchar^^ec{\v e}
10185 \gdefchar^^ed{\'{\dotless{i}}}
10186 \gdefchar^^ee{\^{\dotless{i}}}
10187 \gdefchar^^ef{\v d}
10191 \gdefchar^^f2{\v n}
10194 \gdefchar^^f5{\H o}
10196 \gdefchar^^f7{$\div$}
10197 \gdefchar^^f8{\v r}
10198 \gdefchar^^f9{\ringaccent u}
10200 \gdefchar^^fb{\H u}
10203 \gdefchar^^fe{\cedilla t}
10204 \gdefchar^^ff{\dotaccent{}}
10207 \endgroup % active chars
10209 % UTF-8 character definitions.
10211 % This code to support UTF-8 is based on LaTeX's utf8.def, with some
10212 % changes for Texinfo conventions. It is included here under the GPL by
10213 % permission from Frank Mittelbach and the LaTeX team.
10215 \newcount\countUTFx
10216 \newcount\countUTFy
10217 \newcount\countUTFz
10219 \gdef\UTFviiiTwoOctets#1#2{\expandafter
10220 \UTFviiiDefined\csname u8:#1\string #2\endcsname}
10222 \gdef\UTFviiiThreeOctets#1#2#3{\expandafter
10223 \UTFviiiDefined\csname u8:#1\string #2\string #3\endcsname}
10225 \gdef\UTFviiiFourOctets#1#2#3#4{\expandafter
10226 \UTFviiiDefined\csname u8:#1\string #2\string #3\string #4\endcsname}
10228 \gdef\UTFviiiDefined#1{%
10230 \message{\linenumber Unicode char \string #1 not defined for Texinfo}%
10236 % Give non-ASCII bytes the active definitions for processing UTF-8 sequences
10242 % Loop from \countUTFx to \countUTFy, performing \UTFviiiTmp
10243 % substituting ~ and $ with a character token of that value.
10245 \global\catcode\countUTFx\active
10246 \uccode`\~\countUTFx
10247 \uccode`\$\countUTFx
10248 \uppercase\expandafter{\UTFviiiTmp}%
10249 \advance\countUTFx by 1
10250 \ifnum\countUTFx < \countUTFy
10251 \expandafter\UTFviiiLoop
10254 % For bytes other than the first in a UTF-8 sequence. Not expected to
10255 % be expanded except when writing to auxiliary files.
10260 \ifpassthroughchars $\fi}}%
10267 \ifpassthroughchars $%
10268 \else\expandafter\UTFviiiTwoOctets\expandafter$\fi}}%
10275 \ifpassthroughchars $%
10276 \else\expandafter\UTFviiiThreeOctets\expandafter$\fi}}%
10283 \ifpassthroughchars $%
10284 \else\expandafter\UTFviiiFourOctets\expandafter$\fi
10289 \def\globallet{\global\let} % save some \expandafter's below
10291 % @U{xxxx} to produce U+xxxx, if we support it.
10293 \expandafter\ifx\csname uni:#1\endcsname \relax
10294 \iftxinativeunicodecapable
10295 % All Unicode characters can be used if native Unicode handling is
10296 % active. However, if the font does not have the glyph,
10297 % letters are missing.
10299 \uccode`\.="#1\relax
10303 \errhelp = \EMsimple
10304 \errmessage{Unicode character U+#1 not supported, sorry}%
10307 \csname uni:#1\endcsname
10311 % These macros are used here to construct the name of a control
10312 % sequence to be defined.
10313 \def\UTFviiiTwoOctetsName#1#2{%
10314 \csname u8:#1\string #2\endcsname}%
10315 \def\UTFviiiThreeOctetsName#1#2#3{%
10316 \csname u8:#1\string #2\string #3\endcsname}%
10317 \def\UTFviiiFourOctetsName#1#2#3#4{%
10318 \csname u8:#1\string #2\string #3\string #4\endcsname}%
10320 % For UTF-8 byte sequences (TeX, e-TeX and pdfTeX),
10321 % provide a definition macro to replace a Unicode character;
10322 % this gets used by the @U command
10332 \gdef\DeclareUnicodeCharacterUTFviii#1#2{%
10333 \countUTFz = "#1\relax
10337 % Give \u8:... its definition. The sequence of seven \expandafter's
10338 % expands after the \gdef three times, e.g.
10340 % 1. \UTFviiTwoOctetsName B1 B2
10341 % 2. \csname u8:B1 \string B2 \endcsname
10342 % 3. \u8: B1 B2 (a single control sequence token)
10344 \expandafter\expandafter
10345 \expandafter\expandafter
10346 \expandafter\expandafter
10347 \expandafter\gdef \UTFviiiTmp{#2}%
10349 \expandafter\ifx\csname uni:#1\endcsname \relax \else
10350 \message{Internal error, already defined: #1}%
10353 % define an additional control sequence for this code point.
10354 \expandafter\globallet\csname uni:#1\endcsname \UTFviiiTmp
10357 % Given the value in \countUTFz as a Unicode code point, set \UTFviiiTmp
10358 % to the corresponding UTF-8 sequence.
10359 \gdef\parseXMLCharref{%
10360 \ifnum\countUTFz < "20\relax
10361 \errhelp = \EMsimple
10362 \errmessage{Cannot define Unicode char value < 0020}%
10363 \else\ifnum\countUTFz < "800\relax
10365 \parseUTFviiiB C\UTFviiiTwoOctetsName.,%
10366 \else\ifnum\countUTFz < "10000\relax
10369 \parseUTFviiiB E\UTFviiiThreeOctetsName.{,;}%
10374 \parseUTFviiiB F\UTFviiiFourOctetsName.{!,;}%
10378 % Extract a byte from the end of the UTF-8 representation of \countUTFx.
10379 % It must be a non-initial byte in the sequence.
10380 % Change \uccode of #1 for it to be used in \parseUTFviiiB as one
10382 \gdef\parseUTFviiiA#1{%
10383 \countUTFx = \countUTFz
10384 \divide\countUTFz by 64
10385 \countUTFy = \countUTFz % Save to be the future value of \countUTFz.
10386 \multiply\countUTFz by 64
10388 % \countUTFz is now \countUTFx with the last 5 bits cleared. Subtract
10389 % in order to get the last five bits.
10390 \advance\countUTFx by -\countUTFz
10392 % Convert this to the byte in the UTF-8 sequence.
10393 \advance\countUTFx by 128
10394 \uccode `#1\countUTFx
10395 \countUTFz = \countUTFy}
10397 % Used to put a UTF-8 byte sequence into \UTFviiiTmp
10398 % #1 is the increment for \countUTFz to yield a the first byte of the UTF-8
10400 % #2 is one of the \UTFviii*OctetsName macros.
10401 % #3 is always a full stop (.)
10402 % #4 is a template for the other bytes in the sequence. The values for these
10403 % bytes is substituted in here with \uppercase using the \uccode's.
10404 \gdef\parseUTFviiiB#1#2#3#4{%
10405 \advance\countUTFz by "#10\relax
10406 \uccode `#3\countUTFz
10407 \uppercase{\gdef\UTFviiiTmp{#2#3#4}}}
10410 % For native Unicode handling (XeTeX and LuaTeX),
10411 % provide a definition macro that sets a catcode to `other' non-globally
10413 \def\DeclareUnicodeCharacterNativeOther#1#2{%
10417 % https://en.wikipedia.org/wiki/Plane_(Unicode)#Basic_M
10418 % U+0000..U+007F = https://en.wikipedia.org/wiki/Basic_Latin_(Unicode_block)
10419 % U+0080..U+00FF = https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)
10420 % U+0100..U+017F = https://en.wikipedia.org/wiki/Latin_Extended-A
10421 % U+0180..U+024F = https://en.wikipedia.org/wiki/Latin_Extended-B
10423 % Many of our renditions are less than wonderful, and all the missing
10424 % characters are available somewhere. Loading the necessary fonts
10425 % awaits user request. We can't truly support Unicode without
10426 % reimplementing everything that's been done in LaTeX for many years,
10427 % plus probably using luatex or xetex, and who knows what else.
10428 % We won't be doing that here in this simple file. But we can try to at
10429 % least make most of the characters not bomb out.
10431 \def\unicodechardefs{%
10432 \DeclareUnicodeCharacter{0020}{ } % space
10433 \DeclareUnicodeCharacter{0021}{\char"21 }% % space to terminate number
10434 \DeclareUnicodeCharacter{0022}{\char"22 }%
10435 \DeclareUnicodeCharacter{0023}{\char"23 }%
10436 \DeclareUnicodeCharacter{0024}{\char"24 }%
10437 \DeclareUnicodeCharacter{0025}{\char"25 }%
10438 \DeclareUnicodeCharacter{0026}{\char"26 }%
10439 \DeclareUnicodeCharacter{0027}{\char"27 }%
10440 \DeclareUnicodeCharacter{0028}{\char"28 }%
10441 \DeclareUnicodeCharacter{0029}{\char"29 }%
10442 \DeclareUnicodeCharacter{002A}{\char"2A }%
10443 \DeclareUnicodeCharacter{002B}{\char"2B }%
10444 \DeclareUnicodeCharacter{002C}{\char"2C }%
10445 \DeclareUnicodeCharacter{002D}{\char"2D }%
10446 \DeclareUnicodeCharacter{002E}{\char"2E }%
10447 \DeclareUnicodeCharacter{002F}{\char"2F }%
10448 \DeclareUnicodeCharacter{0030}{0}%
10449 \DeclareUnicodeCharacter{0031}{1}%
10450 \DeclareUnicodeCharacter{0032}{2}%
10451 \DeclareUnicodeCharacter{0033}{3}%
10452 \DeclareUnicodeCharacter{0034}{4}%
10453 \DeclareUnicodeCharacter{0035}{5}%
10454 \DeclareUnicodeCharacter{0036}{6}%
10455 \DeclareUnicodeCharacter{0037}{7}%
10456 \DeclareUnicodeCharacter{0038}{8}%
10457 \DeclareUnicodeCharacter{0039}{9}%
10458 \DeclareUnicodeCharacter{003A}{\char"3A }%
10459 \DeclareUnicodeCharacter{003B}{\char"3B }%
10460 \DeclareUnicodeCharacter{003C}{\char"3C }%
10461 \DeclareUnicodeCharacter{003D}{\char"3D }%
10462 \DeclareUnicodeCharacter{003E}{\char"3E }%
10463 \DeclareUnicodeCharacter{003F}{\char"3F }%
10464 \DeclareUnicodeCharacter{0040}{\char"40 }%
10465 \DeclareUnicodeCharacter{0041}{A}%
10466 \DeclareUnicodeCharacter{0042}{B}%
10467 \DeclareUnicodeCharacter{0043}{C}%
10468 \DeclareUnicodeCharacter{0044}{D}%
10469 \DeclareUnicodeCharacter{0045}{E}%
10470 \DeclareUnicodeCharacter{0046}{F}%
10471 \DeclareUnicodeCharacter{0047}{G}%
10472 \DeclareUnicodeCharacter{0048}{H}%
10473 \DeclareUnicodeCharacter{0049}{I}%
10474 \DeclareUnicodeCharacter{004A}{J}%
10475 \DeclareUnicodeCharacter{004B}{K}%
10476 \DeclareUnicodeCharacter{004C}{L}%
10477 \DeclareUnicodeCharacter{004D}{M}%
10478 \DeclareUnicodeCharacter{004E}{N}%
10479 \DeclareUnicodeCharacter{004F}{O}%
10480 \DeclareUnicodeCharacter{0050}{P}%
10481 \DeclareUnicodeCharacter{0051}{Q}%
10482 \DeclareUnicodeCharacter{0052}{R}%
10483 \DeclareUnicodeCharacter{0053}{S}%
10484 \DeclareUnicodeCharacter{0054}{T}%
10485 \DeclareUnicodeCharacter{0055}{U}%
10486 \DeclareUnicodeCharacter{0056}{V}%
10487 \DeclareUnicodeCharacter{0057}{W}%
10488 \DeclareUnicodeCharacter{0058}{X}%
10489 \DeclareUnicodeCharacter{0059}{Y}%
10490 \DeclareUnicodeCharacter{005A}{Z}%
10491 \DeclareUnicodeCharacter{005B}{\char"5B }%
10492 \DeclareUnicodeCharacter{005C}{\char"5C }%
10493 \DeclareUnicodeCharacter{005D}{\char"5D }%
10494 \DeclareUnicodeCharacter{005E}{\char"5E }%
10495 \DeclareUnicodeCharacter{005F}{\char"5F }%
10496 \DeclareUnicodeCharacter{0060}{\char"60 }%
10497 \DeclareUnicodeCharacter{0061}{a}%
10498 \DeclareUnicodeCharacter{0062}{b}%
10499 \DeclareUnicodeCharacter{0063}{c}%
10500 \DeclareUnicodeCharacter{0064}{d}%
10501 \DeclareUnicodeCharacter{0065}{e}%
10502 \DeclareUnicodeCharacter{0066}{f}%
10503 \DeclareUnicodeCharacter{0067}{g}%
10504 \DeclareUnicodeCharacter{0068}{h}%
10505 \DeclareUnicodeCharacter{0069}{i}%
10506 \DeclareUnicodeCharacter{006A}{j}%
10507 \DeclareUnicodeCharacter{006B}{k}%
10508 \DeclareUnicodeCharacter{006C}{l}%
10509 \DeclareUnicodeCharacter{006D}{m}%
10510 \DeclareUnicodeCharacter{006E}{n}%
10511 \DeclareUnicodeCharacter{006F}{o}%
10512 \DeclareUnicodeCharacter{0070}{p}%
10513 \DeclareUnicodeCharacter{0071}{q}%
10514 \DeclareUnicodeCharacter{0072}{r}%
10515 \DeclareUnicodeCharacter{0073}{s}%
10516 \DeclareUnicodeCharacter{0074}{t}%
10517 \DeclareUnicodeCharacter{0075}{u}%
10518 \DeclareUnicodeCharacter{0076}{v}%
10519 \DeclareUnicodeCharacter{0077}{w}%
10520 \DeclareUnicodeCharacter{0078}{x}%
10521 \DeclareUnicodeCharacter{0079}{y}%
10522 \DeclareUnicodeCharacter{007A}{z}%
10523 \DeclareUnicodeCharacter{007B}{\char"7B }%
10524 \DeclareUnicodeCharacter{007C}{\char"7C }%
10525 \DeclareUnicodeCharacter{007D}{\char"7D }%
10526 \DeclareUnicodeCharacter{007E}{\char"7E }%
10527 % \DeclareUnicodeCharacter{007F}{} % DEL
10529 \DeclareUnicodeCharacter{00A0}{\tie}%
10530 \DeclareUnicodeCharacter{00A1}{\exclamdown}%
10531 \DeclareUnicodeCharacter{00A2}{{\tcfont \char162}}% 0242=cent
10532 \DeclareUnicodeCharacter{00A3}{\pounds{}}%
10533 \DeclareUnicodeCharacter{00A4}{{\tcfont \char164}}% 0244=currency
10534 \DeclareUnicodeCharacter{00A5}{{\tcfont \char165}}% 0245=yen
10535 \DeclareUnicodeCharacter{00A6}{{\tcfont \char166}}% 0246=brokenbar
10536 \DeclareUnicodeCharacter{00A7}{\S}%
10537 \DeclareUnicodeCharacter{00A8}{\"{ }}%
10538 \DeclareUnicodeCharacter{00A9}{\copyright{}}%
10539 \DeclareUnicodeCharacter{00AA}{\ordf}%
10540 \DeclareUnicodeCharacter{00AB}{\guillemetleft{}}%
10541 \DeclareUnicodeCharacter{00AC}{\ensuremath\lnot}%
10542 \DeclareUnicodeCharacter{00AD}{\-}%
10543 \DeclareUnicodeCharacter{00AE}{\registeredsymbol{}}%
10544 \DeclareUnicodeCharacter{00AF}{\={ }}%
10546 \DeclareUnicodeCharacter{00B0}{\textdegree}%
10547 \DeclareUnicodeCharacter{00B1}{\ensuremath\pm}%
10548 \DeclareUnicodeCharacter{00B2}{$^2$}%
10549 \DeclareUnicodeCharacter{00B3}{$^3$}%
10550 \DeclareUnicodeCharacter{00B4}{\'{ }}%
10551 \DeclareUnicodeCharacter{00B5}{$\mu$}%
10552 \DeclareUnicodeCharacter{00B6}{\P}%
10553 \DeclareUnicodeCharacter{00B7}{\ensuremath\cdot}%
10554 \DeclareUnicodeCharacter{00B8}{\cedilla{ }}%
10555 \DeclareUnicodeCharacter{00B9}{$^1$}%
10556 \DeclareUnicodeCharacter{00BA}{\ordm}%
10557 \DeclareUnicodeCharacter{00BB}{\guillemetright{}}%
10558 \DeclareUnicodeCharacter{00BC}{$1\over4$}%
10559 \DeclareUnicodeCharacter{00BD}{$1\over2$}%
10560 \DeclareUnicodeCharacter{00BE}{$3\over4$}%
10561 \DeclareUnicodeCharacter{00BF}{\questiondown}%
10563 \DeclareUnicodeCharacter{00C0}{\`A}%
10564 \DeclareUnicodeCharacter{00C1}{\'A}%
10565 \DeclareUnicodeCharacter{00C2}{\^A}%
10566 \DeclareUnicodeCharacter{00C3}{\~A}%
10567 \DeclareUnicodeCharacter{00C4}{\"A}%
10568 \DeclareUnicodeCharacter{00C5}{\AA}%
10569 \DeclareUnicodeCharacter{00C6}{\AE}%
10570 \DeclareUnicodeCharacter{00C7}{\cedilla{C}}%
10571 \DeclareUnicodeCharacter{00C8}{\`E}%
10572 \DeclareUnicodeCharacter{00C9}{\'E}%
10573 \DeclareUnicodeCharacter{00CA}{\^E}%
10574 \DeclareUnicodeCharacter{00CB}{\"E}%
10575 \DeclareUnicodeCharacter{00CC}{\`I}%
10576 \DeclareUnicodeCharacter{00CD}{\'I}%
10577 \DeclareUnicodeCharacter{00CE}{\^I}%
10578 \DeclareUnicodeCharacter{00CF}{\"I}%
10580 \DeclareUnicodeCharacter{00D0}{\DH}%
10581 \DeclareUnicodeCharacter{00D1}{\~N}%
10582 \DeclareUnicodeCharacter{00D2}{\`O}%
10583 \DeclareUnicodeCharacter{00D3}{\'O}%
10584 \DeclareUnicodeCharacter{00D4}{\^O}%
10585 \DeclareUnicodeCharacter{00D5}{\~O}%
10586 \DeclareUnicodeCharacter{00D6}{\"O}%
10587 \DeclareUnicodeCharacter{00D7}{\ensuremath\times}%
10588 \DeclareUnicodeCharacter{00D8}{\O}%
10589 \DeclareUnicodeCharacter{00D9}{\`U}%
10590 \DeclareUnicodeCharacter{00DA}{\'U}%
10591 \DeclareUnicodeCharacter{00DB}{\^U}%
10592 \DeclareUnicodeCharacter{00DC}{\"U}%
10593 \DeclareUnicodeCharacter{00DD}{\'Y}%
10594 \DeclareUnicodeCharacter{00DE}{\TH}%
10595 \DeclareUnicodeCharacter{00DF}{\ss}%
10597 \DeclareUnicodeCharacter{00E0}{\`a}%
10598 \DeclareUnicodeCharacter{00E1}{\'a}%
10599 \DeclareUnicodeCharacter{00E2}{\^a}%
10600 \DeclareUnicodeCharacter{00E3}{\~a}%
10601 \DeclareUnicodeCharacter{00E4}{\"a}%
10602 \DeclareUnicodeCharacter{00E5}{\aa}%
10603 \DeclareUnicodeCharacter{00E6}{\ae}%
10604 \DeclareUnicodeCharacter{00E7}{\cedilla{c}}%
10605 \DeclareUnicodeCharacter{00E8}{\`e}%
10606 \DeclareUnicodeCharacter{00E9}{\'e}%
10607 \DeclareUnicodeCharacter{00EA}{\^e}%
10608 \DeclareUnicodeCharacter{00EB}{\"e}%
10609 \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}}%
10610 \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}}%
10611 \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}}%
10612 \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}}%
10614 \DeclareUnicodeCharacter{00F0}{\dh}%
10615 \DeclareUnicodeCharacter{00F1}{\~n}%
10616 \DeclareUnicodeCharacter{00F2}{\`o}%
10617 \DeclareUnicodeCharacter{00F3}{\'o}%
10618 \DeclareUnicodeCharacter{00F4}{\^o}%
10619 \DeclareUnicodeCharacter{00F5}{\~o}%
10620 \DeclareUnicodeCharacter{00F6}{\"o}%
10621 \DeclareUnicodeCharacter{00F7}{\ensuremath\div}%
10622 \DeclareUnicodeCharacter{00F8}{\o}%
10623 \DeclareUnicodeCharacter{00F9}{\`u}%
10624 \DeclareUnicodeCharacter{00FA}{\'u}%
10625 \DeclareUnicodeCharacter{00FB}{\^u}%
10626 \DeclareUnicodeCharacter{00FC}{\"u}%
10627 \DeclareUnicodeCharacter{00FD}{\'y}%
10628 \DeclareUnicodeCharacter{00FE}{\th}%
10629 \DeclareUnicodeCharacter{00FF}{\"y}%
10631 \DeclareUnicodeCharacter{0100}{\=A}%
10632 \DeclareUnicodeCharacter{0101}{\=a}%
10633 \DeclareUnicodeCharacter{0102}{\u{A}}%
10634 \DeclareUnicodeCharacter{0103}{\u{a}}%
10635 \DeclareUnicodeCharacter{0104}{\ogonek{A}}%
10636 \DeclareUnicodeCharacter{0105}{\ogonek{a}}%
10637 \DeclareUnicodeCharacter{0106}{\'C}%
10638 \DeclareUnicodeCharacter{0107}{\'c}%
10639 \DeclareUnicodeCharacter{0108}{\^C}%
10640 \DeclareUnicodeCharacter{0109}{\^c}%
10641 \DeclareUnicodeCharacter{010A}{\dotaccent{C}}%
10642 \DeclareUnicodeCharacter{010B}{\dotaccent{c}}%
10643 \DeclareUnicodeCharacter{010C}{\v{C}}%
10644 \DeclareUnicodeCharacter{010D}{\v{c}}%
10645 \DeclareUnicodeCharacter{010E}{\v{D}}%
10646 \DeclareUnicodeCharacter{010F}{d'}%
10648 \DeclareUnicodeCharacter{0110}{\DH}%
10649 \DeclareUnicodeCharacter{0111}{\dh}%
10650 \DeclareUnicodeCharacter{0112}{\=E}%
10651 \DeclareUnicodeCharacter{0113}{\=e}%
10652 \DeclareUnicodeCharacter{0114}{\u{E}}%
10653 \DeclareUnicodeCharacter{0115}{\u{e}}%
10654 \DeclareUnicodeCharacter{0116}{\dotaccent{E}}%
10655 \DeclareUnicodeCharacter{0117}{\dotaccent{e}}%
10656 \DeclareUnicodeCharacter{0118}{\ogonek{E}}%
10657 \DeclareUnicodeCharacter{0119}{\ogonek{e}}%
10658 \DeclareUnicodeCharacter{011A}{\v{E}}%
10659 \DeclareUnicodeCharacter{011B}{\v{e}}%
10660 \DeclareUnicodeCharacter{011C}{\^G}%
10661 \DeclareUnicodeCharacter{011D}{\^g}%
10662 \DeclareUnicodeCharacter{011E}{\u{G}}%
10663 \DeclareUnicodeCharacter{011F}{\u{g}}%
10665 \DeclareUnicodeCharacter{0120}{\dotaccent{G}}%
10666 \DeclareUnicodeCharacter{0121}{\dotaccent{g}}%
10667 \DeclareUnicodeCharacter{0122}{\cedilla{G}}%
10668 \DeclareUnicodeCharacter{0123}{\cedilla{g}}%
10669 \DeclareUnicodeCharacter{0124}{\^H}%
10670 \DeclareUnicodeCharacter{0125}{\^h}%
10671 \DeclareUnicodeCharacter{0126}{\missingcharmsg{H WITH STROKE}}%
10672 \DeclareUnicodeCharacter{0127}{\missingcharmsg{h WITH STROKE}}%
10673 \DeclareUnicodeCharacter{0128}{\~I}%
10674 \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}}%
10675 \DeclareUnicodeCharacter{012A}{\=I}%
10676 \DeclareUnicodeCharacter{012B}{\={\dotless{i}}}%
10677 \DeclareUnicodeCharacter{012C}{\u{I}}%
10678 \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}}%
10679 \DeclareUnicodeCharacter{012E}{\ogonek{I}}%
10680 \DeclareUnicodeCharacter{012F}{\ogonek{i}}%
10682 \DeclareUnicodeCharacter{0130}{\dotaccent{I}}%
10683 \DeclareUnicodeCharacter{0131}{\dotless{i}}%
10684 \DeclareUnicodeCharacter{0132}{IJ}%
10685 \DeclareUnicodeCharacter{0133}{ij}%
10686 \DeclareUnicodeCharacter{0134}{\^J}%
10687 \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}}%
10688 \DeclareUnicodeCharacter{0136}{\cedilla{K}}%
10689 \DeclareUnicodeCharacter{0137}{\cedilla{k}}%
10690 \DeclareUnicodeCharacter{0138}{\ensuremath\kappa}%
10691 \DeclareUnicodeCharacter{0139}{\'L}%
10692 \DeclareUnicodeCharacter{013A}{\'l}%
10693 \DeclareUnicodeCharacter{013B}{\cedilla{L}}%
10694 \DeclareUnicodeCharacter{013C}{\cedilla{l}}%
10695 \DeclareUnicodeCharacter{013D}{L'}% should kern
10696 \DeclareUnicodeCharacter{013E}{l'}% should kern
10697 \DeclareUnicodeCharacter{013F}{L\U{00B7}}%
10699 \DeclareUnicodeCharacter{0140}{l\U{00B7}}%
10700 \DeclareUnicodeCharacter{0141}{\L}%
10701 \DeclareUnicodeCharacter{0142}{\l}%
10702 \DeclareUnicodeCharacter{0143}{\'N}%
10703 \DeclareUnicodeCharacter{0144}{\'n}%
10704 \DeclareUnicodeCharacter{0145}{\cedilla{N}}%
10705 \DeclareUnicodeCharacter{0146}{\cedilla{n}}%
10706 \DeclareUnicodeCharacter{0147}{\v{N}}%
10707 \DeclareUnicodeCharacter{0148}{\v{n}}%
10708 \DeclareUnicodeCharacter{0149}{'n}%
10709 \DeclareUnicodeCharacter{014A}{\missingcharmsg{ENG}}%
10710 \DeclareUnicodeCharacter{014B}{\missingcharmsg{eng}}%
10711 \DeclareUnicodeCharacter{014C}{\=O}%
10712 \DeclareUnicodeCharacter{014D}{\=o}%
10713 \DeclareUnicodeCharacter{014E}{\u{O}}%
10714 \DeclareUnicodeCharacter{014F}{\u{o}}%
10716 \DeclareUnicodeCharacter{0150}{\H{O}}%
10717 \DeclareUnicodeCharacter{0151}{\H{o}}%
10718 \DeclareUnicodeCharacter{0152}{\OE}%
10719 \DeclareUnicodeCharacter{0153}{\oe}%
10720 \DeclareUnicodeCharacter{0154}{\'R}%
10721 \DeclareUnicodeCharacter{0155}{\'r}%
10722 \DeclareUnicodeCharacter{0156}{\cedilla{R}}%
10723 \DeclareUnicodeCharacter{0157}{\cedilla{r}}%
10724 \DeclareUnicodeCharacter{0158}{\v{R}}%
10725 \DeclareUnicodeCharacter{0159}{\v{r}}%
10726 \DeclareUnicodeCharacter{015A}{\'S}%
10727 \DeclareUnicodeCharacter{015B}{\'s}%
10728 \DeclareUnicodeCharacter{015C}{\^S}%
10729 \DeclareUnicodeCharacter{015D}{\^s}%
10730 \DeclareUnicodeCharacter{015E}{\cedilla{S}}%
10731 \DeclareUnicodeCharacter{015F}{\cedilla{s}}%
10733 \DeclareUnicodeCharacter{0160}{\v{S}}%
10734 \DeclareUnicodeCharacter{0161}{\v{s}}%
10735 \DeclareUnicodeCharacter{0162}{\cedilla{T}}%
10736 \DeclareUnicodeCharacter{0163}{\cedilla{t}}%
10737 \DeclareUnicodeCharacter{0164}{\v{T}}%
10738 \DeclareUnicodeCharacter{0165}{\v{t}}%
10739 \DeclareUnicodeCharacter{0166}{\missingcharmsg{H WITH STROKE}}%
10740 \DeclareUnicodeCharacter{0167}{\missingcharmsg{h WITH STROKE}}%
10741 \DeclareUnicodeCharacter{0168}{\~U}%
10742 \DeclareUnicodeCharacter{0169}{\~u}%
10743 \DeclareUnicodeCharacter{016A}{\=U}%
10744 \DeclareUnicodeCharacter{016B}{\=u}%
10745 \DeclareUnicodeCharacter{016C}{\u{U}}%
10746 \DeclareUnicodeCharacter{016D}{\u{u}}%
10747 \DeclareUnicodeCharacter{016E}{\ringaccent{U}}%
10748 \DeclareUnicodeCharacter{016F}{\ringaccent{u}}%
10750 \DeclareUnicodeCharacter{0170}{\H{U}}%
10751 \DeclareUnicodeCharacter{0171}{\H{u}}%
10752 \DeclareUnicodeCharacter{0172}{\ogonek{U}}%
10753 \DeclareUnicodeCharacter{0173}{\ogonek{u}}%
10754 \DeclareUnicodeCharacter{0174}{\^W}%
10755 \DeclareUnicodeCharacter{0175}{\^w}%
10756 \DeclareUnicodeCharacter{0176}{\^Y}%
10757 \DeclareUnicodeCharacter{0177}{\^y}%
10758 \DeclareUnicodeCharacter{0178}{\"Y}%
10759 \DeclareUnicodeCharacter{0179}{\'Z}%
10760 \DeclareUnicodeCharacter{017A}{\'z}%
10761 \DeclareUnicodeCharacter{017B}{\dotaccent{Z}}%
10762 \DeclareUnicodeCharacter{017C}{\dotaccent{z}}%
10763 \DeclareUnicodeCharacter{017D}{\v{Z}}%
10764 \DeclareUnicodeCharacter{017E}{\v{z}}%
10765 \DeclareUnicodeCharacter{017F}{\missingcharmsg{LONG S}}%
10767 \DeclareUnicodeCharacter{01C4}{D\v{Z}}%
10768 \DeclareUnicodeCharacter{01C5}{D\v{z}}%
10769 \DeclareUnicodeCharacter{01C6}{d\v{z}}%
10770 \DeclareUnicodeCharacter{01C7}{LJ}%
10771 \DeclareUnicodeCharacter{01C8}{Lj}%
10772 \DeclareUnicodeCharacter{01C9}{lj}%
10773 \DeclareUnicodeCharacter{01CA}{NJ}%
10774 \DeclareUnicodeCharacter{01CB}{Nj}%
10775 \DeclareUnicodeCharacter{01CC}{nj}%
10776 \DeclareUnicodeCharacter{01CD}{\v{A}}%
10777 \DeclareUnicodeCharacter{01CE}{\v{a}}%
10778 \DeclareUnicodeCharacter{01CF}{\v{I}}%
10780 \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}}%
10781 \DeclareUnicodeCharacter{01D1}{\v{O}}%
10782 \DeclareUnicodeCharacter{01D2}{\v{o}}%
10783 \DeclareUnicodeCharacter{01D3}{\v{U}}%
10784 \DeclareUnicodeCharacter{01D4}{\v{u}}%
10786 \DeclareUnicodeCharacter{01E2}{\={\AE}}%
10787 \DeclareUnicodeCharacter{01E3}{\={\ae}}%
10788 \DeclareUnicodeCharacter{01E6}{\v{G}}%
10789 \DeclareUnicodeCharacter{01E7}{\v{g}}%
10790 \DeclareUnicodeCharacter{01E8}{\v{K}}%
10791 \DeclareUnicodeCharacter{01E9}{\v{k}}%
10793 \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}}%
10794 \DeclareUnicodeCharacter{01F1}{DZ}%
10795 \DeclareUnicodeCharacter{01F2}{Dz}%
10796 \DeclareUnicodeCharacter{01F3}{dz}%
10797 \DeclareUnicodeCharacter{01F4}{\'G}%
10798 \DeclareUnicodeCharacter{01F5}{\'g}%
10799 \DeclareUnicodeCharacter{01F8}{\`N}%
10800 \DeclareUnicodeCharacter{01F9}{\`n}%
10801 \DeclareUnicodeCharacter{01FC}{\'{\AE}}%
10802 \DeclareUnicodeCharacter{01FD}{\'{\ae}}%
10803 \DeclareUnicodeCharacter{01FE}{\'{\O}}%
10804 \DeclareUnicodeCharacter{01FF}{\'{\o}}%
10806 \DeclareUnicodeCharacter{021E}{\v{H}}%
10807 \DeclareUnicodeCharacter{021F}{\v{h}}%
10809 \DeclareUnicodeCharacter{0226}{\dotaccent{A}}%
10810 \DeclareUnicodeCharacter{0227}{\dotaccent{a}}%
10811 \DeclareUnicodeCharacter{0228}{\cedilla{E}}%
10812 \DeclareUnicodeCharacter{0229}{\cedilla{e}}%
10813 \DeclareUnicodeCharacter{022E}{\dotaccent{O}}%
10814 \DeclareUnicodeCharacter{022F}{\dotaccent{o}}%
10816 \DeclareUnicodeCharacter{0232}{\=Y}%
10817 \DeclareUnicodeCharacter{0233}{\=y}%
10818 \DeclareUnicodeCharacter{0237}{\dotless{j}}%
10820 \DeclareUnicodeCharacter{02BC}{'}%
10822 \DeclareUnicodeCharacter{02DB}{\ogonek{ }}%
10824 % Greek letters upper case
10825 \DeclareUnicodeCharacter{0391}{{\it A}}%
10826 \DeclareUnicodeCharacter{0392}{{\it B}}%
10827 \DeclareUnicodeCharacter{0393}{\ensuremath{\mit\Gamma}}%
10828 \DeclareUnicodeCharacter{0394}{\ensuremath{\mit\Delta}}%
10829 \DeclareUnicodeCharacter{0395}{{\it E}}%
10830 \DeclareUnicodeCharacter{0396}{{\it Z}}%
10831 \DeclareUnicodeCharacter{0397}{{\it H}}%
10832 \DeclareUnicodeCharacter{0398}{\ensuremath{\mit\Theta}}%
10833 \DeclareUnicodeCharacter{0399}{{\it I}}%
10834 \DeclareUnicodeCharacter{039A}{{\it K}}%
10835 \DeclareUnicodeCharacter{039B}{\ensuremath{\mit\Lambda}}%
10836 \DeclareUnicodeCharacter{039C}{{\it M}}%
10837 \DeclareUnicodeCharacter{039D}{{\it N}}%
10838 \DeclareUnicodeCharacter{039E}{\ensuremath{\mit\Xi}}%
10839 \DeclareUnicodeCharacter{039F}{{\it O}}%
10840 \DeclareUnicodeCharacter{03A0}{\ensuremath{\mit\Pi}}%
10841 \DeclareUnicodeCharacter{03A1}{{\it P}}%
10842 %\DeclareUnicodeCharacter{03A2}{} % none - corresponds to final sigma
10843 \DeclareUnicodeCharacter{03A3}{\ensuremath{\mit\Sigma}}%
10844 \DeclareUnicodeCharacter{03A4}{{\it T}}%
10845 \DeclareUnicodeCharacter{03A5}{\ensuremath{\mit\Upsilon}}%
10846 \DeclareUnicodeCharacter{03A6}{\ensuremath{\mit\Phi}}%
10847 \DeclareUnicodeCharacter{03A7}{{\it X}}%
10848 \DeclareUnicodeCharacter{03A8}{\ensuremath{\mit\Psi}}%
10849 \DeclareUnicodeCharacter{03A9}{\ensuremath{\mit\Omega}}%
10851 % Vowels with accents
10852 \DeclareUnicodeCharacter{0390}{\ensuremath{\ddot{\acute\iota}}}%
10853 \DeclareUnicodeCharacter{03AC}{\ensuremath{\acute\alpha}}%
10854 \DeclareUnicodeCharacter{03AD}{\ensuremath{\acute\epsilon}}%
10855 \DeclareUnicodeCharacter{03AE}{\ensuremath{\acute\eta}}%
10856 \DeclareUnicodeCharacter{03AF}{\ensuremath{\acute\iota}}%
10857 \DeclareUnicodeCharacter{03B0}{\ensuremath{\acute{\ddot\upsilon}}}%
10859 % Standalone accent
10860 \DeclareUnicodeCharacter{0384}{\ensuremath{\acute{\ }}}%
10862 % Greek letters lower case
10863 \DeclareUnicodeCharacter{03B1}{\ensuremath\alpha}%
10864 \DeclareUnicodeCharacter{03B2}{\ensuremath\beta}%
10865 \DeclareUnicodeCharacter{03B3}{\ensuremath\gamma}%
10866 \DeclareUnicodeCharacter{03B4}{\ensuremath\delta}%
10867 \DeclareUnicodeCharacter{03B5}{\ensuremath\epsilon}%
10868 \DeclareUnicodeCharacter{03B6}{\ensuremath\zeta}%
10869 \DeclareUnicodeCharacter{03B7}{\ensuremath\eta}%
10870 \DeclareUnicodeCharacter{03B8}{\ensuremath\theta}%
10871 \DeclareUnicodeCharacter{03B9}{\ensuremath\iota}%
10872 \DeclareUnicodeCharacter{03BA}{\ensuremath\kappa}%
10873 \DeclareUnicodeCharacter{03BB}{\ensuremath\lambda}%
10874 \DeclareUnicodeCharacter{03BC}{\ensuremath\mu}%
10875 \DeclareUnicodeCharacter{03BD}{\ensuremath\nu}%
10876 \DeclareUnicodeCharacter{03BE}{\ensuremath\xi}%
10877 \DeclareUnicodeCharacter{03BF}{{\it o}}% omicron
10878 \DeclareUnicodeCharacter{03C0}{\ensuremath\pi}%
10879 \DeclareUnicodeCharacter{03C1}{\ensuremath\rho}%
10880 \DeclareUnicodeCharacter{03C2}{\ensuremath\varsigma}%
10881 \DeclareUnicodeCharacter{03C3}{\ensuremath\sigma}%
10882 \DeclareUnicodeCharacter{03C4}{\ensuremath\tau}%
10883 \DeclareUnicodeCharacter{03C5}{\ensuremath\upsilon}%
10884 \DeclareUnicodeCharacter{03C6}{\ensuremath\phi}%
10885 \DeclareUnicodeCharacter{03C7}{\ensuremath\chi}%
10886 \DeclareUnicodeCharacter{03C8}{\ensuremath\psi}%
10887 \DeclareUnicodeCharacter{03C9}{\ensuremath\omega}%
10889 % More Greek vowels with accents
10890 \DeclareUnicodeCharacter{03CA}{\ensuremath{\ddot\iota}}%
10891 \DeclareUnicodeCharacter{03CB}{\ensuremath{\ddot\upsilon}}%
10892 \DeclareUnicodeCharacter{03CC}{\ensuremath{\acute o}}%
10893 \DeclareUnicodeCharacter{03CD}{\ensuremath{\acute\upsilon}}%
10894 \DeclareUnicodeCharacter{03CE}{\ensuremath{\acute\omega}}%
10896 % Variant Greek letters
10897 \DeclareUnicodeCharacter{03D1}{\ensuremath\vartheta}%
10898 \DeclareUnicodeCharacter{03D6}{\ensuremath\varpi}%
10899 \DeclareUnicodeCharacter{03F1}{\ensuremath\varrho}%
10901 \DeclareUnicodeCharacter{1E02}{\dotaccent{B}}%
10902 \DeclareUnicodeCharacter{1E03}{\dotaccent{b}}%
10903 \DeclareUnicodeCharacter{1E04}{\udotaccent{B}}%
10904 \DeclareUnicodeCharacter{1E05}{\udotaccent{b}}%
10905 \DeclareUnicodeCharacter{1E06}{\ubaraccent{B}}%
10906 \DeclareUnicodeCharacter{1E07}{\ubaraccent{b}}%
10907 \DeclareUnicodeCharacter{1E0A}{\dotaccent{D}}%
10908 \DeclareUnicodeCharacter{1E0B}{\dotaccent{d}}%
10909 \DeclareUnicodeCharacter{1E0C}{\udotaccent{D}}%
10910 \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}}%
10911 \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}}%
10912 \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}}%
10914 \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}}%
10915 \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}}%
10917 \DeclareUnicodeCharacter{1E20}{\=G}%
10918 \DeclareUnicodeCharacter{1E21}{\=g}%
10919 \DeclareUnicodeCharacter{1E22}{\dotaccent{H}}%
10920 \DeclareUnicodeCharacter{1E23}{\dotaccent{h}}%
10921 \DeclareUnicodeCharacter{1E24}{\udotaccent{H}}%
10922 \DeclareUnicodeCharacter{1E25}{\udotaccent{h}}%
10923 \DeclareUnicodeCharacter{1E26}{\"H}%
10924 \DeclareUnicodeCharacter{1E27}{\"h}%
10926 \DeclareUnicodeCharacter{1E30}{\'K}%
10927 \DeclareUnicodeCharacter{1E31}{\'k}%
10928 \DeclareUnicodeCharacter{1E32}{\udotaccent{K}}%
10929 \DeclareUnicodeCharacter{1E33}{\udotaccent{k}}%
10930 \DeclareUnicodeCharacter{1E34}{\ubaraccent{K}}%
10931 \DeclareUnicodeCharacter{1E35}{\ubaraccent{k}}%
10932 \DeclareUnicodeCharacter{1E36}{\udotaccent{L}}%
10933 \DeclareUnicodeCharacter{1E37}{\udotaccent{l}}%
10934 \DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}}%
10935 \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}}%
10936 \DeclareUnicodeCharacter{1E3E}{\'M}%
10937 \DeclareUnicodeCharacter{1E3F}{\'m}%
10939 \DeclareUnicodeCharacter{1E40}{\dotaccent{M}}%
10940 \DeclareUnicodeCharacter{1E41}{\dotaccent{m}}%
10941 \DeclareUnicodeCharacter{1E42}{\udotaccent{M}}%
10942 \DeclareUnicodeCharacter{1E43}{\udotaccent{m}}%
10943 \DeclareUnicodeCharacter{1E44}{\dotaccent{N}}%
10944 \DeclareUnicodeCharacter{1E45}{\dotaccent{n}}%
10945 \DeclareUnicodeCharacter{1E46}{\udotaccent{N}}%
10946 \DeclareUnicodeCharacter{1E47}{\udotaccent{n}}%
10947 \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}}%
10948 \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}}%
10950 \DeclareUnicodeCharacter{1E54}{\'P}%
10951 \DeclareUnicodeCharacter{1E55}{\'p}%
10952 \DeclareUnicodeCharacter{1E56}{\dotaccent{P}}%
10953 \DeclareUnicodeCharacter{1E57}{\dotaccent{p}}%
10954 \DeclareUnicodeCharacter{1E58}{\dotaccent{R}}%
10955 \DeclareUnicodeCharacter{1E59}{\dotaccent{r}}%
10956 \DeclareUnicodeCharacter{1E5A}{\udotaccent{R}}%
10957 \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}}%
10958 \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}}%
10959 \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}}%
10961 \DeclareUnicodeCharacter{1E60}{\dotaccent{S}}%
10962 \DeclareUnicodeCharacter{1E61}{\dotaccent{s}}%
10963 \DeclareUnicodeCharacter{1E62}{\udotaccent{S}}%
10964 \DeclareUnicodeCharacter{1E63}{\udotaccent{s}}%
10965 \DeclareUnicodeCharacter{1E6A}{\dotaccent{T}}%
10966 \DeclareUnicodeCharacter{1E6B}{\dotaccent{t}}%
10967 \DeclareUnicodeCharacter{1E6C}{\udotaccent{T}}%
10968 \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}}%
10969 \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}}%
10970 \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}}%
10972 \DeclareUnicodeCharacter{1E7C}{\~V}%
10973 \DeclareUnicodeCharacter{1E7D}{\~v}%
10974 \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}}%
10975 \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}}%
10977 \DeclareUnicodeCharacter{1E80}{\`W}%
10978 \DeclareUnicodeCharacter{1E81}{\`w}%
10979 \DeclareUnicodeCharacter{1E82}{\'W}%
10980 \DeclareUnicodeCharacter{1E83}{\'w}%
10981 \DeclareUnicodeCharacter{1E84}{\"W}%
10982 \DeclareUnicodeCharacter{1E85}{\"w}%
10983 \DeclareUnicodeCharacter{1E86}{\dotaccent{W}}%
10984 \DeclareUnicodeCharacter{1E87}{\dotaccent{w}}%
10985 \DeclareUnicodeCharacter{1E88}{\udotaccent{W}}%
10986 \DeclareUnicodeCharacter{1E89}{\udotaccent{w}}%
10987 \DeclareUnicodeCharacter{1E8A}{\dotaccent{X}}%
10988 \DeclareUnicodeCharacter{1E8B}{\dotaccent{x}}%
10989 \DeclareUnicodeCharacter{1E8C}{\"X}%
10990 \DeclareUnicodeCharacter{1E8D}{\"x}%
10991 \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}}%
10992 \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}}%
10994 \DeclareUnicodeCharacter{1E90}{\^Z}%
10995 \DeclareUnicodeCharacter{1E91}{\^z}%
10996 \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}}%
10997 \DeclareUnicodeCharacter{1E93}{\udotaccent{z}}%
10998 \DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}}%
10999 \DeclareUnicodeCharacter{1E95}{\ubaraccent{z}}%
11000 \DeclareUnicodeCharacter{1E96}{\ubaraccent{h}}%
11001 \DeclareUnicodeCharacter{1E97}{\"t}%
11002 \DeclareUnicodeCharacter{1E98}{\ringaccent{w}}%
11003 \DeclareUnicodeCharacter{1E99}{\ringaccent{y}}%
11005 \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}}%
11006 \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}}%
11008 \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}}%
11009 \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}}%
11010 \DeclareUnicodeCharacter{1EBC}{\~E}%
11011 \DeclareUnicodeCharacter{1EBD}{\~e}%
11013 \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}}%
11014 \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}}%
11015 \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}}%
11016 \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}}%
11018 \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}}%
11019 \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}}%
11021 \DeclareUnicodeCharacter{1EF2}{\`Y}%
11022 \DeclareUnicodeCharacter{1EF3}{\`y}%
11023 \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}}%
11025 \DeclareUnicodeCharacter{1EF8}{\~Y}%
11026 \DeclareUnicodeCharacter{1EF9}{\~y}%
11029 \DeclareUnicodeCharacter{2007}{\hphantom{0}}%
11032 \DeclareUnicodeCharacter{2013}{--}%
11033 \DeclareUnicodeCharacter{2014}{---}%
11034 \DeclareUnicodeCharacter{2018}{\quoteleft{}}%
11035 \DeclareUnicodeCharacter{2019}{\quoteright{}}%
11036 \DeclareUnicodeCharacter{201A}{\quotesinglbase{}}%
11037 \DeclareUnicodeCharacter{201C}{\quotedblleft{}}%
11038 \DeclareUnicodeCharacter{201D}{\quotedblright{}}%
11039 \DeclareUnicodeCharacter{201E}{\quotedblbase{}}%
11040 \DeclareUnicodeCharacter{2020}{\ensuremath\dagger}%
11041 \DeclareUnicodeCharacter{2021}{\ensuremath\ddagger}%
11042 \DeclareUnicodeCharacter{2022}{\bullet{}}%
11043 \DeclareUnicodeCharacter{202F}{\thinspace}%
11044 \DeclareUnicodeCharacter{2026}{\dots{}}%
11045 \DeclareUnicodeCharacter{2039}{\guilsinglleft{}}%
11046 \DeclareUnicodeCharacter{203A}{\guilsinglright{}}%
11048 \DeclareUnicodeCharacter{20AC}{\euro{}}%
11050 \DeclareUnicodeCharacter{2192}{\arrow}%
11051 \DeclareUnicodeCharacter{21D2}{\result{}}%
11053 % Mathematical symbols
11054 \DeclareUnicodeCharacter{2200}{\ensuremath\forall}%
11055 \DeclareUnicodeCharacter{2203}{\ensuremath\exists}%
11056 \DeclareUnicodeCharacter{2208}{\ensuremath\in}%
11057 \DeclareUnicodeCharacter{2212}{\minus{}}%
11058 \DeclareUnicodeCharacter{2217}{\ast}%
11059 \DeclareUnicodeCharacter{221E}{\ensuremath\infty}%
11060 \DeclareUnicodeCharacter{2225}{\ensuremath\parallel}%
11061 \DeclareUnicodeCharacter{2227}{\ensuremath\wedge}%
11062 \DeclareUnicodeCharacter{2229}{\ensuremath\cap}%
11063 \DeclareUnicodeCharacter{2261}{\equiv{}}%
11064 \DeclareUnicodeCharacter{2264}{\ensuremath\leq}%
11065 \DeclareUnicodeCharacter{2265}{\ensuremath\geq}%
11066 \DeclareUnicodeCharacter{2282}{\ensuremath\subset}%
11067 \DeclareUnicodeCharacter{2287}{\ensuremath\supseteq}%
11069 \DeclareUnicodeCharacter{2016}{\ensuremath\Vert}%
11070 \DeclareUnicodeCharacter{2032}{\ensuremath\prime}%
11071 \DeclareUnicodeCharacter{210F}{\ensuremath\hbar}%
11072 \DeclareUnicodeCharacter{2111}{\ensuremath\Im}%
11073 \DeclareUnicodeCharacter{2113}{\ensuremath\ell}%
11074 \DeclareUnicodeCharacter{2118}{\ensuremath\wp}%
11075 \DeclareUnicodeCharacter{211C}{\ensuremath\Re}%
11076 \DeclareUnicodeCharacter{2135}{\ensuremath\aleph}%
11077 \DeclareUnicodeCharacter{2190}{\ensuremath\leftarrow}%
11078 \DeclareUnicodeCharacter{2191}{\ensuremath\uparrow}%
11079 \DeclareUnicodeCharacter{2193}{\ensuremath\downarrow}%
11080 \DeclareUnicodeCharacter{2194}{\ensuremath\leftrightarrow}%
11081 \DeclareUnicodeCharacter{2195}{\ensuremath\updownarrow}%
11082 \DeclareUnicodeCharacter{2196}{\ensuremath\nwarrow}%
11083 \DeclareUnicodeCharacter{2197}{\ensuremath\nearrow}%
11084 \DeclareUnicodeCharacter{2198}{\ensuremath\searrow}%
11085 \DeclareUnicodeCharacter{2199}{\ensuremath\swarrow}%
11086 \DeclareUnicodeCharacter{21A6}{\ensuremath\mapsto}%
11087 \DeclareUnicodeCharacter{21A9}{\ensuremath\hookleftarrow}%
11088 \DeclareUnicodeCharacter{21AA}{\ensuremath\hookrightarrow}%
11089 \DeclareUnicodeCharacter{21BC}{\ensuremath\leftharpoonup}%
11090 \DeclareUnicodeCharacter{21BD}{\ensuremath\leftharpoondown}%
11091 \DeclareUnicodeCharacter{21C0}{\ensuremath\rightharpoonup}%
11092 \DeclareUnicodeCharacter{21C1}{\ensuremath\rightharpoondown}%
11093 \DeclareUnicodeCharacter{21CC}{\ensuremath\rightleftharpoons}%
11094 \DeclareUnicodeCharacter{21D0}{\ensuremath\Leftarrow}%
11095 \DeclareUnicodeCharacter{21D1}{\ensuremath\Uparrow}%
11096 \DeclareUnicodeCharacter{21D3}{\ensuremath\Downarrow}%
11097 \DeclareUnicodeCharacter{21D4}{\ensuremath\Leftrightarrow}%
11098 \DeclareUnicodeCharacter{21D5}{\ensuremath\Updownarrow}%
11099 \DeclareUnicodeCharacter{2202}{\ensuremath\partial}%
11100 \DeclareUnicodeCharacter{2205}{\ensuremath\emptyset}%
11101 \DeclareUnicodeCharacter{2207}{\ensuremath\nabla}%
11102 \DeclareUnicodeCharacter{2209}{\ensuremath\notin}%
11103 \DeclareUnicodeCharacter{220B}{\ensuremath\owns}%
11104 \DeclareUnicodeCharacter{220F}{\ensuremath\prod}%
11105 \DeclareUnicodeCharacter{2210}{\ensuremath\coprod}%
11106 \DeclareUnicodeCharacter{2211}{\ensuremath\sum}%
11107 \DeclareUnicodeCharacter{2213}{\ensuremath\mp}%
11108 \DeclareUnicodeCharacter{2218}{\ensuremath\circ}%
11109 \DeclareUnicodeCharacter{221A}{\ensuremath\surd}%
11110 \DeclareUnicodeCharacter{221D}{\ensuremath\propto}%
11111 \DeclareUnicodeCharacter{2220}{\ensuremath\angle}%
11112 \DeclareUnicodeCharacter{2223}{\ensuremath\mid}%
11113 \DeclareUnicodeCharacter{2228}{\ensuremath\vee}%
11114 \DeclareUnicodeCharacter{222A}{\ensuremath\cup}%
11115 \DeclareUnicodeCharacter{222B}{\ensuremath\smallint}%
11116 \DeclareUnicodeCharacter{222E}{\ensuremath\oint}%
11117 \DeclareUnicodeCharacter{223C}{\ensuremath\sim}%
11118 \DeclareUnicodeCharacter{2240}{\ensuremath\wr}%
11119 \DeclareUnicodeCharacter{2243}{\ensuremath\simeq}%
11120 \DeclareUnicodeCharacter{2245}{\ensuremath\cong}%
11121 \DeclareUnicodeCharacter{2248}{\ensuremath\approx}%
11122 \DeclareUnicodeCharacter{224D}{\ensuremath\asymp}%
11123 \DeclareUnicodeCharacter{2250}{\ensuremath\doteq}%
11124 \DeclareUnicodeCharacter{2260}{\ensuremath\neq}%
11125 \DeclareUnicodeCharacter{226A}{\ensuremath\ll}%
11126 \DeclareUnicodeCharacter{226B}{\ensuremath\gg}%
11127 \DeclareUnicodeCharacter{227A}{\ensuremath\prec}%
11128 \DeclareUnicodeCharacter{227B}{\ensuremath\succ}%
11129 \DeclareUnicodeCharacter{2283}{\ensuremath\supset}%
11130 \DeclareUnicodeCharacter{2286}{\ensuremath\subseteq}%
11131 \DeclareUnicodeCharacter{228E}{\ensuremath\uplus}%
11132 \DeclareUnicodeCharacter{2291}{\ensuremath\sqsubseteq}%
11133 \DeclareUnicodeCharacter{2292}{\ensuremath\sqsupseteq}%
11134 \DeclareUnicodeCharacter{2293}{\ensuremath\sqcap}%
11135 \DeclareUnicodeCharacter{2294}{\ensuremath\sqcup}%
11136 \DeclareUnicodeCharacter{2295}{\ensuremath\oplus}%
11137 \DeclareUnicodeCharacter{2296}{\ensuremath\ominus}%
11138 \DeclareUnicodeCharacter{2297}{\ensuremath\otimes}%
11139 \DeclareUnicodeCharacter{2298}{\ensuremath\oslash}%
11140 \DeclareUnicodeCharacter{2299}{\ensuremath\odot}%
11141 \DeclareUnicodeCharacter{22A2}{\ensuremath\vdash}%
11142 \DeclareUnicodeCharacter{22A3}{\ensuremath\dashv}%
11143 \DeclareUnicodeCharacter{22A4}{\ensuremath\ptextop}%
11144 \DeclareUnicodeCharacter{22A5}{\ensuremath\bot}%
11145 \DeclareUnicodeCharacter{22A8}{\ensuremath\models}%
11146 \DeclareUnicodeCharacter{22C0}{\ensuremath\bigwedge}%
11147 \DeclareUnicodeCharacter{22C1}{\ensuremath\bigvee}%
11148 \DeclareUnicodeCharacter{22C2}{\ensuremath\bigcap}%
11149 \DeclareUnicodeCharacter{22C3}{\ensuremath\bigcup}%
11150 \DeclareUnicodeCharacter{22C4}{\ensuremath\diamond}%
11151 \DeclareUnicodeCharacter{22C5}{\ensuremath\cdot}%
11152 \DeclareUnicodeCharacter{22C6}{\ensuremath\star}%
11153 \DeclareUnicodeCharacter{22C8}{\ensuremath\bowtie}%
11154 \DeclareUnicodeCharacter{2308}{\ensuremath\lceil}%
11155 \DeclareUnicodeCharacter{2309}{\ensuremath\rceil}%
11156 \DeclareUnicodeCharacter{230A}{\ensuremath\lfloor}%
11157 \DeclareUnicodeCharacter{230B}{\ensuremath\rfloor}%
11158 \DeclareUnicodeCharacter{2322}{\ensuremath\frown}%
11159 \DeclareUnicodeCharacter{2323}{\ensuremath\smile}%
11161 \DeclareUnicodeCharacter{25B3}{\ensuremath\triangle}%
11162 \DeclareUnicodeCharacter{25B7}{\ensuremath\triangleright}%
11163 \DeclareUnicodeCharacter{25BD}{\ensuremath\bigtriangledown}%
11164 \DeclareUnicodeCharacter{25C1}{\ensuremath\triangleleft}%
11165 \DeclareUnicodeCharacter{25C7}{\ensuremath\diamond}%
11166 \DeclareUnicodeCharacter{2660}{\ensuremath\spadesuit}%
11167 \DeclareUnicodeCharacter{2661}{\ensuremath\heartsuit}%
11168 \DeclareUnicodeCharacter{2662}{\ensuremath\diamondsuit}%
11169 \DeclareUnicodeCharacter{2663}{\ensuremath\clubsuit}%
11170 \DeclareUnicodeCharacter{266D}{\ensuremath\flat}%
11171 \DeclareUnicodeCharacter{266E}{\ensuremath\natural}%
11172 \DeclareUnicodeCharacter{266F}{\ensuremath\sharp}%
11173 \DeclareUnicodeCharacter{26AA}{\ensuremath\bigcirc}%
11174 \DeclareUnicodeCharacter{27B9}{\ensuremath\rangle}%
11175 \DeclareUnicodeCharacter{27C2}{\ensuremath\perp}%
11176 \DeclareUnicodeCharacter{27E8}{\ensuremath\langle}%
11177 \DeclareUnicodeCharacter{27F5}{\ensuremath\longleftarrow}%
11178 \DeclareUnicodeCharacter{27F6}{\ensuremath\longrightarrow}%
11179 \DeclareUnicodeCharacter{27F7}{\ensuremath\longleftrightarrow}%
11180 \DeclareUnicodeCharacter{27FC}{\ensuremath\longmapsto}%
11181 \DeclareUnicodeCharacter{29F5}{\ensuremath\setminus}%
11182 \DeclareUnicodeCharacter{2A00}{\ensuremath\bigodot}%
11183 \DeclareUnicodeCharacter{2A01}{\ensuremath\bigoplus}%
11184 \DeclareUnicodeCharacter{2A02}{\ensuremath\bigotimes}%
11185 \DeclareUnicodeCharacter{2A04}{\ensuremath\biguplus}%
11186 \DeclareUnicodeCharacter{2A06}{\ensuremath\bigsqcup}%
11187 \DeclareUnicodeCharacter{2A3F}{\ensuremath\amalg}%
11188 \DeclareUnicodeCharacter{2AAF}{\ensuremath\preceq}%
11189 \DeclareUnicodeCharacter{2AB0}{\ensuremath\succeq}%
11191 \global\mathchardef\checkmark="1370% actually the square root sign
11192 \DeclareUnicodeCharacter{2713}{\ensuremath\checkmark}%
11193 }% end of \unicodechardefs
11195 % UTF-8 byte sequence (pdfTeX) definitions (replacing and @U command)
11196 % It makes the setting that replace UTF-8 byte sequence.
11197 \def\utfeightchardefs{%
11198 \let\DeclareUnicodeCharacter\DeclareUnicodeCharacterUTFviii
11202 % Whether the active definitions of non-ASCII characters expand to
11203 % non-active tokens with the same character code. This is used to
11204 % write characters literally, instead of using active definitions for
11205 % printing the correct glyphs.
11206 \newif\ifpassthroughchars
11207 \passthroughcharsfalse
11209 % For native Unicode handling (XeTeX and LuaTeX),
11210 % provide a definition macro to replace/pass-through a Unicode character
11212 \def\DeclareUnicodeCharacterNative#1#2{%
11213 \ifnum"#1>"7F % only make non-ASCII chars active
11214 \catcode"#1=\active
11215 \def\dodeclareunicodecharacternative##1##2##3{%
11217 \uccode`\~="##2\relax
11218 \uppercase{\gdef~}{%
11219 \ifpassthroughchars
11228 \uccode`\.="#1\relax
11229 \uppercase{\def\UTFNativeTmp{.}}%
11230 \expandafter\dodeclareunicodecharacternative\UTFNativeTmp{#1}{#2}%
11235 % Native Unicode handling (XeTeX and LuaTeX) character replacing definition.
11236 % It activates the setting that replaces Unicode characters.
11237 \def\nativeunicodechardefs{%
11238 \let\DeclareUnicodeCharacter\DeclareUnicodeCharacterNative
11242 % For native Unicode handling (XeTeX and LuaTeX),
11243 % make the character token expand
11244 % to the sequences given in \unicodechardefs for printing.
11245 \def\DeclareUnicodeCharacterNativeAtU#1#2{%
11247 \expandafter\globallet\csname uni:#1\endcsname \UTFAtUTmp
11250 % @U command definitions for native Unicode handling (XeTeX and LuaTeX).
11251 \def\nativeunicodechardefsatu{%
11252 \let\DeclareUnicodeCharacter\DeclareUnicodeCharacterNativeAtU
11256 % US-ASCII character definitions.
11257 \def\asciichardefs{% nothing need be done
11261 % Define all Unicode characters we know about
11262 \iftxinativeunicodecapable
11263 \nativeunicodechardefsatu
11269 \message{formatting,}
11271 \newdimen\defaultparindent \defaultparindent = 15pt
11273 \chapheadingskip = 15pt plus 4pt minus 2pt
11274 \secheadingskip = 12pt plus 3pt minus 2pt
11275 \subsecheadingskip = 9pt plus 2pt minus 2pt
11277 % Prevent underfull vbox error messages.
11280 % Don't be very finicky about underfull hboxes, either.
11283 % Following George Bush, get rid of widows and orphans.
11284 \widowpenalty=10000
11287 % Use TeX 3.0's \emergencystretch to help line breaking, but if we're
11288 % using an old version of TeX, don't do anything. We want the amount of
11289 % stretch added to depend on the line length, hence the dependence on
11290 % \hsize. We call this whenever the paper size is set.
11292 \def\setemergencystretch{%
11293 \ifx\emergencystretch\thisisundefined
11294 % Allow us to assign to \emergencystretch anyway.
11295 \def\emergencystretch{\dimen0}%
11297 \emergencystretch = .15\hsize
11301 % Parameters in order: 1) textheight; 2) textwidth;
11302 % 3) voffset; 4) hoffset; 5) binding offset; 6) topskip;
11303 % 7) physical page height; 8) physical page width.
11305 % We also call \setleading{\textleading}, so the caller should define
11306 % \textleading. The caller should also set \parskip.
11308 \def\internalpagesizes#1#2#3#4#5#6#7#8{%
11309 \voffset = #3\relax
11310 \topskip = #6\relax
11311 \splittopskip = \topskip
11314 \advance\vsize by \topskip
11315 \txipageheight = \vsize
11318 \txipagewidth = \hsize
11320 \normaloffset = #4\relax
11321 \bindingoffset = #5\relax
11324 \pdfpageheight #7\relax
11325 \pdfpagewidth #8\relax
11326 % if we don't reset these, they will remain at "1 true in" of
11327 % whatever layout pdftex was dumped with.
11328 \pdfhorigin = 1 true in
11329 \pdfvorigin = 1 true in
11331 \ifx\XeTeXrevision\thisisundefined
11332 \special{papersize=#8,#7}%
11334 \pdfpageheight #7\relax
11335 \pdfpagewidth #8\relax
11336 % XeTeX does not have \pdfhorigin and \pdfvorigin.
11340 \setleading{\textleading}
11342 \parindent = \defaultparindent
11343 \setemergencystretch
11346 % @letterpaper (the default).
11347 \def\letterpaper{{\globaldefs = 1
11348 \parskip = 3pt plus 2pt minus 1pt
11349 \textleading = 13.2pt
11351 % If page is nothing but text, make it come out even.
11352 \internalpagesizes{607.2pt}{6in}% that's 46 lines
11354 {\bindingoffset}{36pt}%
11358 % Use @smallbook to reset parameters for 7x9.25 trim size.
11359 \def\smallbook{{\globaldefs = 1
11360 \parskip = 2pt plus 1pt
11361 \textleading = 12pt
11363 \internalpagesizes{7.5in}{5in}%
11365 {\bindingoffset}{16pt}%
11368 \lispnarrowing = 0.3in
11370 \contentsrightmargin = 0pt
11371 \defbodyindent = .5cm
11374 % Use @afourpaper to print on European A4 paper.
11375 \def\afourpaper{{\globaldefs = 1
11376 \parskip = 3pt plus 2pt minus 1pt
11377 \textleading = 13.2pt
11379 % Double-side printing via postscript on Laserjet 4050
11380 % prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm.
11381 % To change the settings for a different printer or situation, adjust
11382 % \normaloffset until the front-side and back-side texts align. Then
11383 % do the same for \bindingoffset. You can set these for testing in
11384 % your texinfo source file like this:
11386 % \global\normaloffset = -6mm
11387 % \global\bindingoffset = 10mm
11389 \internalpagesizes{673.2pt}{160mm}% that's 51 lines
11390 {\voffset}{\hoffset}%
11391 {\bindingoffset}{44pt}%
11395 \contentsrightmargin = 0pt
11396 \defbodyindent = 5mm
11399 % Use @afivepaper to print on European A5 paper.
11400 % From romildo@urano.iceb.ufop.br, 2 July 2000.
11401 % He also recommends making @example and @lisp be small.
11402 \def\afivepaper{{\globaldefs = 1
11403 \parskip = 2pt plus 1pt minus 0.1pt
11404 \textleading = 12.5pt
11406 \internalpagesizes{160mm}{120mm}%
11407 {\voffset}{-11.4mm}%
11408 {\bindingoffset}{8pt}%
11411 \lispnarrowing = 0.2in
11413 \contentsrightmargin = 0pt
11414 \defbodyindent = 2mm
11415 \tableindent = 12mm
11418 % A specific text layout, 24x15cm overall, intended for A4 paper.
11419 \def\afourlatex{{\globaldefs = 1
11421 \internalpagesizes{237mm}{150mm}%
11423 {\bindingoffset}{7mm}%
11426 % Must explicitly reset to 0 because we call \afourpaper.
11430 % Use @afourwide to print on A4 paper in landscape format.
11431 \def\afourwide{{\globaldefs = 1
11433 \internalpagesizes{241mm}{165mm}%
11434 {\voffset}{-2.95mm}%
11435 {\bindingoffset}{7mm}%
11440 \def\bsixpaper{{\globaldefs = 1
11442 \internalpagesizes{140mm}{100mm}%
11443 {-6.35mm}{-12.7mm}%
11444 {\bindingoffset}{14pt}%
11446 \let\SETdispenvsize=\smallword
11447 \lispnarrowing = 0.2in
11452 % @pagesizes TEXTHEIGHT[,TEXTWIDTH]
11453 % Perhaps we should allow setting the margins, \topskip, \parskip,
11454 % and/or leading, also. Or perhaps we should compute them somehow.
11456 \parseargdef\pagesizes{\pagesizesyyy #1,,\finish}
11457 \def\pagesizesyyy#1,#2,#3\finish{{%
11458 \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi
11461 \parskip = 3pt plus 2pt minus 1pt
11462 \setleading{\textleading}%
11465 \advance\dimen0 by 2.5in % default 1in margin above heading line
11466 % and 1.5in to include heading, footing and
11470 \advance\dimen2 by 2in % default to 1 inch margin on each side
11472 \internalpagesizes{#1}{\hsize}%
11473 {\voffset}{\normaloffset}%
11474 {\bindingoffset}{44pt}%
11475 {\dimen0}{\dimen2}%
11478 % Set default to letter.
11482 % Default value of \hfuzz, for suppressing warnings about overfull hboxes.
11486 \message{microtype,}
11488 % protrusion, from Thanh's protcode.tex.
11489 \def\mtsetprotcode#1{%
11490 \rpcode#1`\!=200 \rpcode#1`\,=700 \rpcode#1`\-=700 \rpcode#1`\.=700
11491 \rpcode#1`\;=500 \rpcode#1`\:=500 \rpcode#1`\?=200
11493 \rpcode#1 34=500 % ''
11494 \rpcode#1 123=300 % --
11495 \rpcode#1 124=200 % ---
11496 \rpcode#1`\)=50 \rpcode#1`\A=50 \rpcode#1`\F=50 \rpcode#1`\K=50
11497 \rpcode#1`\L=50 \rpcode#1`\T=50 \rpcode#1`\V=50 \rpcode#1`\W=50
11498 \rpcode#1`\X=50 \rpcode#1`\Y=50 \rpcode#1`\k=50 \rpcode#1`\r=50
11499 \rpcode#1`\t=50 \rpcode#1`\v=50 \rpcode#1`\w=50 \rpcode#1`\x=50
11503 \lpcode#1 92=500 % ``
11504 \lpcode#1`\(=50 \lpcode#1`\A=50 \lpcode#1`\J=50 \lpcode#1`\T=50
11505 \lpcode#1`\V=50 \lpcode#1`\W=50 \lpcode#1`\X=50 \lpcode#1`\Y=50
11506 \lpcode#1`\v=50 \lpcode#1`\w=50 \lpcode#1`\x=50 \lpcode#1`\y=0
11508 \mtadjustprotcode#1\relax
11512 \def\mtadjustprotcode#1{%
11515 \ifcase\lpcode#1\countC\else
11516 \mtadjustcp\lpcode#1\countC
11518 \ifcase\rpcode#1\countC\else
11519 \mtadjustcp\rpcode#1\countC
11522 \ifnum\countC < 256 \repeat
11526 \def\mtadjustcp#1#2#3{%
11527 \setbox\boxA=\hbox{%
11528 \ifx#2\font\else#2\fi
11531 \multiply\countB #1#2#3\relax
11532 \divide\countB \fontdimen6 #2\relax
11533 #1#2#3=\countB\relax
11536 \ifx\XeTeXrevision\thisisundefined
11537 \ifx\luatexversion\thisisundefined
11539 \mtsetprotcode\textrm
11540 \def\mtfontexpand#1{\pdffontexpand#1 20 20 1 autoexpand\relax}
11542 \def\mtfontexpand#1{}
11545 \mtsetprotcode\textrm
11546 \def\mtfontexpand#1{\expandglyphsinfont#1 20 20 1\relax}
11549 \mtsetprotcode\textrm
11550 \def\mtfontexpand#1{}
11559 \ifx\XeTeXrevision\thisisundefined
11560 \ifx\luatexversion\thisisundefined
11562 \pdfadjustspacing=2
11563 \pdfprotrudechars=2
11570 \XeTeXprotrudechars=2
11573 \mtfontexpand\textrm
11574 \mtfontexpand\textsl
11575 \mtfontexpand\textbf
11578 \def\microtypeOFF{%
11581 \ifx\XeTeXrevision\thisisundefined
11582 \ifx\luatexversion\thisisundefined
11584 \pdfadjustspacing=0
11585 \pdfprotrudechars=0
11592 \XeTeXprotrudechars=0
11598 \parseargdef\microtype{%
11602 \else\ifx\txiarg\offword
11605 \errhelp = \EMsimple
11606 \errmessage{Unknown @microtype option `\txiarg', must be on|off}%
11611 \message{and turning on texinfo input format.}
11613 % Make UTF-8 the default encoding.
11614 \documentencodingzzz{UTF-8}
11616 \def^^L{\par} % remove \outer, so ^L can appear in an @comment
11617 \catcode`\^^K = 10 % treat vertical tab as whitespace
11619 % DEL is a comment character, in case @c does not suffice.
11622 % Define macros to output various characters with catcode for normal text.
11623 \catcode`\"=\other \def\normaldoublequote{"}
11624 \catcode`\$=\other \def\normaldollar{$}%$ font-lock fix
11625 \catcode`\+=\other \def\normalplus{+}
11626 \catcode`\<=\other \def\normalless{<}
11627 \catcode`\>=\other \def\normalgreater{>}
11628 \catcode`\^=\other \def\normalcaret{^}
11629 \catcode`\_=\other \def\normalunderscore{_}
11630 \catcode`\|=\other \def\normalverticalbar{|}
11631 \catcode`\~=\other \def\normaltilde{~}
11633 % Set catcodes for Texinfo file
11635 % Active characters for printing the wanted glyph.
11636 % Most of these we simply print from the \tt font, but for some, we can
11637 % use math or other variants that look better in normal text.
11639 \catcode`\"=\active
11640 \def\activedoublequote{{\tt\char34}}
11641 \let"=\activedoublequote
11642 \catcode`\~=\active \def\activetilde{{\tt\char126}} \let~ = \activetilde
11643 \chardef\hatchar=`\^
11644 \catcode`\^=\active \def\activehat{{\tt \hatchar}} \let^ = \activehat
11646 \catcode`\_=\active
11647 \def_{\ifusingtt\normalunderscore\_}
11648 \def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em }
11651 \catcode`\|=\active \def|{{\tt\char124}}
11654 \catcode`\<=\active \def\activeless{{\tt \less}}\let< = \activeless
11656 \catcode`\>=\active \def\activegtr{{\tt \gtr}}\let> = \activegtr
11657 \catcode`\+=\active \def+{{\tt \char 43}}
11658 \catcode`\$=\active \def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix
11659 \catcode`\-=\active \let-=\normaldash
11662 % used for headline/footline in the output routine, in case the page
11663 % breaks in the middle of an @tex block.
11664 \def\texinfochars{%
11665 \let< = \activeless
11667 \let~ = \activetilde
11671 \let\i = \smartitalic
11672 % in principle, all other definitions in \tex have to be undone too.
11675 % Used sometimes to turn off (effectively) the active characters even after
11677 \def\turnoffactive{%
11678 \passthroughcharstrue
11680 \let"=\normaldoublequote
11681 \let$=\normaldollar %$ font-lock fix
11684 \let>=\normalgreater
11686 \let_=\normalunderscore
11687 \let|=\normalverticalbar
11694 % If a .fmt file is being used, characters that might appear in a file
11695 % name cannot be active until we have parsed the command line.
11696 % So turn them off again, and have \loadconf turn them back on.
11697 \catcode`+=\other \catcode`\_=\other
11700 % \backslashcurfont outputs one backslash character in current font,
11702 \global\chardef\backslashcurfont=`\\
11704 % Print a typewriter backslash. For math mode, we can't simply use
11705 % \backslashcurfont: the story here is that in math mode, the \char
11706 % of \backslashcurfont ends up printing the roman \ from the math symbol
11707 % font (because \char in math mode uses the \mathcode, and plain.tex
11708 % sets \mathcode`\\="026E). Hence we use an explicit \mathchar,
11709 % which is the decimal equivalent of "715c (class 7, e.g., use \fam;
11710 % ignored family value; char position "5C). We can't use " for the
11711 % usual hex value because it has already been made active.
11713 \def\ttbackslash{{\tt \ifmmode \mathchar29020 \else \backslashcurfont \fi}}
11714 \let\backslashchar = \ttbackslash % \backslashchar{} is for user documents.
11716 % These are made active for url-breaking, so need
11717 % active definitions as the normal characters.
11719 \def\normalquest{?}
11720 \def\normalslash{/}
11722 % \newlinesloadsconf - call \loadconf as soon as possible in the
11723 % file, e.g. at the first newline.
11727 \gdef\newlineloadsconf{%
11729 \newlineloadsconfzz%
11731 \gdef\newlineloadsconfzz#1^^M{%
11732 \def\c{\loadconf\c}%
11733 % Definition for the first newline read in the file
11734 \def ^^M{\loadconf}%
11735 % In case the first line has a whole-line command on it
11736 \let\originalparsearg\parsearg%
11737 \def\parsearg{\loadconf\originalparsearg}%
11741 % Emergency active definition of newline, in case an active newline token
11742 % appears by mistake.
11743 {\catcode`\^=7 \catcode13=13%
11744 \gdef\enableemergencynewline{%
11747 %<warning: active newline>\par%
11751 % \loadconf gets called at the beginning of every Texinfo file.
11752 % If texinfo.cnf is present on the system, read it. Useful for site-wide
11753 % @afourpaper, etc. Not opening texinfo.cnf directly in texinfo.tex
11754 % makes it possible to make a format file for Texinfo.
11757 \relax % Terminate the filename if running as "tex '&texinfo' FILE.texi".
11759 % Turn off the definitions that trigger \loadconf
11761 \catcode13=5 % regular end of line
11762 \enableemergencynewline
11764 \let\parsearg\originalparsearg
11766 % Also turn back on active characters that might appear in the input
11767 % file name, in case not using a pre-dumped format.
11769 \catcode`\_=\active
11771 \openin 1 texinfo.cnf
11772 \ifeof 1 \else \input texinfo.cnf \fi
11776 % Redefine some control sequences to be controlled by the \ifdummies
11777 % and \ifindexnofonts switches. Do this at the end so that the control
11778 % sequences are all defined.
11786 % \realbackslash is an actual character `\' with catcode other.
11787 {\catcode`\\=\other @gdef@realbackslash{\}}
11789 % In Texinfo, backslash is an active character; it prints the backslash
11790 % in fixed width font.
11791 \catcode`\\=\active % @ for escape char from now on.
11793 @let\ = @ttbackslash
11795 % If in a .fmt file, print the version number.
11796 % \eatinput stops the `\input texinfo' from showing up.
11797 % After that, `\' should revert to printing a backslash.
11798 % Turn on active characters that we couldn't do earlier because
11799 % they might have appeared in the input file name.
11801 @everyjob{@message{[Texinfo version @texinfoversion]}%
11802 @global@let\ = @eatinput
11803 @catcode`+=@active @catcode`@_=@active}
11805 {@catcode`@^=7 @catcode`@^^M=13%
11806 @gdef@eatinput input texinfo#1^^M{@loadconf}}
11808 @def@everyjobreset{@ifx\@eatinput @let\ = @ttbackslash @fi}
11810 % \otherbackslash defines an active \ to be a literal `\' character with
11812 @gdef@otherbackslash{@let\=@realbackslash}
11814 % Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
11815 % the literal character `\'.
11817 {@catcode`- = @active
11818 @gdef@normalturnoffactive{%
11824 % Say @foo, not \foo, in error messages.
11827 % These look ok in all fonts, so just make them not special.
11828 % @hashchar{} gets its own user-level command, because of #line.
11829 @catcode`@& = @other @def@normalamp{&}
11830 @catcode`@# = @other @def@normalhash{#}
11831 @catcode`@% = @other @def@normalpercent{%}
11833 @let @hashchar = @normalhash
11835 @c Finally, make ` and ' active, so that txicodequoteundirected and
11836 @c txicodequotebacktick work right in, e.g., @w{@code{`foo'}}. If we
11837 @c don't make ` and ' active, @code will not get them as active chars.
11838 @c Do this last of all since we use ` in the previous @catcode assignments.
11839 @catcode`@'=@active
11840 @catcode`@`=@active
11842 @c Local variables:
11843 @c eval: (add-hook 'before-save-hook 'time-stamp nil t)
11844 @c time-stamp-pattern: "texinfoversion{%Y-%02m-%02d.%02H}"
11845 @c page-delimiter: "^\\\\message"