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{2022-04-09.08}
8 % Copyright 1985, 1986, 1988, 1990-2022 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 % If in a .fmt file, print the version number
62 % and turn on active characters that we couldn't do earlier because
63 % they might have appeared in the input file name.
64 \everyjob{\message{[Texinfo version \texinfoversion]}%
65 \catcode`+=\active \catcode`\_=\active}
67 % LaTeX's \typeout. This ensures that the messages it is used for
68 % are identical in format to the corresponding ones from latex/pdflatex.
69 \def\typeout{\immediate\write17}%
73 % We never want plain's \outer definition of \+ in Texinfo.
74 % For @tex, we can use \tabalign.
77 % Save some plain tex macros whose names we will redefine.
79 \let\ptexbullet=\bullet
87 \let\ptexfootnote=\footnote
91 \let\ptexindent=\indent
92 \let\ptexinsert=\insert
95 \let\ptexnewwrite\newwrite
96 \let\ptexnoindent=\noindent
98 \let\ptexraggedright=\raggedright
106 {\catcode`\'=\active \global\let\ptexquoteright'}% active in plain's math mode
108 % If this character appears in an error message or help string, it
109 % starts a new line in the output.
112 % Use TeX 3.0's \inputlineno to get the line number, for better error
113 % messages, but if we're using an old version of TeX, don't do anything.
115 \ifx\inputlineno\thisisundefined
116 \let\linenumber = \empty % Pre-3.0.
118 \def\linenumber{l.\the\inputlineno:\space}
121 % Set up fixed words for English if not already set.
122 \ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi
123 \ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi
124 \ifx\putworderror\undefined \gdef\putworderror{error}\fi
125 \ifx\putwordfile\undefined \gdef\putwordfile{file}\fi
126 \ifx\putwordin\undefined \gdef\putwordin{in}\fi
127 \ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi
128 \ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi
129 \ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi
130 \ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi
131 \ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi
132 \ifx\putwordNoTitle\undefined \gdef\putwordNoTitle{No Title}\fi
133 \ifx\putwordof\undefined \gdef\putwordof{of}\fi
134 \ifx\putwordon\undefined \gdef\putwordon{on}\fi
135 \ifx\putwordpage\undefined \gdef\putwordpage{page}\fi
136 \ifx\putwordsection\undefined \gdef\putwordsection{section}\fi
137 \ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi
138 \ifx\putwordsee\undefined \gdef\putwordsee{see}\fi
139 \ifx\putwordSee\undefined \gdef\putwordSee{See}\fi
140 \ifx\putwordShortTOC\undefined \gdef\putwordShortTOC{Short Contents}\fi
141 \ifx\putwordTOC\undefined \gdef\putwordTOC{Table of Contents}\fi
143 \ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi
144 \ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi
145 \ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi
146 \ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi
147 \ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi
148 \ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi
149 \ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi
150 \ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi
151 \ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi
152 \ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi
153 \ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi
154 \ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi
156 \ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro}\fi
157 \ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi
158 \ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi
159 \ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi
160 \ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi
162 % Give the space character the catcode for a space.
163 \def\spaceisspace{\catcode`\ =10\relax}
165 % Likewise for ^^M, the end of line character.
166 \def\endlineisspace{\catcode13=10\relax}
168 \chardef\dashChar = `\-
169 \chardef\slashChar = `\/
170 \chardef\underChar = `\_
176 % The following is used inside several \edef's.
177 \def\makecsname#1{\expandafter\noexpand\csname#1\endcsname}
181 Flor-i-da Ghost-script Ghost-view Mac-OS Post-Script
182 ap-pen-dix bit-map bit-maps
183 data-base data-bases eshell fall-ing half-way long-est man-u-script
184 man-u-scripts mini-buf-fer mini-buf-fers over-view par-a-digm
185 par-a-digms rath-er rec-tan-gu-lar ro-bot-ics se-vere-ly set-up spa-ces
187 stand-alone strong-est time-stamp time-stamps which-ever white-space
188 wide-spread wrap-around
191 % Sometimes it is convenient to have everything in the transcript file
192 % and nothing on the terminal. We don't just call \tracingall here,
193 % since that produces some useless output on the terminal. We also make
194 % some effort to order the tracing commands to reduce output in the log
195 % file; cf. trace.sty in LaTeX.
197 \def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%
201 \tracinglostchars2 % 2 gives us more in etex
206 \showboxbreadth\maxdimen \showboxdepth\maxdimen
207 \ifx\eTeXversion\thisisundefined\else % etex gives us more logging
214 \tracingcommands3 % 3 gives us more in etex
218 % @errormsg{MSG}. Do the index-like expansions on MSG, but if things
219 % aren't perfect, it's not the end of the world, being an error message,
222 \def\errormsg{\begingroup \indexnofonts \doerrormsg}
223 \def\doerrormsg#1{\errmessage{#1}}
225 % add check for \lastpenalty to plain's definitions. If the last thing
226 % we did was a \nobreak, we don't want to insert more space.
228 \def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount
229 \removelastskip\penalty-50\smallskip\fi\fi}
230 \def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount
231 \removelastskip\penalty-100\medskip\fi\fi}
232 \def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount
233 \removelastskip\penalty-200\bigskip\fi\fi}
238 % For a final copy, take out the rectangles
239 % that mark overfull boxes (in case you have decided
240 % that the text looks ok even though it passes the margin).
242 \def\finalout{\overfullrule=0pt }
244 \newdimen\outerhsize \newdimen\outervsize % set by the paper size routines
245 \newdimen\topandbottommargin \topandbottommargin=.75in
247 % Output a mark which sets \thischapter, \thissection and \thiscolor.
248 % We dump everything together because we only have one kind of mark.
249 % This works because we only use \botmark / \topmark, not \firstmark.
251 % A mark contains a subexpression of the \ifcase ... \fi construct.
252 % \get*marks macros below extract the needed part using \ifcase.
254 % Another complication is to let the user choose whether \thischapter
255 % (\thissection) refers to the chapter (section) in effect at the top
256 % of a page, or that at the bottom of a page.
258 % \domark is called twice inside \chapmacro, to add one
259 % mark before the section break, and one after.
260 % In the second call \prevchapterdefs is the same as \currentchapterdefs,
261 % and \prevsectiondefs is the same as \currentsectiondefs.
262 % Then if the page is not broken at the mark, some of the previous
263 % section appears on the page, and we can get the name of this section
264 % from \firstmark for @everyheadingmarks top.
265 % @everyheadingmarks bottom uses \botmark.
267 % See page 260 of The TeXbook.
269 \toks0=\expandafter{\currentchapterdefs}%
270 \toks2=\expandafter{\currentsectiondefs}%
271 \toks4=\expandafter{\prevchapterdefs}%
272 \toks6=\expandafter{\prevsectiondefs}%
273 \toks8=\expandafter{\currentcolordefs}%
275 \the\toks0 \the\toks2 % 0: marks for @everyheadingmarks top
276 \noexpand\or \the\toks4 \the\toks6 % 1: for @everyheadingmarks bottom
277 \noexpand\else \the\toks8 % 2: color marks
281 % \gettopheadingmarks, \getbottomheadingmarks,
282 % \getcolormarks - extract needed part of mark.
284 % \topmark doesn't work for the very first chapter (after the title
285 % page or the contents), so we use \firstmark there -- this gets us
286 % the mark with the chapter defs, unless the user sneaks in, e.g.,
287 % @setcolor (or @url, or @link, etc.) between @contents and the very
289 \def\gettopheadingmarks{%
290 \ifcase0\the\savedtopmark\fi
291 \ifx\thischapter\empty \ifcase0\firstmark\fi \fi
293 \def\getbottomheadingmarks{\ifcase1\botmark\fi}
294 \def\getcolormarks{\ifcase2\the\savedtopmark\fi}
296 % Avoid "undefined control sequence" errors.
297 \def\currentchapterdefs{}
298 \def\currentsectiondefs{}
299 \def\currentsection{}
300 \def\prevchapterdefs{}
301 \def\prevsectiondefs{}
302 \def\currentcolordefs{}
304 % Margin to add to right of even pages, to left of odd pages.
305 \newdimen\bindingoffset
306 \newdimen\normaloffset
307 \newdimen\txipagewidth \newdimen\txipageheight
309 % Main output routine.
312 \newtoks\defaultoutput
313 \defaultoutput = {\savetopmark\onepageout{\pagecontents\PAGE}}
314 \output=\expandafter{\the\defaultoutput}
319 % When outputting the double column layout for indices, an output routine
320 % is run several times, which hides the original value of \topmark. This
321 % can lead to a page heading being output and duplicating the chapter heading
322 % of the index. Hence, save the contents of \topmark at the beginning of
323 % the output routine. The saved contents are valid until we actually
326 % (We used to run a short output routine to actually set \topmark and
327 % \firstmark to the right values, but if this was called with an empty page
328 % containing whatsits for writing index entries, the whatsits would be thrown
329 % away and the index auxiliary file would remain empty.)
331 \newtoks\savedtopmark
332 \newif\iftopmarksaved
336 \global\savedtopmark=\expandafter{\topmark}%
337 \global\topmarksavedtrue
341 % \onepageout takes a vbox as an argument.
342 % \shipout a vbox for a single page, adding an optional header, footer
343 % and footnote. This also causes index entries for this page to be written
344 % to the auxiliary files.
347 \hoffset=\normaloffset
349 \ifodd\pageno \advance\hoffset by \bindingoffset
350 \else \advance\hoffset by -\bindingoffset\fi
354 % Retrieve the information for the headings from the marks in the page,
355 % and call Plain TeX's \makeheadline and \makefootline, which use the
356 % values in \headline and \footline.
358 % Common context changes for both heading and footing.
359 % Do this outside of the \shipout so @code etc. will be expanded in
360 % the headline as they should be, not taken literally (outputting ''code).
361 \def\commonheadfootline{\let\hsize=\txipagewidth \texinfochars}
363 \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi
364 \global\setbox\headlinebox = \vbox{\commonheadfootline \makeheadline}%
365 \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi
366 \global\setbox\footlinebox = \vbox{\commonheadfootline \makefootline}%
369 % Set context for writing to auxiliary files like index files.
370 % Have to do this stuff outside the \shipout because we want it to
371 % take effect in \write's, yet the group defined by the \vbox ends
372 % before the \shipout runs.
374 \atdummies % don't expand commands in the output.
377 % Do this early so pdf references go to the beginning of the page.
378 \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi
382 \ifdim\ht\footlinebox > 0pt
383 % Only leave this space if the footline is nonempty.
384 % (We lessened \vsize for it in \oddfootingyyy.)
385 % The \baselineskip=24pt in plain's \makefootline has no effect.
392 \global\topmarksavedfalse
394 \ifnum\outputpenalty>-20000 \else\dosupereject\fi
397 \newinsert\margin \dimen\margin=\maxdimen
399 % Main part of page, including any footnotes
400 \def\pagebody#1{\vbox to\txipageheight{\boxmaxdepth=\maxdepth #1}}
402 \gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
403 % marginal hacks, juha@viisa.uucp (Juha Takala)
404 \ifvoid\margin\else % marginal info is present
405 \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi
406 \dimen@=\dp#1\relax \unvbox#1\relax
407 \ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
408 \ifr@ggedbottom \kern-\dimen@ \vfil \fi}
411 % Check if we are on the first page of a chapter. Used for printing headings.
413 \def\checkchapterpage{%
414 % Get the chapter that was current at the end of the last page
415 \ifcase1\the\savedtopmark\fi
416 \let\prevchaptername\thischaptername
418 \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi
419 \let\curchaptername\thischaptername
421 \ifx\curchaptername\prevchaptername
430 % Parse an argument, then pass it to #1. The argument is the rest of
431 % the input line (except we remove a trailing comment). #1 should be a
432 % macro which expects an ordinary undelimited TeX argument.
433 % For example, \def\foo{\parsearg\fooxxx}.
435 \def\parsearg{\parseargusing{}}
436 \def\parseargusing#1#2{%
442 \parseargline\empty% Insert the \empty token, see \finishparsearg below.
446 \gdef\parseargline#1^^M{%
447 \endgroup % End of the group started in \parsearg.
448 \argremovecomment #1\comment\ArgTerm%
452 % First remove any @comment, then any @c comment. Pass the result on to
454 \def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm}
455 \def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm}
457 % Each occurrence of `\^^M' or `<space>\^^M' is replaced by a single space.
459 % \argremovec might leave us with trailing space, e.g.,
460 % @end itemize @c foo
461 % This space token undergoes the same procedure and is eventually removed
462 % by \finishparsearg.
464 \def\argcheckspaces#1\^^M{\argcheckspacesX#1\^^M \^^M}
465 \def\argcheckspacesX#1 \^^M{\argcheckspacesY#1\^^M}
466 \def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{%
469 % Do not use \next, perhaps the caller of \parsearg uses it; reuse \temp:
470 \let\temp\finishparsearg
472 \let\temp\argcheckspaces
474 % Put the space token in:
478 % If a _delimited_ argument is enclosed in braces, they get stripped; so
479 % to get _exactly_ the rest of the line, we had to prevent such situation.
480 % We prepended an \empty token at the very beginning and we expand it now,
481 % just before passing the control to \argtorun.
482 % (Similarly, we have to think about #3 of \argcheckspacesY above: it is
483 % either the null string, or it ends with \^^M---thus there is no danger
484 % that a pair of braces would be stripped.
486 % But first, we have to remove the trailing space token.
488 \def\finishparsearg#1 \ArgTerm{\expandafter\argtorun\expandafter{#1}}
491 % \parseargdef - define a command taking an argument on the line
493 % \parseargdef\foo{...}
494 % is roughly equivalent to
495 % \def\foo{\parsearg\Xfoo}
498 \expandafter \doparseargdef \csname\string#1\endcsname #1%
500 \def\doparseargdef#1#2{%
505 % Several utility definitions with active space:
510 % Make each space character in the input produce a normal interword
511 % space in the output. Don't allow a line break at this space, as this
512 % is used only in environments like @example, where each line of input
513 % should produce a line of output anyway.
515 \gdef\sepspaces{\obeyspaces\let =\tie}
517 % If an index command is used in an @example environment, any spaces
518 % therein should become regular spaces in the raw index file, not the
519 % expansion of \tie (\leavevmode \penalty \@M \ ).
520 \gdef\unsepspaces{\let =\space}
524 \def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}
526 % Define the framework for environments in texinfo.tex. It's used like this:
531 % It's the responsibility of \envdef to insert \begingroup before the
532 % actual body; @end closes the group after calling \Efoo. \envdef also
533 % defines \thisenv, so the current environment is known; @end checks
534 % whether the environment name matches. The \checkenv macro can also be
535 % used to check whether the current environment is the one expected.
537 % Non-false conditionals (@iftex, @ifset) don't fit into this, so they
538 % are not treated as environments; they don't open a group. (The
539 % implementation of @end takes care not to call \endgroup in this
543 % At run-time, environments start with this:
544 \def\startenvironment#1{\begingroup\def\thisenv{#1}}
548 % ... but they get defined via ``\envdef\foo{...}'':
549 \long\def\envdef#1#2{\def#1{\startenvironment#1#2}}
550 \def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}}
552 % Check whether we're in the right environment:
561 % Environment mismatch, #1 expected:
564 \errmessage{This command can appear only \inenvironment\temp,
565 not \inenvironment\thisenv}%
567 \def\inenvironment#1{%
569 outside of any environment%
571 in environment \expandafter\string#1%
576 % @end foo calls \checkenv and executes the definition of \Efoo.
578 \if 1\csname iscond.#1\endcsname
580 % The general wording of \badenverr may not be ideal.
581 \expandafter\checkenv\csname#1\endcsname
582 \csname E#1\endcsname
587 \newhelp\EMsimple{Press RETURN to continue.}
590 % Be sure we're in horizontal mode when doing a tie, since we make space
591 % equivalent to this in @example-like environments. Otherwise, a space
592 % at the beginning of a line will start with \penalty -- and
593 % since \penalty is valid in vertical mode, we'd end up putting the
594 % penalty on the vertical list instead of in the new paragraph.
596 % Avoid using \@M directly, because that causes trouble
597 % if the definition is written into an index file.
598 \global\let\tiepenalty = \@M
599 \gdef\tie{\leavevmode\penalty\tiepenalty\ }
602 % @: forces normal size whitespace following.
603 \def\:{\spacefactor=1000 }
605 % @* forces a line break.
606 \def\*{\unskip\hfil\break\hbox{}\ignorespaces}
608 % @/ allows a line break.
611 % @. is an end-of-sentence period.
612 \def\.{.\spacefactor=\endofsentencespacefactor\space}
614 % @! is an end-of-sentence bang.
615 \def\!{!\spacefactor=\endofsentencespacefactor\space}
617 % @? is an end-of-sentence query.
618 \def\?{?\spacefactor=\endofsentencespacefactor\space}
620 % @frenchspacing on|off says whether to put extra space after punctuation.
625 \parseargdef\frenchspacing{%
627 \ifx\temp\onword \plainfrenchspacing
628 \else\ifx\temp\offword \plainnonfrenchspacing
631 \errmessage{Unknown @frenchspacing option `\temp', must be on|off}%
635 % @w prevents a word break. Without the \leavevmode, @w at the
636 % beginning of a paragraph, when TeX is still in vertical mode, would
637 % produce a whole line of output instead of starting the paragraph.
638 \def\w#1{\leavevmode\hbox{#1}}
640 % @group ... @end group forces ... to be all on one page, by enclosing
641 % it in a TeX vbox. We use \vtop instead of \vbox to construct the box
642 % to keep its height that of a normal line. According to the rules for
643 % \topskip (p.114 of the TeXbook), the glue inserted is
644 % max (\topskip - \ht (first item), 0). If that height is large,
645 % therefore, no glue is inserted, and the space between the headline and
646 % the text is small, which looks bad.
648 % Another complication is that the group might be very large. This can
649 % cause the glue on the previous page to be unduly stretched, because it
650 % does not have much material. In this case, it's better to add an
651 % explicit \vfill so that the extra space is at the bottom. The
652 % threshold for doing this is if the group is more than \vfilllimit
653 % percent of a page (\vfilllimit can be changed inside of @tex).
659 \ifnum\catcode`\^^M=\active \else
660 \errhelp = \groupinvalidhelp
661 \errmessage{@group invalid in context where filling is enabled}%
665 \setbox\groupbox = \vtop\bgroup
666 % Do @comment since we are called inside an environment such as
667 % @example, where each end-of-line in the input causes an
668 % end-of-line in the output. We don't want the end-of-line after
669 % the `@group' to put extra space in the output. Since @group
670 % should appear on a line by itself (according to the Texinfo
671 % manual), we don't worry about eating any user text.
675 % The \vtop produces a box with normal height and large depth; thus, TeX puts
676 % \baselineskip glue before it, and (when the next line of text is done)
677 % \lineskip glue after it. Thus, space below is not quite equal to space
678 % above. But it's pretty close.
680 % To get correct interline space between the last line of the group
681 % and the first line afterwards, we have to propagate \prevdepth.
682 \endgraf % Not \par, as it may have been set to \lisppar.
683 \global\dimen1 = \prevdepth
684 \egroup % End the \vtop.
691 % \dimen0 is the vertical size of the group's box.
692 \dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox
693 % \dimen2 is how much space is left on the page (more or less).
694 \dimen2 = \txipageheight \advance\dimen2 by -\pagetotal
695 % if the group doesn't fit on the current page, and it's a big big
696 % group, force a page break.
697 \ifdim \dimen0 > \dimen2
698 \ifdim \pagetotal < \vfilllimit\txipageheight
706 % TeX puts in an \escapechar (i.e., `@') at the beginning of the help
707 % message, so this ends up printing `@group can only ...'.
709 \newhelp\groupinvalidhelp{%
710 group can only be used in environments such as @example,^^J%
711 where each line of input produces a line of output.}
713 % @need space-in-mils
714 % forces a page break if there is not space-in-mils remaining.
716 \newdimen\mil \mil=0.001in
719 % Ensure vertical mode, so we don't make a big box in the middle of a
723 % If the @need value is less than one line space, it's useless.
725 \dimen2 = \ht\strutbox
726 \advance\dimen2 by \dp\strutbox
727 \ifdim\dimen0 > \dimen2
729 % Do a \strut just to make the height of this box be normal, so the
730 % normal leading is inserted relative to the preceding line.
731 % And a page break here is fine.
732 \vtop to #1\mil{\strut\vfil}%
734 % TeX does not even consider page breaks if a penalty added to the
735 % main vertical list is 10000 or more. But in order to see if the
736 % empty box we just added fits on the page, we must make it consider
737 % page breaks. On the other hand, we don't want to actually break the
738 % page after the empty box. So we use a penalty of 9999.
740 % There is an extremely small chance that TeX will actually break the
741 % page at this \penalty, if there are no other feasible breakpoints in
742 % sight. (If the user is using lots of big @group commands, which
743 % almost-but-not-quite fill up a page, TeX will have a hard time doing
744 % good page breaking, for example.) However, I could not construct an
745 % example where a page broke at this \penalty; if it happens in a real
746 % document, then we can reconsider our strategy.
749 % Back up by the size of the box, whether we did a page break or not.
752 % Do not allow a page break right after this kern.
757 % @br forces paragraph break (and is undocumented).
761 % @page forces the start of a new page.
763 \def\page{\par\vfill\supereject}
766 % outputs text on separate line in roman font, starting at standard page margin
768 % This records the amount of indent in the innermost environment.
769 % That's how much \exdent should take out.
770 \newskip\exdentamount
772 % This defn is used inside fill environments such as @defun.
773 \parseargdef\exdent{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}
775 % This defn is used inside nofill environments such as @example.
776 \parseargdef\nofillexdent{{\advance \leftskip by -\exdentamount
777 \leftline{\hskip\leftskip{\rm#1}}}}
779 % @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current
780 % paragraph. For more general purposes, use the \margin insertion
781 % class. WHICH is `l' or `r'. Not documented, written for gawk manual.
783 \newskip\inmarginspacing \inmarginspacing=1cm
784 \def\strutdepth{\dp\strutbox}
786 \def\doinmargin#1#2{\strut\vadjust{%
789 \vtop to \strutdepth{%
790 \baselineskip=\strutdepth
792 % if you have multiple lines of stuff to put here, you'll need to
793 % make the vbox yourself of the appropriate size.
795 \llap{\ignorespaces #2\hskip\inmarginspacing}%
797 \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}%
802 \def\inleftmargin{\doinmargin l}
803 \def\inrightmargin{\doinmargin r}
805 % @inmargin{TEXT [, RIGHT-TEXT]}
806 % (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right;
807 % else use TEXT for both).
809 \def\inmargin#1{\parseinmargin #1,,\finish}
810 \def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing.
811 \setbox0 = \hbox{\ignorespaces #2}%
813 \def\lefttext{#1}% have both texts
816 \def\lefttext{#1}% have only one text
821 \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin
823 \def\temp{\inleftmargin\lefttext}%
828 % @include FILE -- \input text of FILE.
830 \def\include{\parseargusing\filenamecatcodes\includezzz}
835 \makevalueexpandable % we want to expand any @value in FILE.
836 \turnoffactive % and allow special characters in the expansion
837 \indexnofonts % Allow `@@' and other weird things in file names.
838 \wlog{texinfo.tex: doing @include of #1^^J}%
839 \edef\temp{\noexpand\input #1 }%
841 % This trickery is to read FILE outside of a group, in case it makes
847 \def\filenamecatcodes{%
861 \def\pushthisfilestack{%
862 \expandafter\pushthisfilestackX\popthisfilestack\StackTerm
864 \def\pushthisfilestackX{%
865 \expandafter\pushthisfilestackY\thisfile\StackTerm
867 \def\pushthisfilestackY #1\StackTerm #2\StackTerm {%
868 \gdef\popthisfilestack{\gdef\thisfile{#1}\gdef\popthisfilestack{#2}}%
871 \def\popthisfilestack{\errthisfilestackempty}
872 \def\errthisfilestackempty{\errmessage{Internal error:
873 the stack of filenames is empty.}}
878 % outputs that line, centered.
880 \parseargdef\center{%
882 \let\centersub\centerH
884 \let\centersub\centerV
886 \centersub{\hfil \ignorespaces#1\unskip \hfil}%
887 \let\centersub\relax % don't let the definition persist, just in case
891 \advance\hsize by -\leftskip
892 \advance\hsize by -\rightskip
897 \newcount\centerpenalty
899 % The idea here is the same as in \startdefun, \cartouche, etc.: if
900 % @center is the first thing after a section heading, we need to wipe
901 % out the negative parskip inserted by \sectionheading, but still
902 % prevent a page break here.
903 \centerpenalty = \lastpenalty
904 \ifnum\centerpenalty>10000 \vskip\parskip \fi
905 \ifnum\centerpenalty>9999 \penalty\centerpenalty \fi
906 \line{\kern\leftskip #1\kern\rightskip}%
909 % @sp n outputs n lines of vertical space
911 \parseargdef\sp{\vskip #1\baselineskip}
913 % @comment ...line which is ignored...
914 % @c is the same as @comment
915 % @ignore ... @end ignore is another way to write a comment
918 \def\c{\begingroup \catcode`\^^M=\active%
919 \catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%
921 {\catcode`\^^M=\active \gdef\cxxx#1^^M{\endgroup}}
925 % @paragraphindent NCHARS
926 % We'll use ems for NCHARS, close enough.
927 % NCHARS can also be the word `asis' or `none'.
928 % We cannot feasibly implement @paragraphindent asis, though.
930 \def\asisword{asis} % no translation, these are keywords
933 \parseargdef\paragraphindent{%
938 \defaultparindent = 0pt
940 \defaultparindent = #1em
943 \parindent = \defaultparindent
946 % @exampleindent NCHARS
947 % We'll use ems for NCHARS like @paragraphindent.
948 % It seems @exampleindent asis isn't necessary, but
949 % I preserve it to make it similar to @paragraphindent.
950 \parseargdef\exampleindent{%
957 \lispnarrowing = #1em
962 % @firstparagraphindent WORD
963 % If WORD is `none', then suppress indentation of the first paragraph
964 % after a section heading. If WORD is `insert', then do indent at such
967 % The paragraph indentation is suppressed or not by calling
968 % \suppressfirstparagraphindent, which the sectioning commands do.
969 % We switch the definition of this back and forth according to WORD.
970 % By default, we suppress indentation.
972 \def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent}
973 \def\insertword{insert}
975 \parseargdef\firstparagraphindent{%
978 \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent
979 \else\ifx\temp\insertword
980 \let\suppressfirstparagraphindent = \relax
983 \errmessage{Unknown @firstparagraphindent option `\temp'}%
987 % Here is how we actually suppress indentation. Redefine \everypar to
988 % \kern backwards by \parindent, and then reset itself to empty.
990 % We also make \indent itself not actually do anything until the next
993 \gdef\dosuppressfirstparagraphindent{%
994 \gdef\indent {\restorefirstparagraphindent \indent}%
995 \gdef\noindent{\restorefirstparagraphindent \noindent}%
996 \global\everypar = {\kern -\parindent \restorefirstparagraphindent}%
999 \gdef\restorefirstparagraphindent{%
1000 \global\let\indent = \ptexindent
1001 \global\let\noindent = \ptexnoindent
1002 \global\everypar = {}%
1005 % leave vertical mode without cancelling any first paragraph indent
1010 \global\everypar=\toks0
1014 % @refill is a no-op.
1017 % @setfilename INFO-FILENAME - ignored
1018 \let\setfilename=\comment
1021 \outer\def\bye{\chappager\pagelabels\tracingstats=1\ptexend}
1025 % adobe `portable' document format
1029 \newcount\filenamelength
1039 \newif\ifpdfmakepagedest
1045 \newif\iftxiuseunicodedestname
1046 \txiuseunicodedestnamefalse % For pdfTeX etc.
1048 \ifx\luatexversion\thisisundefined
1050 % Use Unicode destination names
1051 \txiuseunicodedestnametrue
1052 % Escape PDF strings with converting UTF-16 from UTF-8
1056 function UTF16oct(str)
1057 tex.sprint(string.char(0x5c) .. '376' .. string.char(0x5c) .. '377')
1058 for c in string.utfvalues(str) do
1061 string.format(string.char(0x5c) .. string.char(0x25) .. '03o' ..
1062 string.char(0x5c) .. string.char(0x25) .. '03o',
1063 math.floor(c / 256), math.floor(c % 256)))
1066 local c_hi = c / 1024 + 0xd800
1067 local c_lo = c % 1024 + 0xdc00
1069 string.format(string.char(0x5c) .. string.char(0x25) .. '03o' ..
1070 string.char(0x5c) .. string.char(0x25) .. '03o' ..
1071 string.char(0x5c) .. string.char(0x25) .. '03o' ..
1072 string.char(0x5c) .. string.char(0x25) .. '03o',
1073 math.floor(c_hi / 256), math.floor(c_hi % 256),
1074 math.floor(c_lo / 256), math.floor(c_lo % 256)))
1080 \def\pdfescapestrutfsixteen#1{\directlua{UTF16oct('\luaescapestring{#1}')}}
1081 % Escape PDF strings without converting
1084 function PDFescstr(str)
1085 for c in string.bytes(str) do
1086 if c <= 0x20 or c >= 0x80 or c == 0x28 or c == 0x29 or c == 0x5c then
1088 string.format(string.char(0x5c) .. string.char(0x25) .. '03o',
1091 tex.sprint(-2, string.char(c))
1096 % The -2 in the arguments here gives all the input to TeX catcode 12
1097 % (other) or 10 (space), preventing undefined control sequence errors. See
1098 % https://lists.gnu.org/archive/html/bug-texinfo/2019-08/msg00031.html
1101 \def\pdfescapestring#1{\directlua{PDFescstr('\luaescapestring{#1}')}}
1102 \ifnum\luatexversion>84
1103 % For LuaTeX >= 0.85
1104 \def\pdfdest{\pdfextension dest}
1105 \let\pdfoutput\outputmode
1106 \def\pdfliteral{\pdfextension literal}
1107 \def\pdfcatalog{\pdfextension catalog}
1108 \def\pdftexversion{\numexpr\pdffeedback version\relax}
1109 \let\pdfximage\saveimageresource
1110 \let\pdfrefximage\useimageresource
1111 \let\pdflastximage\lastsavedimageresourceindex
1112 \def\pdfendlink{\pdfextension endlink\relax}
1113 \def\pdfoutline{\pdfextension outline}
1114 \def\pdfstartlink{\pdfextension startlink}
1115 \def\pdffontattr{\pdfextension fontattr}
1116 \def\pdfobj{\pdfextension obj}
1117 \def\pdflastobj{\numexpr\pdffeedback lastobj\relax}
1118 \let\pdfpagewidth\pagewidth
1119 \let\pdfpageheight\pageheight
1120 \edef\pdfhorigin{\pdfvariable horigin}
1121 \edef\pdfvorigin{\pdfvariable vorigin}
1125 % when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1
1126 % can be set). So we test for \relax and 0 as well as being undefined.
1127 \ifx\pdfoutput\thisisundefined
1129 \ifx\pdfoutput\relax
1143 \ifx\XeTeXrevision\thisisundefined\else
1148 % Output page labels information.
1149 % See PDF reference v.1.7 p.594, section 8.3.1.
1152 \def\title{0 << /P (T-) /S /D >>}%
1153 \edef\roman{\the\romancount << /S /r >>}%
1154 \edef\arabic{\the\arabiccount << /S /D >>}%
1156 % Page label ranges must be increasing. Remove any duplicates.
1157 % (There is a slight chance of this being wrong if e.g. there is
1158 % a @contents but no @titlepage, etc.)
1160 \ifnum\romancount=0 \def\roman{}\fi
1161 \ifnum\arabiccount=0 \def\title{}%
1163 \ifnum\romancount=\arabiccount \def\roman{}\fi
1166 \ifnum\romancount<\arabiccount
1167 \pdfcatalog{/PageLabels << /Nums [\title \roman \arabic ] >> }\relax
1169 \pdfcatalog{/PageLabels << /Nums [\title \arabic \roman ] >> }\relax
1173 \let\pagelabels\relax
1176 \newcount\pagecount \pagecount=0
1177 \newcount\romancount \romancount=0
1178 \newcount\arabiccount \arabiccount=0
1180 \let\ptxadvancepageno\advancepageno
1181 \def\advancepageno{%
1182 \ptxadvancepageno\global\advance\pagecount by 1
1187 % PDF uses PostScript string constants for the names of xref targets,
1188 % for display in the outlines, and in other places. Thus, we have to
1189 % double any backslashes. Otherwise, a name like "\node" will be
1190 % interpreted as a newline (\n), followed by o, d, e. Not good.
1192 % See http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html and
1193 % related messages. The final outcome is that it is up to the TeX user
1194 % to double the backslashes and otherwise make the string valid, so
1195 % that's what we do. pdftex 1.30.0 (ca.2005) introduced a primitive to
1196 % do this reliably, so we use it.
1198 % #1 is a control sequence in which to do the replacements,
1200 \def\txiescapepdf#1{%
1201 \ifx\pdfescapestring\thisisundefined
1202 % No primitive available; should we give a warning or log?
1203 % Many times it won't matter.
1206 % The expandable \pdfescapestring primitive escapes parentheses,
1207 % backslashes, and other special chars.
1208 \xdef#1{\pdfescapestring{#1}}%
1211 \def\txiescapepdfutfsixteen#1{%
1212 \ifx\pdfescapestrutfsixteen\thisisundefined
1213 % No UTF-16 converting macro available.
1216 \xdef#1{\pdfescapestrutfsixteen{#1}}%
1220 \newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images
1221 with PDF output, and none of those formats could be found. (.eps cannot
1222 be supported due to the design of the PDF format; use regular TeX (DVI
1227 % Color manipulation macros using ideas from pdfcolor.tex,
1228 % except using rgb instead of cmyk; the latter is said to render as a
1229 % very dark gray on-screen and a very dark halftone in print, instead
1230 % of actual black. The dark red here is dark enough to print on paper as
1231 % nearly black, but still distinguishable for online viewing. We use
1232 % black by default, though.
1233 \def\rgbDarkRed{0.50 0.09 0.12}
1234 \def\rgbBlack{0 0 0}
1236 % rg sets the color for filling (usual text, etc.);
1237 % RG sets the color for stroking (thin rules, e.g., normal _'s).
1238 \def\pdfsetcolor#1{\pdfliteral{#1 rg #1 RG}}
1240 % Set color, and create a mark which defines \thiscolor accordingly,
1241 % so that \makeheadline knows which color to restore.
1243 \xdef\currentcolordefs{\gdef\noexpand\thiscolor{#1}}%
1248 \def\maincolor{\rgbBlack}
1249 \pdfsetcolor{\maincolor}
1250 \edef\thiscolor{\maincolor}
1251 \def\currentcolordefs{}
1255 \line{\pdfsetcolor{\maincolor}\the\footline}%
1263 % Extract \thiscolor definition from the marks.
1265 % Typeset the headline with \maincolor, then restore the color.
1266 \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}%
1274 \pdfcatalog{/PageMode /UseOutlines}
1276 % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto).
1277 \def\dopdfimage#1#2#3{%
1278 \def\pdfimagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}%
1279 \def\pdfimageheight{#3}\setbox2 = \hbox{\ignorespaces #3}%
1281 % pdftex (and the PDF format) support .pdf, .png, .jpg (among
1282 % others). Let's try in that order, PDF first since if
1283 % someone has a scalable image, presumably better to use that than a
1285 \let\pdfimgext=\empty
1287 \openin 1 #1.pdf \ifeof 1
1288 \openin 1 #1.PDF \ifeof 1
1289 \openin 1 #1.png \ifeof 1
1290 \openin 1 #1.jpg \ifeof 1
1291 \openin 1 #1.jpeg \ifeof 1
1292 \openin 1 #1.JPG \ifeof 1
1293 \errhelp = \nopdfimagehelp
1294 \errmessage{Could not find image file #1 for pdf}%
1295 \else \gdef\pdfimgext{JPG}%
1297 \else \gdef\pdfimgext{jpeg}%
1299 \else \gdef\pdfimgext{jpg}%
1301 \else \gdef\pdfimgext{png}%
1303 \else \gdef\pdfimgext{PDF}%
1305 \else \gdef\pdfimgext{pdf}%
1310 % without \immediate, ancient pdftex seg faults when the same image is
1311 % included twice. (Version 3.14159-pre-1.0-unofficial-20010704.)
1312 \ifnum\pdftexversion < 14
1315 \immediate\pdfximage
1317 \ifdim \wd0 >0pt width \pdfimagewidth \fi
1318 \ifdim \wd2 >0pt height \pdfimageheight \fi
1319 \ifnum\pdftexversion<13
1324 \ifnum\pdftexversion < 14 \else
1325 \pdfrefximage \pdflastximage
1328 \def\setpdfdestname#1{{%
1329 % We have to set dummies so commands such as @code, and characters
1330 % such as \, aren't expanded when present in a section title.
1332 \makevalueexpandable
1334 \iftxiuseunicodedestname
1335 \ifx \declaredencoding \latone
1336 % Pass through Latin-1 characters.
1337 % LuaTeX with byte wise I/O converts Latin-1 characters to Unicode.
1339 \ifx \declaredencoding \utfeight
1340 % Pass through Unicode characters.
1342 % Use ASCII approximations in destination names.
1343 \passthroughcharsfalse
1347 % Use ASCII approximations in destination names.
1348 \passthroughcharsfalse
1350 \def\pdfdestname{#1}%
1351 \txiescapepdf\pdfdestname
1354 \def\setpdfoutlinetext#1{{%
1356 \makevalueexpandable
1358 \ifx \declaredencoding \latone
1359 % The PDF format can use an extended form of Latin-1 in bookmark
1360 % strings. See Appendix D of the PDF Reference, Sixth Edition, for
1361 % the "PDFDocEncoding".
1362 \passthroughcharstrue
1363 % Pass through Latin-1 characters.
1364 % LuaTeX: Convert to Unicode
1365 % pdfTeX: Use Latin-1 as PDFDocEncoding
1366 \def\pdfoutlinetext{#1}%
1368 \ifx \declaredencoding \utfeight
1369 \ifx\luatexversion\thisisundefined
1370 % For pdfTeX with UTF-8.
1371 % TODO: the PDF format can use UTF-16 in bookmark strings,
1372 % but the code for this isn't done yet.
1373 % Use ASCII approximations.
1374 \passthroughcharsfalse
1375 \def\pdfoutlinetext{#1}%
1377 % For LuaTeX with UTF-8.
1378 % Pass through Unicode characters for title texts.
1379 \passthroughcharstrue
1380 \def\pdfoutlinetext{#1}%
1383 % For non-Latin-1 or non-UTF-8 encodings.
1384 % Use ASCII approximations.
1385 \passthroughcharsfalse
1386 \def\pdfoutlinetext{#1}%
1389 % LuaTeX: Convert to UTF-16
1390 % pdfTeX: Use Latin-1 as PDFDocEncoding
1391 \txiescapepdfutfsixteen\pdfoutlinetext
1395 \setpdfdestname{#1}%
1396 \safewhatsit{\pdfdest name{\pdfdestname} xyz}%
1399 % used to mark target names; must be expandable.
1402 % by default, use black for everything.
1403 \def\urlcolor{\rgbBlack}
1404 \def\linkcolor{\rgbBlack}
1405 \def\endlink{\setcolor{\maincolor}\pdfendlink}
1407 % Adding outlines to PDF; macros for calculating structure of outlines
1408 % come from Petr Olsak
1409 \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0%
1410 \else \csname#1\endcsname \fi}
1411 \def\advancenumber#1{\tempnum=\expnumber{#1}\relax
1412 \advance\tempnum by 1
1413 \expandafter\xdef\csname#1\endcsname{\the\tempnum}}
1415 % #1 is the section text, which is what will be displayed in the
1416 % outline by the pdf viewer. #2 is the pdf expression for the number
1417 % of subentries (or empty, for subsubsections). #3 is the node text,
1418 % which might be empty if this toc entry had no corresponding node.
1419 % #4 is the page number
1421 \def\dopdfoutline#1#2#3#4{%
1422 % Generate a link to the node text if that exists; else, use the
1423 % page number. We could generate a destination for the section
1424 % text in the case where a section has no node, but it doesn't
1425 % seem worth the trouble, since most documents are normally structured.
1426 \setpdfoutlinetext{#1}
1428 \ifx\pdfdestname\empty
1429 \def\pdfdestname{#4}%
1432 \pdfoutline goto name{\pdfmkpgn{\pdfdestname}}#2{\pdfoutlinetext}%
1435 \def\pdfmakeoutlines{%
1437 % Read toc silently, to get counts of subentries for \pdfoutline.
1438 \def\partentry##1##2##3##4{}% ignore parts in the outlines
1439 \def\numchapentry##1##2##3##4{%
1440 \def\thischapnum{##2}%
1442 \def\thissubsecnum{0}%
1444 \def\numsecentry##1##2##3##4{%
1445 \advancenumber{chap\thischapnum}%
1446 \def\thissecnum{##2}%
1447 \def\thissubsecnum{0}%
1449 \def\numsubsecentry##1##2##3##4{%
1450 \advancenumber{sec\thissecnum}%
1451 \def\thissubsecnum{##2}%
1453 \def\numsubsubsecentry##1##2##3##4{%
1454 \advancenumber{subsec\thissubsecnum}%
1456 \def\thischapnum{0}%
1458 \def\thissubsecnum{0}%
1460 % use \def rather than \let here because we redefine \chapentry et
1461 % al. a second time, below.
1462 \def\appentry{\numchapentry}%
1463 \def\appsecentry{\numsecentry}%
1464 \def\appsubsecentry{\numsubsecentry}%
1465 \def\appsubsubsecentry{\numsubsubsecentry}%
1466 \def\unnchapentry{\numchapentry}%
1467 \def\unnsecentry{\numsecentry}%
1468 \def\unnsubsecentry{\numsubsecentry}%
1469 \def\unnsubsubsecentry{\numsubsubsecentry}%
1472 % Read toc second time, this time actually producing the outlines.
1473 % The `-' means take the \expnumber as the absolute number of
1474 % subentries, which we calculated on our first read of the .toc above.
1476 % We use the node names as the destinations.
1478 % Currently we prefix the section name with the section number
1479 % for chapter and appendix headings only in order to avoid too much
1480 % horizontal space being required in the PDF viewer.
1481 \def\numchapentry##1##2##3##4{%
1482 \dopdfoutline{##2 ##1}{count-\expnumber{chap##2}}{##3}{##4}}%
1483 \def\unnchapentry##1##2##3##4{%
1484 \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}%
1485 \def\numsecentry##1##2##3##4{%
1486 \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}%
1487 \def\numsubsecentry##1##2##3##4{%
1488 \dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}%
1489 \def\numsubsubsecentry##1##2##3##4{% count is always zero
1490 \dopdfoutline{##1}{}{##3}{##4}}%
1492 % PDF outlines are displayed using system fonts, instead of
1493 % document fonts. Therefore we cannot use special characters,
1494 % since the encoding is unknown. For example, the eogonek from
1495 % Latin 2 (0xea) gets translated to a | character. Info from
1496 % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100.
1498 % TODO this right, we have to translate 8-bit characters to
1499 % their "best" equivalent, based on the @documentencoding. Too
1500 % much work for too little return. Just use the ASCII equivalents
1501 % we use for the index sort strings.
1505 % We can have normal brace characters in the PDF outlines, unlike
1506 % Texinfo index files. So set that up.
1507 \def\{{\lbracecharliteral}%
1508 \def\}{\rbracecharliteral}%
1509 \catcode`\\=\active \otherbackslash
1510 \input \tocreadfilename
1513 {\catcode`[=1 \catcode`]=2
1514 \catcode`{=\other \catcode`}=\other
1515 \gdef\lbracecharliteral[{]%
1516 \gdef\rbracecharliteral[}]%
1519 \def\skipspaces#1{\def\PP{#1}\def\D{|}%
1520 \ifx\PP\D\let\nextsp\relax
1521 \else\let\nextsp\skipspaces
1522 \addtokens{\filename}{\PP}%
1523 \advance\filenamelength by 1
1526 \def\getfilename#1{%
1528 % If we don't expand the argument now, \skipspaces will get
1529 % snagged on things like "@value{foo}".
1531 \expandafter\skipspaces\temp|\relax
1533 \ifnum\pdftexversion < 14
1534 \let \startlink \pdfannotlink
1536 \let \startlink \pdfstartlink
1538 % make a live url in pdf output.
1541 % it seems we really need yet another set of dummies; have not
1542 % tried to figure out what each command should do in the context
1543 % of @url. for now, just make @/ a no-op, that's the only one
1544 % people have actually reported a problem with.
1546 \normalturnoffactive
1549 \makevalueexpandable
1550 % do we want to go so far as to use \indexnofonts instead of just
1551 % special-casing \var here?
1554 \leavevmode\setcolor{\urlcolor}%
1555 \startlink attr{/Border [0 0 0]}%
1556 user{/Subtype /Link /A << /S /URI /URI (#1) >>}%
1558 % \pdfgettoks - Surround page numbers in #1 with @pdflink. #1 may
1559 % be a simple number, or a list of numbers in the case of an index
1561 \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}}
1562 \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
1563 \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks}
1564 \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}}
1566 \expandafter\poptoks\the\toksA|ENDTOKS|\relax
1568 \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3
1569 \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6
1570 \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9
1572 \ifnum0=\countA\else\makelink\fi
1573 \ifx\first.\let\next=\done\else
1575 \addtokens{\toksB}{\the\toksD}
1576 \ifx\first,\addtokens{\toksB}{\space}\fi
1578 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
1580 \def\makelink{\addtokens{\toksB}%
1581 {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0}
1583 \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}}
1584 \setcolor{\linkcolor}#1\endlink}
1585 \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
1588 \let\pdfmkdest = \gobble
1589 \let\pdfurl = \gobble
1590 \let\endlink = \relax
1591 \let\setcolor = \gobble
1592 \let\pdfsetcolor = \gobble
1593 \let\pdfmakeoutlines = \relax
1594 \fi % \ifx\pdfoutput
1599 \ifx\XeTeXrevision\thisisundefined
1602 % XeTeX version check
1604 \ifnum\strcmp{\the\XeTeXversion\XeTeXrevision}{0.99996}>-1
1605 % TeX Live 2016 contains XeTeX 0.99996 and xdvipdfmx 20160307.
1606 % It can use the `dvipdfmx:config' special (from TeX Live SVN r40941).
1607 % For avoiding PDF destination name replacement, we use this special
1608 % instead of xdvipdfmx's command line option `-C 0x0010'.
1609 \special{dvipdfmx:config C 0x0010}
1610 % XeTeX 0.99995+ comes with xdvipdfmx 20160307+.
1611 % It can handle Unicode destination names for PDF.
1612 \txiuseunicodedestnametrue
1614 % XeTeX < 0.99996 (TeX Live < 2016) cannot use the
1615 % `dvipdfmx:config' special.
1616 % So for avoiding PDF destination name replacement,
1617 % xdvipdfmx's command line option `-C 0x0010' is necessary.
1619 % XeTeX < 0.99995 can not handle Unicode destination names for PDF
1620 % because xdvipdfmx 20150315 has a UTF-16 conversion issue.
1621 % It is fixed by xdvipdfmx 20160106 (TeX Live SVN r39753).
1622 \txiuseunicodedestnamefalse
1627 \def\rgbDarkRed{0.50 0.09 0.12}
1628 \def\rgbBlack{0 0 0}
1630 \def\pdfsetcolor#1{\special{pdf:scolor [#1]}}
1632 % Set color, and create a mark which defines \thiscolor accordingly,
1633 % so that \makeheadline knows which color to restore.
1635 \xdef\currentcolordefs{\gdef\noexpand\thiscolor{#1}}%
1640 \def\maincolor{\rgbBlack}
1641 \pdfsetcolor{\maincolor}
1642 \edef\thiscolor{\maincolor}
1643 \def\currentcolordefs{}
1647 \line{\pdfsetcolor{\maincolor}\the\footline}%
1655 % Extract \thiscolor definition from the marks.
1657 % Typeset the headline with \maincolor, then restore the color.
1658 \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}%
1665 % PDF outline support
1667 % Emulate pdfTeX primitive
1668 \def\pdfdest name#1 xyz{%
1669 \special{pdf:dest (#1) [@thispage /XYZ @xpos @ypos null]}%
1672 \def\setpdfdestname#1{{%
1673 % We have to set dummies so commands such as @code, and characters
1674 % such as \, aren't expanded when present in a section title.
1676 \makevalueexpandable
1678 \iftxiuseunicodedestname
1679 % Pass through Unicode characters.
1681 % Use ASCII approximations in destination names.
1682 \passthroughcharsfalse
1684 \def\pdfdestname{#1}%
1685 \txiescapepdf\pdfdestname
1688 \def\setpdfoutlinetext#1{{%
1690 % Always use Unicode characters in title texts.
1691 \def\pdfoutlinetext{#1}%
1692 % For XeTeX, xdvipdfmx converts to UTF-16.
1693 % So we do not convert.
1694 \txiescapepdf\pdfoutlinetext
1698 \setpdfdestname{#1}%
1699 \safewhatsit{\pdfdest name{\pdfdestname} xyz}%
1702 % by default, use black for everything.
1703 \def\urlcolor{\rgbBlack}
1704 \def\linkcolor{\rgbBlack}
1705 \def\endlink{\setcolor{\maincolor}\pdfendlink}
1707 \def\dopdfoutline#1#2#3#4{%
1708 \setpdfoutlinetext{#1}
1710 \ifx\pdfdestname\empty
1711 \def\pdfdestname{#4}%
1714 \special{pdf:out [-] #2 << /Title (\pdfoutlinetext) /A
1715 << /S /GoTo /D (\pdfdestname) >> >> }%
1718 \def\pdfmakeoutlines{%
1721 % For XeTeX, counts of subentries are not necessary.
1722 % Therefore, we read toc only once.
1724 % We use node names as destinations.
1726 % Currently we prefix the section name with the section number
1727 % for chapter and appendix headings only in order to avoid too much
1728 % horizontal space being required in the PDF viewer.
1729 \def\partentry##1##2##3##4{}% ignore parts in the outlines
1730 \def\numchapentry##1##2##3##4{%
1731 \dopdfoutline{##2 ##1}{1}{##3}{##4}}%
1732 \def\numsecentry##1##2##3##4{%
1733 \dopdfoutline{##1}{2}{##3}{##4}}%
1734 \def\numsubsecentry##1##2##3##4{%
1735 \dopdfoutline{##1}{3}{##3}{##4}}%
1736 \def\numsubsubsecentry##1##2##3##4{%
1737 \dopdfoutline{##1}{4}{##3}{##4}}%
1739 \let\appentry\numchapentry%
1740 \let\appsecentry\numsecentry%
1741 \let\appsubsecentry\numsubsecentry%
1742 \let\appsubsubsecentry\numsubsubsecentry%
1743 \def\unnchapentry##1##2##3##4{%
1744 \dopdfoutline{##1}{1}{##3}{##4}}%
1745 \let\unnsecentry\numsecentry%
1746 \let\unnsubsecentry\numsubsecentry%
1747 \let\unnsubsubsecentry\numsubsubsecentry%
1749 % For XeTeX, xdvipdfmx converts strings to UTF-16.
1750 % Therefore, the encoding and the language may not be considered.
1754 % We can have normal brace characters in the PDF outlines, unlike
1755 % Texinfo index files. So set that up.
1756 \def\{{\lbracecharliteral}%
1757 \def\}{\rbracecharliteral}%
1758 \catcode`\\=\active \otherbackslash
1759 \input \tocreadfilename
1762 {\catcode`[=1 \catcode`]=2
1763 \catcode`{=\other \catcode`}=\other
1764 \gdef\lbracecharliteral[{]%
1765 \gdef\rbracecharliteral[}]%
1768 \special{pdf:docview << /PageMode /UseOutlines >> }
1769 % ``\special{pdf:tounicode ...}'' is not necessary
1770 % because xdvipdfmx converts strings from UTF-8 to UTF-16 without it.
1771 % However, due to a UTF-16 conversion issue of xdvipdfmx 20150315,
1772 % ``\special{pdf:dest ...}'' cannot handle non-ASCII strings.
1773 % It is fixed by xdvipdfmx 20160106 (TeX Live SVN r39753).
1775 \def\skipspaces#1{\def\PP{#1}\def\D{|}%
1776 \ifx\PP\D\let\nextsp\relax
1777 \else\let\nextsp\skipspaces
1778 \addtokens{\filename}{\PP}%
1779 \advance\filenamelength by 1
1782 \def\getfilename#1{%
1784 % If we don't expand the argument now, \skipspaces will get
1785 % snagged on things like "@value{foo}".
1787 \expandafter\skipspaces\temp|\relax
1789 % make a live url in pdf output.
1792 % it seems we really need yet another set of dummies; have not
1793 % tried to figure out what each command should do in the context
1794 % of @url. for now, just make @/ a no-op, that's the only one
1795 % people have actually reported a problem with.
1797 \normalturnoffactive
1800 \makevalueexpandable
1801 % do we want to go so far as to use \indexnofonts instead of just
1802 % special-casing \var here?
1805 \leavevmode\setcolor{\urlcolor}%
1806 \special{pdf:bann << /Border [0 0 0]
1807 /Subtype /Link /A << /S /URI /URI (#1) >> >>}%
1809 \def\endlink{\setcolor{\maincolor}\special{pdf:eann}}
1810 \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}}
1811 \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
1812 \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks}
1813 \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}}
1815 \expandafter\poptoks\the\toksA|ENDTOKS|\relax
1817 \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3
1818 \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6
1819 \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9
1821 \ifnum0=\countA\else\makelink\fi
1822 \ifx\first.\let\next=\done\else
1824 \addtokens{\toksB}{\the\toksD}
1825 \ifx\first,\addtokens{\toksB}{\space}\fi
1827 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
1829 \def\makelink{\addtokens{\toksB}%
1830 {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0}
1832 \special{pdf:bann << /Border [0 0 0]
1833 /Type /Annot /Subtype /Link /A << /S /GoTo /D (#1) >> >>}%
1834 \setcolor{\linkcolor}#1\endlink}
1835 \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
1840 % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto).
1841 \def\doxeteximage#1#2#3{%
1842 \def\xeteximagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}%
1843 \def\xeteximageheight{#3}\setbox2 = \hbox{\ignorespaces #3}%
1845 % XeTeX (and the PDF format) supports .pdf, .png, .jpg (among
1846 % others). Let's try in that order, PDF first since if
1847 % someone has a scalable image, presumably better to use that than a
1849 \let\xeteximgext=\empty
1851 \openin 1 #1.pdf \ifeof 1
1852 \openin 1 #1.PDF \ifeof 1
1853 \openin 1 #1.png \ifeof 1
1854 \openin 1 #1.jpg \ifeof 1
1855 \openin 1 #1.jpeg \ifeof 1
1856 \openin 1 #1.JPG \ifeof 1
1857 \errmessage{Could not find image file #1 for XeTeX}%
1858 \else \gdef\xeteximgext{JPG}%
1860 \else \gdef\xeteximgext{jpeg}%
1862 \else \gdef\xeteximgext{jpg}%
1864 \else \gdef\xeteximgext{png}%
1866 \else \gdef\xeteximgext{PDF}%
1868 \else \gdef\xeteximgext{pdf}%
1873 % Putting an \hbox around the image can prevent an over-long line
1876 \def\xetexpdfext{pdf}%
1877 \ifx\xeteximgext\xetexpdfext
1878 \XeTeXpdffile "#1".\xeteximgext ""
1880 \def\xetexpdfext{PDF}%
1881 \ifx\xeteximgext\xetexpdfext
1882 \XeTeXpdffile "#1".\xeteximgext ""
1884 \XeTeXpicfile "#1".\xeteximgext ""
1887 \ifdim \wd0 >0pt width \xeteximagewidth \fi
1888 \ifdim \wd2 >0pt height \xeteximageheight \fi \relax
1897 % Set the baselineskip to #1, and the lineskip and strut size
1898 % correspondingly. There is no deep meaning behind these magic numbers
1899 % used as factors; they just match (closely enough) what Knuth defined.
1901 \def\lineskipfactor{.08333}
1902 \def\strutheightpercent{.70833}
1903 \def\strutdepthpercent {.29167}
1905 % can get a sort of poor man's double spacing by redefining this.
1906 \def\baselinefactor{1}
1908 \newdimen\textleading
1911 \normalbaselineskip = \baselinefactor\dimen0
1912 \normallineskip = \lineskipfactor\normalbaselineskip
1914 \setbox\strutbox =\hbox{%
1915 \vrule width0pt height\strutheightpercent\baselineskip
1916 depth \strutdepthpercent \baselineskip
1920 % PDF CMaps. See also LaTeX's t1.cmap.
1922 % do nothing with this by default.
1923 \expandafter\let\csname cmapOT1\endcsname\gobble
1924 \expandafter\let\csname cmapOT1IT\endcsname\gobble
1925 \expandafter\let\csname cmapOT1TT\endcsname\gobble
1927 % if we are producing pdf, and we have \pdffontattr, then define cmaps.
1928 % (\pdffontattr was introduced many years ago, but people still run
1929 % older pdftex's; it's easy to conditionalize, so we do.)
1930 \ifpdf \ifx\pdffontattr\thisisundefined \else
1932 \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
1933 \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
1934 %%DocumentNeededResources: ProcSet (CIDInit)
1935 %%IncludeResource: ProcSet (CIDInit)
1936 %%BeginResource: CMap (TeX-OT1-0)
1937 %%Title: (TeX-OT1-0 TeX OT1 0)
1940 /CIDInit /ProcSet findresource begin
1948 /CMapName /TeX-OT1-0 def
1950 1 begincodespacerange
2006 CMapName currentdict /CMap defineresource pop
2012 \expandafter\edef\csname cmapOT1\endcsname#1{%
2013 \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
2018 \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
2019 \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
2020 %%DocumentNeededResources: ProcSet (CIDInit)
2021 %%IncludeResource: ProcSet (CIDInit)
2022 %%BeginResource: CMap (TeX-OT1IT-0)
2023 %%Title: (TeX-OT1IT-0 TeX OT1IT 0)
2026 /CIDInit /ProcSet findresource begin
2034 /CMapName /TeX-OT1IT-0 def
2036 1 begincodespacerange
2094 CMapName currentdict /CMap defineresource pop
2100 \expandafter\edef\csname cmapOT1IT\endcsname#1{%
2101 \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
2106 \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
2107 \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
2108 %%DocumentNeededResources: ProcSet (CIDInit)
2109 %%IncludeResource: ProcSet (CIDInit)
2110 %%BeginResource: CMap (TeX-OT1TT-0)
2111 %%Title: (TeX-OT1TT-0 TeX OT1TT 0)
2114 /CIDInit /ProcSet findresource begin
2122 /CMapName /TeX-OT1TT-0 def
2124 1 begincodespacerange
2169 CMapName currentdict /CMap defineresource pop
2175 \expandafter\edef\csname cmapOT1TT\endcsname#1{%
2176 \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
2181 % Set the font macro #1 to the font named \fontprefix#2.
2182 % #3 is the font's design size, #4 is a scale factor, #5 is the CMap
2183 % encoding (only OT1, OT1IT and OT1TT are allowed, or empty to omit).
2191 \def\setfont#1#2#3#4#5{%
2192 \font#1=\fontprefix#2#3 scaled #4
2193 \csname cmap#5\endcsname#1%
2195 % This is what gets called when #5 of \setfont is empty.
2200 % Use cm as the default font prefix.
2201 % To specify the font prefix, you must define \fontprefix
2202 % before you read in texinfo.tex.
2203 \ifx\fontprefix\thisisundefined
2206 % Support font families that don't use the same naming scheme as CM.
2208 \def\rmbshape{bx} % where the normal face is bold
2213 \def\ttslshape{sltt}
2223 % Definitions for a main text size of 11pt. (The default in Texinfo.)
2225 \def\definetextfontsizexi{%
2226 % Text fonts (11.2pt, magstep1).
2227 \def\textnominalsize{11pt}
2228 \edef\mainmagstep{\magstephalf}
2229 \setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
2230 \setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
2231 \setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
2232 \setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
2233 \setfont\textsl\slshape{10}{\mainmagstep}{OT1}
2234 \setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
2235 \setfont\textsc\scshape{10}{\mainmagstep}{OT1}
2236 \setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
2237 \font\texti=cmmi10 scaled \mainmagstep
2238 \font\textsy=cmsy10 scaled \mainmagstep
2239 \def\textecsize{1095}
2241 % A few fonts for @defun names and args.
2242 \setfont\defbf\bfshape{10}{\magstep1}{OT1}
2243 \setfont\deftt\ttshape{10}{\magstep1}{OT1TT}
2244 \setfont\defsl\slshape{10}{\magstep1}{OT1}
2245 \setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT}
2246 \def\df{\let\ttfont=\deftt \let\bffont = \defbf
2247 \let\ttslfont=\defttsl \let\slfont=\defsl \bf}
2249 % Fonts for indices, footnotes, small examples (9pt).
2250 \def\smallnominalsize{9pt}
2251 \setfont\smallrm\rmshape{9}{1000}{OT1}
2252 \setfont\smalltt\ttshape{9}{1000}{OT1TT}
2253 \setfont\smallbf\bfshape{10}{900}{OT1}
2254 \setfont\smallit\itshape{9}{1000}{OT1IT}
2255 \setfont\smallsl\slshape{9}{1000}{OT1}
2256 \setfont\smallsf\sfshape{9}{1000}{OT1}
2257 \setfont\smallsc\scshape{10}{900}{OT1}
2258 \setfont\smallttsl\ttslshape{10}{900}{OT1TT}
2261 \def\smallecsize{0900}
2263 % Fonts for small examples (8pt).
2264 \def\smallernominalsize{8pt}
2265 \setfont\smallerrm\rmshape{8}{1000}{OT1}
2266 \setfont\smallertt\ttshape{8}{1000}{OT1TT}
2267 \setfont\smallerbf\bfshape{10}{800}{OT1}
2268 \setfont\smallerit\itshape{8}{1000}{OT1IT}
2269 \setfont\smallersl\slshape{8}{1000}{OT1}
2270 \setfont\smallersf\sfshape{8}{1000}{OT1}
2271 \setfont\smallersc\scshape{10}{800}{OT1}
2272 \setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
2273 \font\smalleri=cmmi8
2274 \font\smallersy=cmsy8
2275 \def\smallerecsize{0800}
2277 % Fonts for math mode superscripts (7pt).
2278 \def\sevennominalsize{7pt}
2279 \setfont\sevenrm\rmshape{7}{1000}{OT1}
2280 \setfont\seventt\ttshape{10}{700}{OT1TT}
2281 \setfont\sevenbf\bfshape{10}{700}{OT1}
2282 \setfont\sevenit\itshape{7}{1000}{OT1IT}
2283 \setfont\sevensl\slshape{10}{700}{OT1}
2284 \setfont\sevensf\sfshape{10}{700}{OT1}
2285 \setfont\sevensc\scshape{10}{700}{OT1}
2286 \setfont\seventtsl\ttslshape{10}{700}{OT1TT}
2289 \def\sevenecsize{0700}
2291 % Fonts for title page (20.4pt):
2292 \def\titlenominalsize{20pt}
2293 \setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
2294 \setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
2295 \setfont\titlesl\slbshape{10}{\magstep4}{OT1}
2296 \setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
2297 \setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
2298 \setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
2299 \let\titlebf=\titlerm
2300 \setfont\titlesc\scbshape{10}{\magstep4}{OT1}
2301 \font\titlei=cmmi12 scaled \magstep3
2302 \font\titlesy=cmsy10 scaled \magstep4
2303 \def\titleecsize{2074}
2305 % Chapter (and unnumbered) fonts (17.28pt).
2306 \def\chapnominalsize{17pt}
2307 \setfont\chaprm\rmbshape{12}{\magstep2}{OT1}
2308 \setfont\chapit\itbshape{10}{\magstep3}{OT1IT}
2309 \setfont\chapsl\slbshape{10}{\magstep3}{OT1}
2310 \setfont\chaptt\ttbshape{12}{\magstep2}{OT1TT}
2311 \setfont\chapttsl\ttslshape{10}{\magstep3}{OT1TT}
2312 \setfont\chapsf\sfbshape{17}{1000}{OT1}
2314 \setfont\chapsc\scbshape{10}{\magstep3}{OT1}
2315 \font\chapi=cmmi12 scaled \magstep2
2316 \font\chapsy=cmsy10 scaled \magstep3
2317 \def\chapecsize{1728}
2319 % Section fonts (14.4pt).
2320 \def\secnominalsize{14pt}
2321 \setfont\secrm\rmbshape{12}{\magstep1}{OT1}
2322 \setfont\secrmnotbold\rmshape{12}{\magstep1}{OT1}
2323 \setfont\secit\itbshape{10}{\magstep2}{OT1IT}
2324 \setfont\secsl\slbshape{10}{\magstep2}{OT1}
2325 \setfont\sectt\ttbshape{12}{\magstep1}{OT1TT}
2326 \setfont\secttsl\ttslshape{10}{\magstep2}{OT1TT}
2327 \setfont\secsf\sfbshape{12}{\magstep1}{OT1}
2329 \setfont\secsc\scbshape{10}{\magstep2}{OT1}
2330 \font\seci=cmmi12 scaled \magstep1
2331 \font\secsy=cmsy10 scaled \magstep2
2332 \def\sececsize{1440}
2334 % Subsection fonts (13.15pt).
2335 \def\ssecnominalsize{13pt}
2336 \setfont\ssecrm\rmbshape{12}{\magstephalf}{OT1}
2337 \setfont\ssecit\itbshape{10}{1315}{OT1IT}
2338 \setfont\ssecsl\slbshape{10}{1315}{OT1}
2339 \setfont\ssectt\ttbshape{12}{\magstephalf}{OT1TT}
2340 \setfont\ssecttsl\ttslshape{10}{1315}{OT1TT}
2341 \setfont\ssecsf\sfbshape{12}{\magstephalf}{OT1}
2343 \setfont\ssecsc\scbshape{10}{1315}{OT1}
2344 \font\sseci=cmmi12 scaled \magstephalf
2345 \font\ssecsy=cmsy10 scaled 1315
2346 \def\ssececsize{1200}
2348 % Reduced fonts for @acronym in text (10pt).
2349 \def\reducednominalsize{10pt}
2350 \setfont\reducedrm\rmshape{10}{1000}{OT1}
2351 \setfont\reducedtt\ttshape{10}{1000}{OT1TT}
2352 \setfont\reducedbf\bfshape{10}{1000}{OT1}
2353 \setfont\reducedit\itshape{10}{1000}{OT1IT}
2354 \setfont\reducedsl\slshape{10}{1000}{OT1}
2355 \setfont\reducedsf\sfshape{10}{1000}{OT1}
2356 \setfont\reducedsc\scshape{10}{1000}{OT1}
2357 \setfont\reducedttsl\ttslshape{10}{1000}{OT1TT}
2358 \font\reducedi=cmmi10
2359 \font\reducedsy=cmsy10
2360 \def\reducedecsize{1000}
2362 \textleading = 13.2pt % line spacing for 11pt CM
2363 \textfonts % reset the current fonts
2365 } % end of 11pt text font size definitions, \definetextfontsizexi
2368 % Definitions to make the main text be 10pt Computer Modern, with
2369 % section, chapter, etc., sizes following suit. This is for the GNU
2370 % Press printing of the Emacs 22 manual. Maybe other manuals in the
2371 % future. Used with @smallbook, which sets the leading to 12pt.
2373 \def\definetextfontsizex{%
2374 % Text fonts (10pt).
2375 \def\textnominalsize{10pt}
2376 \edef\mainmagstep{1000}
2377 \setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
2378 \setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
2379 \setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
2380 \setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
2381 \setfont\textsl\slshape{10}{\mainmagstep}{OT1}
2382 \setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
2383 \setfont\textsc\scshape{10}{\mainmagstep}{OT1}
2384 \setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
2385 \font\texti=cmmi10 scaled \mainmagstep
2386 \font\textsy=cmsy10 scaled \mainmagstep
2387 \def\textecsize{1000}
2389 % A few fonts for @defun names and args.
2390 \setfont\defbf\bfshape{10}{\magstephalf}{OT1}
2391 \setfont\deftt\ttshape{10}{\magstephalf}{OT1TT}
2392 \setfont\defsl\slshape{10}{\magstephalf}{OT1}
2393 \setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT}
2394 \def\df{\let\ttfont=\deftt \let\bffont = \defbf
2395 \let\slfont=\defsl \let\ttslfont=\defttsl \bf}
2397 % Fonts for indices, footnotes, small examples (9pt).
2398 \def\smallnominalsize{9pt}
2399 \setfont\smallrm\rmshape{9}{1000}{OT1}
2400 \setfont\smalltt\ttshape{9}{1000}{OT1TT}
2401 \setfont\smallbf\bfshape{10}{900}{OT1}
2402 \setfont\smallit\itshape{9}{1000}{OT1IT}
2403 \setfont\smallsl\slshape{9}{1000}{OT1}
2404 \setfont\smallsf\sfshape{9}{1000}{OT1}
2405 \setfont\smallsc\scshape{10}{900}{OT1}
2406 \setfont\smallttsl\ttslshape{10}{900}{OT1TT}
2409 \def\smallecsize{0900}
2411 % Fonts for small examples (8pt).
2412 \def\smallernominalsize{8pt}
2413 \setfont\smallerrm\rmshape{8}{1000}{OT1}
2414 \setfont\smallertt\ttshape{8}{1000}{OT1TT}
2415 \setfont\smallerbf\bfshape{10}{800}{OT1}
2416 \setfont\smallerit\itshape{8}{1000}{OT1IT}
2417 \setfont\smallersl\slshape{8}{1000}{OT1}
2418 \setfont\smallersf\sfshape{8}{1000}{OT1}
2419 \setfont\smallersc\scshape{10}{800}{OT1}
2420 \setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
2421 \font\smalleri=cmmi8
2422 \font\smallersy=cmsy8
2423 \def\smallerecsize{0800}
2425 % Fonts for math mode superscripts (7pt).
2426 \def\sevennominalsize{7pt}
2427 \setfont\sevenrm\rmshape{7}{1000}{OT1}
2428 \setfont\seventt\ttshape{10}{700}{OT1TT}
2429 \setfont\sevenbf\bfshape{10}{700}{OT1}
2430 \setfont\sevenit\itshape{7}{1000}{OT1IT}
2431 \setfont\sevensl\slshape{10}{700}{OT1}
2432 \setfont\sevensf\sfshape{10}{700}{OT1}
2433 \setfont\sevensc\scshape{10}{700}{OT1}
2434 \setfont\seventtsl\ttslshape{10}{700}{OT1TT}
2437 \def\sevenecsize{0700}
2439 % Fonts for title page (20.4pt):
2440 \def\titlenominalsize{20pt}
2441 \setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
2442 \setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
2443 \setfont\titlesl\slbshape{10}{\magstep4}{OT1}
2444 \setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
2445 \setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
2446 \setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
2447 \let\titlebf=\titlerm
2448 \setfont\titlesc\scbshape{10}{\magstep4}{OT1}
2449 \font\titlei=cmmi12 scaled \magstep3
2450 \font\titlesy=cmsy10 scaled \magstep4
2451 \def\titleecsize{2074}
2453 % Chapter fonts (14.4pt).
2454 \def\chapnominalsize{14pt}
2455 \setfont\chaprm\rmbshape{12}{\magstep1}{OT1}
2456 \setfont\chapit\itbshape{10}{\magstep2}{OT1IT}
2457 \setfont\chapsl\slbshape{10}{\magstep2}{OT1}
2458 \setfont\chaptt\ttbshape{12}{\magstep1}{OT1TT}
2459 \setfont\chapttsl\ttslshape{10}{\magstep2}{OT1TT}
2460 \setfont\chapsf\sfbshape{12}{\magstep1}{OT1}
2462 \setfont\chapsc\scbshape{10}{\magstep2}{OT1}
2463 \font\chapi=cmmi12 scaled \magstep1
2464 \font\chapsy=cmsy10 scaled \magstep2
2465 \def\chapecsize{1440}
2467 % Section fonts (12pt).
2468 \def\secnominalsize{12pt}
2469 \setfont\secrm\rmbshape{12}{1000}{OT1}
2470 \setfont\secit\itbshape{10}{\magstep1}{OT1IT}
2471 \setfont\secsl\slbshape{10}{\magstep1}{OT1}
2472 \setfont\sectt\ttbshape{12}{1000}{OT1TT}
2473 \setfont\secttsl\ttslshape{10}{\magstep1}{OT1TT}
2474 \setfont\secsf\sfbshape{12}{1000}{OT1}
2476 \setfont\secsc\scbshape{10}{\magstep1}{OT1}
2478 \font\secsy=cmsy10 scaled \magstep1
2479 \def\sececsize{1200}
2481 % Subsection fonts (10pt).
2482 \def\ssecnominalsize{10pt}
2483 \setfont\ssecrm\rmbshape{10}{1000}{OT1}
2484 \setfont\ssecit\itbshape{10}{1000}{OT1IT}
2485 \setfont\ssecsl\slbshape{10}{1000}{OT1}
2486 \setfont\ssectt\ttbshape{10}{1000}{OT1TT}
2487 \setfont\ssecttsl\ttslshape{10}{1000}{OT1TT}
2488 \setfont\ssecsf\sfbshape{10}{1000}{OT1}
2490 \setfont\ssecsc\scbshape{10}{1000}{OT1}
2493 \def\ssececsize{1000}
2495 % Reduced fonts for @acronym in text (9pt).
2496 \def\reducednominalsize{9pt}
2497 \setfont\reducedrm\rmshape{9}{1000}{OT1}
2498 \setfont\reducedtt\ttshape{9}{1000}{OT1TT}
2499 \setfont\reducedbf\bfshape{10}{900}{OT1}
2500 \setfont\reducedit\itshape{9}{1000}{OT1IT}
2501 \setfont\reducedsl\slshape{9}{1000}{OT1}
2502 \setfont\reducedsf\sfshape{9}{1000}{OT1}
2503 \setfont\reducedsc\scshape{10}{900}{OT1}
2504 \setfont\reducedttsl\ttslshape{10}{900}{OT1TT}
2505 \font\reducedi=cmmi9
2506 \font\reducedsy=cmsy9
2507 \def\reducedecsize{0900}
2509 \divide\parskip by 2 % reduce space between paragraphs
2510 \textleading = 12pt % line spacing for 10pt CM
2511 \textfonts % reset the current fonts
2513 } % end of 10pt text font size definitions, \definetextfontsizex
2515 % Fonts for short table of contents.
2516 \setfont\shortcontrm\rmshape{12}{1000}{OT1}
2517 \setfont\shortcontbf\bfshape{10}{\magstep1}{OT1} % no cmb12
2518 \setfont\shortcontsl\slshape{12}{1000}{OT1}
2519 \setfont\shortconttt\ttshape{12}{1000}{OT1TT}
2522 % We provide the user-level command
2524 % (or 11) to redefine the text font size. pt is assumed.
2530 \parseargdef\fonttextsize{%
2531 \def\textsizearg{#1}%
2532 %\wlog{doing @fonttextsize \textsizearg}%
2534 % Set \globaldefs so that documents can use this inside @tex, since
2535 % makeinfo 4.8 does not support it, but we need it nonetheless.
2537 \begingroup \globaldefs=1
2538 \ifx\textsizearg\xword \definetextfontsizex
2539 \else \ifx\textsizearg\xiword \definetextfontsizexi
2542 \errmessage{@fonttextsize only supports `10' or `11', not `\textsizearg'}
2548 % Change the current font style to #1, remembering it in \curfontstyle.
2549 % For now, we do not accumulate font styles: @b{@i{foo}} prints foo in
2550 % italics, not bold italics.
2552 \def\setfontstyle#1{%
2553 \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd.
2554 \csname #1font\endcsname % change the current font
2557 \def\rm{\fam=0 \setfontstyle{rm}}
2558 \def\it{\fam=\itfam \setfontstyle{it}}
2559 \def\sl{\fam=\slfam \setfontstyle{sl}}
2560 \def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf}
2561 \def\tt{\fam=\ttfam \setfontstyle{tt}}\def\ttstylename{tt}
2563 % Texinfo sort of supports the sans serif font style, which plain TeX does not.
2564 % So we set up a \sf.
2566 \def\sf{\fam=\sffam \setfontstyle{sf}}
2568 % We don't need math for this font style.
2569 \def\ttsl{\setfontstyle{ttsl}}
2572 % In order for the font changes to affect most math symbols and letters,
2573 % we have to define the \textfont of the standard families.
2574 % We don't bother to reset \scriptscriptfont; awaiting user need.
2576 \def\resetmathfonts{%
2577 \textfont0=\rmfont \textfont1=\ifont \textfont2=\syfont
2578 \textfont\itfam=\itfont \textfont\slfam=\slfont \textfont\bffam=\bffont
2579 \textfont\ttfam=\ttfont \textfont\sffam=\sffont
2581 % Fonts for superscript. Note that the 7pt fonts are used regardless
2582 % of the current font size.
2583 \scriptfont0=\sevenrm \scriptfont1=\seveni \scriptfont2=\sevensy
2584 \scriptfont\itfam=\sevenit \scriptfont\slfam=\sevensl
2585 \scriptfont\bffam=\sevenbf \scriptfont\ttfam=\seventt
2586 \scriptfont\sffam=\sevensf
2591 % The font-changing commands (all called \...fonts) redefine the meanings
2592 % of \STYLEfont, instead of just \STYLE. We do this because \STYLE needs
2593 % to also set the current \fam for math mode. Our \STYLE (e.g., \rm)
2594 % commands hardwire \STYLEfont to set the current font.
2596 % The fonts used for \ifont are for "math italics" (\itfont is for italics
2597 % in regular text). \syfont is also used in math mode only.
2599 % Each font-changing command also sets the names \lsize (one size lower)
2600 % and \lllsize (three sizes lower). These relative commands are used
2601 % in, e.g., the LaTeX logo and acronyms.
2603 % This all needs generalizing, badly.
2606 \def\assignfonts#1{%
2607 \expandafter\let\expandafter\rmfont\csname #1rm\endcsname
2608 \expandafter\let\expandafter\itfont\csname #1it\endcsname
2609 \expandafter\let\expandafter\slfont\csname #1sl\endcsname
2610 \expandafter\let\expandafter\bffont\csname #1bf\endcsname
2611 \expandafter\let\expandafter\ttfont\csname #1tt\endcsname
2612 \expandafter\let\expandafter\smallcaps\csname #1sc\endcsname
2613 \expandafter\let\expandafter\sffont \csname #1sf\endcsname
2614 \expandafter\let\expandafter\ifont \csname #1i\endcsname
2615 \expandafter\let\expandafter\syfont \csname #1sy\endcsname
2616 \expandafter\let\expandafter\ttslfont\csname #1ttsl\endcsname
2621 % Select smaller font size with the current style. Used to change font size
2622 % in, e.g., the LaTeX logo and acronyms. If we are using bold fonts for
2623 % normal roman text, also use bold fonts for roman text in the smaller size.
2624 \def\switchtolllsize{%
2625 \expandafter\assignfonts\expandafter{\lllsize}%
2629 \csname\curfontstyle\endcsname
2632 \def\switchtolsize{%
2633 \expandafter\assignfonts\expandafter{\lsize}%
2637 \csname\curfontstyle\endcsname
2640 \def\definefontsetatsize#1#2#3#4#5{%
2641 \expandafter\def\csname #1fonts\endcsname{%
2642 \def\curfontsize{#1}%
2643 \def\lsize{#2}\def\lllsize{#3}%
2644 \csname rmisbold#5\endcsname
2650 \definefontsetatsize{text} {reduced}{smaller}{\textleading}{false}
2651 \definefontsetatsize{title} {chap} {subsec} {27pt} {true}
2652 \definefontsetatsize{chap} {sec} {text} {19pt} {true}
2653 \definefontsetatsize{sec} {subsec} {reduced}{17pt} {true}
2654 \definefontsetatsize{ssec} {text} {small} {15pt} {true}
2655 \definefontsetatsize{reduced}{small} {smaller}{10.5pt}{false}
2656 \definefontsetatsize{small} {smaller}{smaller}{10.5pt}{false}
2657 \definefontsetatsize{smaller}{smaller}{smaller}{9.5pt} {false}
2659 \def\titlefont#1{{\titlefonts\rm #1}}
2660 \let\subsecfonts = \ssecfonts
2661 \let\subsubsecfonts = \ssecfonts
2663 % Define these just so they can be easily changed for other fonts.
2664 \def\angleleft{$\langle$}
2665 \def\angleright{$\rangle$}
2667 % Set the fonts to use with the @small... environments.
2668 \let\smallexamplefonts = \smallfonts
2670 % About \smallexamplefonts. If we use \smallfonts (9pt), @smallexample
2671 % can fit this many characters:
2672 % 8.5x11=86 smallbook=72 a4=90 a5=69
2673 % If we use \scriptfonts (8pt), then we can fit this many characters:
2674 % 8.5x11=90+ smallbook=80 a4=90+ a5=77
2675 % For me, subjectively, the few extra characters that fit aren't worth
2676 % the additional smallness of 8pt. So I'm making the default 9pt.
2678 % By the way, for comparison, here's what fits with @example (10pt):
2679 % 8.5x11=71 smallbook=60 a4=75 a5=58
2682 % Set up the default fonts, so we can use them for creating boxes.
2684 \definetextfontsizexi
2687 % Check if we are currently using a typewriter font. Since all the
2688 % Computer Modern typewriter fonts have zero interword stretch (and
2689 % shrink), and it is reasonable to expect all typewriter fonts to have
2690 % this property, we can check that font parameter.
2692 \def\ifmonospace{\ifdim\fontdimen3\font=0pt }
2698 \gdef\setcodequotes{\let`\codequoteleft \let'\codequoteright}
2699 \gdef\setregularquotes{\let`\lq \let'\rq}
2702 % Allow an option to not use regular directed right quote/apostrophe
2703 % (char 0x27), but instead the undirected quote from cmtt (char 0x0d).
2704 % The undirected quote is ugly, so don't make it the default, but it
2705 % works for pasting with more pdf viewers (at least evince), the
2706 % lilypond developers report. xpdf does work with the regular 0x27.
2708 \def\codequoteright{%
2710 \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax
2711 \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax
2720 % and a similar option for the left quote char vs. a grave accent.
2721 % Modern fonts display ASCII 0x60 as a grave accent, so some people like
2722 % the code environments to do likewise.
2724 \def\codequoteleft{%
2726 \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax
2727 \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax
2728 % [Knuth] pp. 380,381,391
2729 % \relax disables Spanish ligatures ?` and !` of \tt font.
2738 % Commands to set the quote options.
2740 \parseargdef\codequoteundirected{%
2743 \expandafter\let\csname SETtxicodequoteundirected\endcsname
2745 \else\ifx\temp\offword
2746 \expandafter\let\csname SETtxicodequoteundirected\endcsname
2749 \errhelp = \EMsimple
2750 \errmessage{Unknown @codequoteundirected value `\temp', must be on|off}%
2754 \parseargdef\codequotebacktick{%
2757 \expandafter\let\csname SETtxicodequotebacktick\endcsname
2759 \else\ifx\temp\offword
2760 \expandafter\let\csname SETtxicodequotebacktick\endcsname
2763 \errhelp = \EMsimple
2764 \errmessage{Unknown @codequotebacktick value `\temp', must be on|off}%
2768 % [Knuth] pp. 380,381,391, disable Spanish ligatures ?` and !` of \tt font.
2769 \def\noligaturesquoteleft{\relax\lq}
2771 % Count depth in font-changes, for error checks
2772 \newcount\fontdepth \fontdepth=0
2776 % #1 is the font command (\sl or \it), #2 is the text to slant.
2777 % If we are in a monospaced environment, however, 1) always use \ttsl,
2778 % and 2) do not add an italic correction.
2779 \def\dosmartslant#1#2{%
2781 {{\ttsl #2}\let\next=\relax}%
2782 {\def\next{{#1#2}\futurelet\next\smartitaliccorrection}}%
2785 \def\smartslanted{\dosmartslant\sl}
2786 \def\smartitalic{\dosmartslant\it}
2788 % Output an italic correction unless \next (presumed to be the following
2789 % character) is such as not to need one.
2790 \def\smartitaliccorrection{%
2795 \else\ifx\next\comma%
2801 % Unconditional use \ttsl, and no ic. @var is set to this for defuns.
2802 \def\ttslanted#1{{\ttsl #1}}
2804 % @cite is like \smartslanted except unconditionally use \sl. We never want
2805 % ttsl for book titles, do we?
2806 \def\cite#1{{\sl #1}\futurelet\next\smartitaliccorrection}
2810 \let\saveaftersmartic = \aftersmartic
2811 \def\aftersmartic{\null\let\aftersmartic=\saveaftersmartic}%
2816 \let\slanted=\smartslanted
2817 \let\dfn=\smartslanted
2818 \let\emph=\smartitalic
2820 % Explicit font changes: @r, @sc, undocumented @ii.
2821 \def\r#1{{\rm #1}} % roman font
2822 \def\sc#1{{\smallcaps#1}} % smallcaps font
2823 \def\ii#1{{\it #1}} % italic font
2825 % @b, explicit bold. Also @strong.
2829 % @sansserif, explicit sans.
2830 \def\sansserif#1{{\sf #1}}
2832 % We can't just use \exhyphenpenalty, because that only has effect at
2833 % the end of a paragraph. Restore normal hyphenation at the end of the
2834 % group within which \nohyphenation is presumably called.
2836 \def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation}
2837 \def\restorehyphenation{\hyphenchar\font = `- }
2839 % Set sfcode to normal for the chars that usually have another value.
2840 % Can't use plain's \frenchspacing because it uses the `\x notation, and
2841 % sometimes \x has an active definition that messes things up.
2844 \def\plainfrenchspacing{%
2845 \sfcode`\.=\@m \sfcode`\?=\@m \sfcode`\!=\@m
2846 \sfcode`\:=\@m \sfcode`\;=\@m \sfcode`\,=\@m
2847 \def\endofsentencespacefactor{1000}% for @. and friends
2849 \def\plainnonfrenchspacing{%
2850 \sfcode`\.3000\sfcode`\?3000\sfcode`\!3000
2851 \sfcode`\:2000\sfcode`\;1500\sfcode`\,1250
2852 \def\endofsentencespacefactor{3000}% for @. and friends
2855 \def\endofsentencespacefactor{3000}% default
2857 % @t, explicit typewriter.
2859 {\tt \plainfrenchspacing #1}%
2864 \def\samp#1{{\setcodequotes\lq\tclose{#1}\rq\null}}
2866 % @indicateurl is \samp, that is, with quotes.
2867 \let\indicateurl=\samp
2869 % @code (and similar) prints in typewriter, but with spaces the same
2870 % size as normal in the surrounding text, without hyphenation, etc.
2871 % This is a subroutine for that.
2874 % Change normal interword space to be same as for the current font.
2875 \spaceskip = \fontdimen2\font
2877 % Switch to typewriter.
2880 % But `\ ' produces the large typewriter interword space.
2881 \def\ {{\spaceskip = 0pt{} }}%
2883 % Turn off hyphenation.
2889 \null % reset spacefactor to 1000
2892 % We *must* turn on hyphenation at `-' and `_' in @code.
2893 % (But see \codedashfinish below.)
2894 % Otherwise, it is too hard to avoid overfull hboxes
2895 % in the Emacs manual, the Library manual, etc.
2897 % Unfortunately, TeX uses one parameter (\hyphenchar) to control
2898 % both hyphenation at - and hyphenation within words.
2899 % We must therefore turn them both off (\tclose does that)
2900 % and arrange explicitly to hyphenate at a dash. -- rms.
2902 \catcode`\-=\active \catcode`\_=\active
2903 \catcode`\'=\active \catcode`\`=\active
2904 \global\let'=\rq \global\let`=\lq % default definitions
2906 \global\def\code{\begingroup
2908 \catcode\dashChar=\active \catcode\underChar=\active
2916 % Given -foo (with a single dash), we do not want to allow a break
2918 \global\let\codedashprev=\codedash
2923 \gdef\codedash{\futurelet\next\codedashfinish}
2924 \gdef\codedashfinish{%
2925 \normaldash % always output the dash character itself.
2927 % Now, output a discretionary to allow a line break, unless
2928 % (a) the next character is a -, or
2929 % (b) the preceding character is a -.
2930 % E.g., given --posix, we do not want to allow a break after either -.
2931 % Given --foo-bar, we do want to allow a break between the - and the b.
2932 \ifx\next\codedash \else
2933 \ifx\codedashprev\codedash
2934 \else \discretionary{}{}{}\fi
2936 % we need the space after the = for the case when \next itself is a
2937 % space token; it would get swallowed otherwise. As in @code{- a}.
2938 \global\let\codedashprev= \next
2943 \def\codex #1{\tclose{#1}\endgroup}
2946 % this is all so @math{@code{var_name}+1} can work. In math mode, _
2947 % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.)
2948 % will therefore expand the active definition of _, which is us
2949 % (inside @code that is), therefore an endless loop.
2951 \mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_.
2952 \else\normalunderscore \fi
2953 \discretionary{}{}{}}%
2957 % An additional complication: the above will allow breaks after, e.g.,
2958 % each of the four underscores in __typeof__. This is bad.
2959 % @allowcodebreaks provides a document-level way to turn breaking at -
2962 \newif\ifallowcodebreaks \allowcodebreakstrue
2964 \def\keywordtrue{true}
2965 \def\keywordfalse{false}
2967 \parseargdef\allowcodebreaks{%
2969 \ifx\txiarg\keywordtrue
2970 \allowcodebreakstrue
2971 \else\ifx\txiarg\keywordfalse
2972 \allowcodebreaksfalse
2974 \errhelp = \EMsimple
2975 \errmessage{Unknown @allowcodebreaks option `\txiarg', must be true|false}%
2979 % For @command, @env, @file, @option quotes seem unnecessary,
2980 % so use \code rather than \samp.
2986 % @uref (abbreviation for `urlref') aka @url takes an optional
2987 % (comma-separated) second argument specifying the text to display and
2988 % an optional third arg as text to display instead of (rather than in
2989 % addition to) the url itself. First (mandatory) arg is the url.
2991 % TeX-only option to allow changing PDF output to show only the second
2992 % arg (if given), and not the url (which is then just the link target).
2993 \newif\ifurefurlonlylink
2995 % The default \pretolerance setting stops the penalty inserted in
2996 % \urefallowbreak being a discouragement to line breaking. Set it to
2997 % a negative value for this paragraph only. Hopefully this does not
2998 % conflict with redefinitions of \par done elsewhere.
2999 \def\nopretolerance{%
3001 \def\par{\endgraf\pretolerance=100 \let\par\endgraf}%
3004 % The main macro is \urefbreak, which allows breaking at expected
3005 % places within the url.
3006 \def\urefbreak{\nopretolerance \begingroup \urefcatcodes \dourefbreak}
3007 \let\uref=\urefbreak
3009 \def\dourefbreak#1{\urefbreakfinish #1,,,\finish}
3010 \def\urefbreakfinish#1,#2,#3,#4\finish{% doesn't work in @example
3013 \setbox0 = \hbox{\ignorespaces #3}%
3015 \unhbox0 % third arg given, show only that
3017 \setbox0 = \hbox{\ignorespaces #2}% look for second arg
3020 % For pdfTeX and LuaTeX
3022 % PDF plus option to not display url, show just arg
3025 % PDF, normally display both arg and url for consistency,
3026 % visibility, if the pdf is eventually used to print, etc.
3027 \unhbox0\ (\urefcode{#1})%
3030 \ifx\XeTeXrevision\thisisundefined
3031 \unhbox0\ (\urefcode{#1})% DVI, always show arg and url
3035 % PDF plus option to not display url, show just arg
3038 % PDF, normally display both arg and url for consistency,
3039 % visibility, if the pdf is eventually used to print, etc.
3040 \unhbox0\ (\urefcode{#1})%
3045 \urefcode{#1}% only url given, so show it
3051 % Allow line breaks around only a few characters (only).
3053 \catcode`\&=\active \catcode`\.=\active
3054 \catcode`\#=\active \catcode`\?=\active
3060 \global\def\urefcode{\begingroup
3071 % By default, they are just regular characters.
3072 \global\def&{\normalamp}
3073 \global\def.{\normaldot}
3074 \global\def#{\normalhash}
3075 \global\def?{\normalquest}
3076 \global\def/{\normalslash}
3079 \def\urefcodeamp{\urefprebreak \&\urefpostbreak}
3080 \def\urefcodedot{\urefprebreak .\urefpostbreak}
3081 \def\urefcodehash{\urefprebreak \#\urefpostbreak}
3082 \def\urefcodequest{\urefprebreak ?\urefpostbreak}
3083 \def\urefcodeslash{\futurelet\next\urefcodeslashfinish}
3086 \global\def\urefcodeslashfinish{%
3087 \urefprebreak \slashChar
3088 % Allow line break only after the final / in a sequence of
3089 % slashes, to avoid line break between the slashes in http://.
3090 \ifx\next/\else \urefpostbreak \fi
3094 % By default we'll break after the special characters, but some people like to
3095 % break before the special chars, so allow that. Also allow no breaking at
3096 % all, for manual control.
3098 \parseargdef\urefbreakstyle{%
3100 \ifx\txiarg\wordnone
3101 \def\urefprebreak{\nobreak}\def\urefpostbreak{\nobreak}
3102 \else\ifx\txiarg\wordbefore
3103 \def\urefprebreak{\urefallowbreak}\def\urefpostbreak{\nobreak}
3104 \else\ifx\txiarg\wordafter
3105 \def\urefprebreak{\nobreak}\def\urefpostbreak{\urefallowbreak}
3107 \errhelp = \EMsimple
3108 \errmessage{Unknown @urefbreakstyle setting `\txiarg'}%
3111 \def\wordafter{after}
3112 \def\wordbefore{before}
3115 % Allow a ragged right output to aid breaking long URL's. There can
3116 % be a break at the \allowbreak with no extra glue (if the existing stretch in
3117 % the line is sufficient), a break at the \penalty with extra glue added
3118 % at the end of the line, or no break at all here.
3119 % Changing the value of the penalty and/or the amount of stretch affects how
3120 % preferable one choice is over the other.
3121 \def\urefallowbreak{%
3123 \hskip 0pt plus 2 em\relax
3125 \hskip 0pt plus -2 em\relax
3128 \urefbreakstyle after
3130 % @url synonym for @uref, since that's how everyone uses it.
3134 % rms does not like angle brackets --karl, 17may97.
3135 % So now @email is just like @uref, unless we are pdf.
3137 %\def\email#1{\angleleft{\tt #1}\angleright}
3139 \def\email#1{\doemail#1,,\finish}
3140 \def\doemail#1,#2,#3\finish{\begingroup
3143 \setbox0 = \hbox{\ignorespaces #2}%
3144 \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi
3151 % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
3152 % `example' (@kbd uses ttsl only inside of @example and friends),
3153 % or `code' (@kbd uses normal tty font always).
3154 \parseargdef\kbdinputstyle{%
3156 \ifx\txiarg\worddistinct
3157 \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
3158 \else\ifx\txiarg\wordexample
3159 \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
3160 \else\ifx\txiarg\wordcode
3161 \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
3163 \errhelp = \EMsimple
3164 \errmessage{Unknown @kbdinputstyle setting `\txiarg'}%
3167 \def\worddistinct{distinct}
3168 \def\wordexample{example}
3171 % Default is `distinct'.
3172 \kbdinputstyle distinct
3175 \tclose{\kbdfont\setcodequotes#1}%
3178 % definition of @key that produces a lozenge. Doesn't adjust to text size.
3179 %\setfont\keyrm\rmshape{8}{1000}{OT1}
3181 %\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{%
3182 % \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
3183 % \vbox{\hrule\kern-0.4pt
3184 % \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
3185 % \kern-0.4pt\hrule}%
3186 % \kern-.06em\raise0.4pt\hbox{\angleright}}}}
3188 % definition of @key with no lozenge.
3190 \def\key#1{{\setregularquotes \nohyphenation \tt #1}\null}
3192 % @clicksequence{File @click{} Open ...}
3193 \def\clicksequence#1{\begingroup #1\endgroup}
3195 % @clickstyle @arrow (by default)
3196 \parseargdef\clickstyle{\def\click{#1}}
3199 % Typeset a dimension, e.g., `in' or `pt'. The only reason for the
3200 % argument is to make the input look right: @dmn{pt} instead of @dmn{}pt.
3202 \def\dmn#1{\thinspace #1}
3204 % @acronym for "FBI", "NATO", and the like.
3205 % We print this one point size smaller, since it's intended for
3208 \def\acronym#1{\doacronym #1,,\finish}
3209 \def\doacronym#1,#2,#3\finish{%
3210 {\switchtolsize #1}%
3212 \ifx\temp\empty \else
3213 \space ({\unsepspaces \ignorespaces \temp \unskip})%
3215 \null % reset \spacefactor=1000
3218 % @abbr for "Comput. J." and the like.
3219 % No font change, but don't do end-of-sentence spacing.
3221 \def\abbr#1{\doabbr #1,,\finish}
3222 \def\doabbr#1,#2,#3\finish{%
3223 {\plainfrenchspacing #1}%
3225 \ifx\temp\empty \else
3226 \space ({\unsepspaces \ignorespaces \temp \unskip})%
3228 \null % reset \spacefactor=1000
3231 % @asis just yields its argument. Used with @table, for example.
3235 % @math outputs its argument in math mode.
3237 % One complication: _ usually means subscripts, but it could also mean
3238 % an actual _ character, as in @math{@var{some_variable} + 1}. So make
3239 % _ active, and distinguish by seeing if the current family is \slfam,
3240 % which is what @var uses.
3242 \catcode`\_ = \active
3243 \gdef\mathunderscore{%
3245 \def_{\ifnum\fam=\slfam \_\else\sb\fi}%
3248 % Another complication: we want \\ (and @\) to output a math (or tt) \.
3249 % FYI, plain.tex uses \\ as a temporary control sequence (for no
3250 % particular reason), but this is not advertised and we don't care.
3252 % The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.
3253 \def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi}
3256 \ifmmode\else % only go into math if not in math mode already
3259 \let\\ = \mathbackslash
3261 % make the texinfo accent commands work in math mode
3271 % have to provide another name for sup operator
3273 $\expandafter\finishmath\fi
3275 \def\finishmath#1{#1$\endgroup} % Close the group opened by \tex.
3277 % Some active characters (such as <) are spaced differently in math.
3278 % We have to reset their definitions in case the @math was an argument
3279 % to a command which sets the catcodes (such as @item or @section).
3282 \catcode`^ = \active
3283 \catcode`< = \active
3284 \catcode`> = \active
3285 \catcode`+ = \active
3286 \catcode`' = \active
3292 \let' = \ptexquoteright
3296 % for @sub and @sup, if in math mode, just do a normal sub/superscript.
3297 % If in text, use math to place as sub/superscript, but switch
3298 % into text mode, with smaller fonts. This is a different font than the
3299 % one used for real math sub/superscripts (8pt vs. 7pt), but let's not
3300 % fix it (significant additions to font machinery) until someone notices.
3302 \def\sub{\ifmmode \expandafter\sb \else \expandafter\finishsub\fi}
3303 \def\finishsub#1{$\sb{\hbox{\switchtolllsize #1}}$}%
3305 \def\sup{\ifmmode \expandafter\ptexsp \else \expandafter\finishsup\fi}
3306 \def\finishsup#1{$\ptexsp{\hbox{\switchtolllsize #1}}$}%
3308 % provide this command from LaTeX as it is very common
3309 \def\frac#1#2{{{#1}\over{#2}}}
3312 % \globaldefs is needed to recognize the end lines in \tex and
3313 % \end tex. Set \thisenv as @end displaymath is seen before @end tex.
3316 \envdef\displaymath{%
3318 \def\thisenv{\displaymath}%
3319 \begingroup\let\end\displaymathend%
3323 \def\displaymathend{$$\endgroup\end}%
3331 % @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}.
3332 % Ignore unless FMTNAME == tex; then it is like @iftex and @tex,
3333 % except specified as a normal braced arg, so no newlines to worry about.
3335 \def\outfmtnametex{tex}
3337 \long\def\inlinefmt#1{\doinlinefmt #1,\finish}
3338 \long\def\doinlinefmt#1,#2,\finish{%
3339 \def\inlinefmtname{#1}%
3340 \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\fi
3343 % @inlinefmtifelse{FMTNAME,THEN-TEXT,ELSE-TEXT} expands THEN-TEXT if
3344 % FMTNAME is tex, else ELSE-TEXT.
3345 \long\def\inlinefmtifelse#1{\doinlinefmtifelse #1,,,\finish}
3346 \long\def\doinlinefmtifelse#1,#2,#3,#4,\finish{%
3347 \def\inlinefmtname{#1}%
3348 \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\else \ignorespaces #3\fi
3351 % For raw, must switch into @tex before parsing the argument, to avoid
3352 % setting catcodes prematurely. Doing it this way means that, for
3353 % example, @inlineraw{html, foo{bar} gets a parse error instead of being
3354 % ignored. But this isn't important because if people want a literal
3355 % *right* brace they would have to use a command anyway, so they may as
3356 % well use a command to get a left brace too. We could re-use the
3357 % delimiter character idea from \verb, but it seems like overkill.
3359 \long\def\inlineraw{\tex \doinlineraw}
3360 \long\def\doinlineraw#1{\doinlinerawtwo #1,\finish}
3361 \def\doinlinerawtwo#1,#2,\finish{%
3362 \def\inlinerawname{#1}%
3363 \ifx\inlinerawname\outfmtnametex \ignorespaces #2\fi
3364 \endgroup % close group opened by \tex.
3367 % @inlineifset{VAR, TEXT} expands TEXT if VAR is @set.
3369 \long\def\inlineifset#1{\doinlineifset #1,\finish}
3370 \long\def\doinlineifset#1,#2,\finish{%
3371 \def\inlinevarname{#1}%
3372 \expandafter\ifx\csname SET\inlinevarname\endcsname\relax
3373 \else\ignorespaces#2\fi
3376 % @inlineifclear{VAR, TEXT} expands TEXT if VAR is not @set.
3378 \long\def\inlineifclear#1{\doinlineifclear #1,\finish}
3379 \long\def\doinlineifclear#1,#2,\finish{%
3380 \def\inlinevarname{#1}%
3381 \expandafter\ifx\csname SET\inlinevarname\endcsname\relax \ignorespaces#2\fi
3388 % @@ prints an @, as does @atchar{}.
3392 % @{ @} @lbracechar{} @rbracechar{} all generate brace characters.
3393 \def\lbracechar{{\ifmonospace\char123\else\ensuremath\lbrace\fi}}
3394 \def\rbracechar{{\ifmonospace\char125\else\ensuremath\rbrace\fi}}
3398 % @comma{} to avoid , parsing problems.
3401 % Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
3402 % Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H.
3404 \let\dotaccent = \ptexdot
3405 \def\ringaccent#1{{\accent23 #1}}
3406 \let\tieaccent = \ptext
3407 \let\ubaraccent = \ptexb
3408 \let\udotaccent = \d
3410 % Other special characters: @questiondown @exclamdown @ordf @ordm
3411 % Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
3412 \def\questiondown{?`}
3414 \def\ordf{\leavevmode\raise1ex\hbox{\switchtolllsize \underbar{a}}}
3415 \def\ordm{\leavevmode\raise1ex\hbox{\switchtolllsize \underbar{o}}}
3417 % Dotless i and dotless j, used for accents.
3422 \ifx\temp\imacro \ifmmode\imath \else\ptexi \fi
3423 \else\ifx\temp\jmacro \ifmmode\jmath \else\j \fi
3424 \else \errmessage{@dotless can be used only with i or j}%
3428 % The \TeX{} logo, as in plain, but resetting the spacing so that a
3429 % period following counts as ending a sentence. (Idea found in latex.)
3431 \edef\TeX{\TeX \spacefactor=1000 }
3433 % @LaTeX{} logo. Not quite the same results as the definition in
3434 % latex.ltx, since we use a different font for the raised A; it's most
3435 % convenient for us to use an explicitly smaller font, rather than using
3436 % the \scriptstyle font (since we don't reset \scriptstyle and
3437 % \scriptscriptstyle).
3442 \vbox to \ht0{\hbox{%
3443 \ifx\textnominalsize\xwordpt
3444 % for 10pt running text, lllsize (8pt) is too small for the A in LaTeX.
3445 % Revert to plain's \scriptsize, which is 7pt.
3446 \count255=\the\fam $\fam\count255 \scriptstyle A$%
3448 % For 11pt, we can use our lllsize.
3458 % Some math mode symbols. Define \ensuremath to switch into math mode
3459 % unless we are already there. Expansion tricks may not be needed here,
3460 % but safer, and can't hurt.
3461 \def\ensuremath{\ifmmode \expandafter\asis \else\expandafter\ensuredmath \fi}
3462 \def\ensuredmath#1{$\relax#1$}
3464 \def\bullet{\ensuremath\ptexbullet}
3465 \def\geq{\ensuremath\ge}
3466 \def\leq{\ensuremath\le}
3467 \def\minus{\ensuremath-}
3469 % @dots{} outputs an ellipsis using the current font.
3470 % We do .5em per period so that it has the same spacing in the cm
3471 % typewriter fonts as three actual period characters; on the other hand,
3472 % in other typewriter fonts three periods are wider than 1.5em. So do
3473 % whichever is larger.
3477 \setbox0=\hbox{...}% get width of three periods
3484 \hskip 0pt plus.25fil
3485 .\hskip 0pt plus1fil
3486 .\hskip 0pt plus1fil
3487 .\hskip 0pt plus.5fil
3491 % @enddots{} is an end-of-sentence ellipsis.
3495 \spacefactor=\endofsentencespacefactor
3498 % @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
3500 % Since these characters are used in examples, they should be an even number of
3501 % \tt widths. Each \tt character is 1en, so two makes it 1em.
3504 \def\arrow{\leavevmode\raise.05ex\hbox to 1em{\hfil$\rightarrow$\hfil}}
3505 \def\result{\leavevmode\raise.05ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}
3506 \def\expansion{\leavevmode\hbox to 1em{\hfil$\mapsto$\hfil}}
3507 \def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}}
3508 \def\equiv{\leavevmode\hbox to 1em{\hfil$\ptexequiv$\hfil}}
3510 % The @error{} command.
3511 % Adapted from the TeXbook's \boxit.
3515 {\ttfont \global\dimen0 = 3em}% Width of the box.
3516 \dimen2 = .55pt % Thickness of rules
3517 % The text. (`r' is open on the right, `e' somewhat less so on the left.)
3518 \setbox0 = \hbox{\kern-.75pt \reducedsf \putworderror\kern-1.5pt}
3520 \setbox\errorbox=\hbox to \dimen0{\hfil
3521 \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
3522 \advance\hsize by -2\dimen2 % Rules.
3524 \hrule height\dimen2
3525 \hbox{\vrule width\dimen2 \kern3pt % Space to left of text.
3526 \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below.
3527 \kern3pt\vrule width\dimen2}% Space to right.
3528 \hrule height\dimen2}
3531 \def\error{\leavevmode\lower.7ex\copy\errorbox}
3533 % @pounds{} is a sterling sign, which Knuth put in the CM italic font.
3535 \def\pounds{\ifmonospace{\ecfont\char"BF}\else{\it\$}\fi}
3537 % @euro{} comes from a separate font, depending on the current style.
3538 % We use the free feym* fonts from the eurosym package by Henrik
3539 % Theiling, which support regular, slanted, bold and bold slanted (and
3540 % "outlined" (blackboard board, sort of) versions, which we don't need).
3541 % It is available from http://www.ctan.org/tex-archive/fonts/eurosym.
3543 % Although only regular is the truly official Euro symbol, we ignore
3544 % that. The Euro is designed to be slightly taller than the regular
3550 % feybo - bold slanted
3552 % There is no good (free) typewriter version, to my knowledge.
3553 % A feymr10 euro is ~7.3pt wide, while a normal cmtt10 char is ~5.25pt wide.
3556 % Also doesn't work in math. Do we need to do math with euro symbols?
3560 \def\euro{{\eurofont e}}
3562 % We set the font at each command, rather than predefining it in
3563 % \textfonts and the other font-switching commands, so that
3564 % installations which never need the symbol don't have to have the
3567 % There is only one designed size (nominal 10pt), so we always scale
3568 % that to the current nominal size.
3570 % By the way, simply using "at 1em" works for cmr10 and the like, but
3571 % does not work for cmbx10 and other extended/shrunken fonts.
3573 \def\eurosize{\csname\curfontsize nominalsize\endcsname}%
3575 \ifx\curfontstyle\bfstylename
3577 \font\thiseurofont = \ifusingit{feybo10}{feybr10} at \eurosize
3580 \font\thiseurofont = \ifusingit{feymo10}{feymr10} at \eurosize
3585 % Glyphs from the EC fonts. We don't use \let for the aliases, because
3586 % sometimes we redefine the original macro, and the alias should reflect
3589 % Use LaTeX names for the Icelandic letters.
3590 \def\DH{{\ecfont \char"D0}} % Eth
3591 \def\dh{{\ecfont \char"F0}} % eth
3592 \def\TH{{\ecfont \char"DE}} % Thorn
3593 \def\th{{\ecfont \char"FE}} % thorn
3595 \def\guillemetleft{{\ecfont \char"13}}
3596 \def\guillemotleft{\guillemetleft}
3597 \def\guillemetright{{\ecfont \char"14}}
3598 \def\guillemotright{\guillemetright}
3599 \def\guilsinglleft{{\ecfont \char"0E}}
3600 \def\guilsinglright{{\ecfont \char"0F}}
3601 \def\quotedblbase{{\ecfont \char"12}}
3602 \def\quotesinglbase{{\ecfont \char"0D}}
3604 \def\L{{\ecfont \char"8A}} % L with stroke
3605 \def\l{{\ecfont \char"AA}} % l with stroke
3607 % This positioning is not perfect (see the ogonek LaTeX package), but
3608 % we have the precomposed glyphs for the most common cases. We put the
3609 % tests to use those glyphs in the single \ogonek macro so we have fewer
3610 % dummy definitions to worry about for index entries, etc.
3612 % ogonek is also used with other letters in Lithuanian (IOU), but using
3613 % the precomposed glyphs for those is not so easy since they aren't in
3617 \ifx\temp\macrocharA\Aogonek
3618 \else\ifx\temp\macrochara\aogonek
3619 \else\ifx\temp\macrocharE\Eogonek
3620 \else\ifx\temp\macrochare\eogonek
3622 \ecfont \setbox0=\hbox{#1}%
3623 \ifdim\ht0=1ex\accent"0C #1%
3624 \else\ooalign{\unhbox0\crcr\hidewidth\char"0C \hidewidth}%
3629 \def\Aogonek{{\ecfont \char"81}}\def\macrocharA{A}
3630 \def\aogonek{{\ecfont \char"A1}}\def\macrochara{a}
3631 \def\Eogonek{{\ecfont \char"86}}\def\macrocharE{E}
3632 \def\eogonek{{\ecfont \char"A6}}\def\macrochare{e}
3634 % Use the European Computer Modern fonts (cm-super in outline format)
3635 % for non-CM glyphs. That is ec* for regular text and tc* for the text
3636 % companion symbols (LaTeX TS1 encoding). Both are part of the ec
3637 % package and follow the same conventions.
3639 \def\ecfont{\etcfont{e}}
3640 \def\tcfont{\etcfont{t}}
3643 % We can't distinguish serif/sans and italic/slanted, but this
3644 % is used for crude hacks anyway (like adding French and German
3645 % quotes to documents typeset with CM, where we lose kerning), so
3646 % hopefully nobody will notice/care.
3647 \edef\ecsize{\csname\curfontsize ecsize\endcsname}%
3648 \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}%
3651 \font\thisecfont = #1ctt\ecsize \space at \nominalsize
3653 \ifx\curfontstyle\bfstylename
3655 \font\thisecfont = #1cb\ifusingit{i}{x}\ecsize \space at \nominalsize
3658 \font\thisecfont = #1c\ifusingit{ti}{rm}\ecsize \space at \nominalsize
3664 % @registeredsymbol - R in a circle. The font for the R should really
3665 % be smaller yet, but lllsize is the best we can do for now.
3666 % Adapted from the plain.tex definition of \copyright.
3668 \def\registeredsymbol{%
3669 $^{{\ooalign{\hfil\raise.07ex\hbox{\switchtolllsize R}%
3674 % @textdegree - the normal degrees sign.
3676 \def\textdegree{$^\circ$}
3678 % Laurent Siebenmann reports \Orb undefined with:
3679 % Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38
3680 % so we'll define it if necessary.
3682 \ifx\Orb\thisisundefined
3683 \def\Orb{\mathhexbox20D}
3687 \chardef\quoteleft=`\`
3688 \chardef\quoteright=`\'
3690 % only change font for tt for correct kerning and to avoid using
3691 % \ecfont unless necessary.
3693 \ifmonospace{\ecfont\char"10}\else{\char"5C}\fi
3696 \def\quotedblright{%
3697 \ifmonospace{\ecfont\char"11}\else{\char`\"}\fi
3701 \message{page headings,}
3703 \newskip\titlepagetopglue \titlepagetopglue = 1.5in
3704 \newskip\titlepagebottomglue \titlepagebottomglue = 2pc
3706 % First the title page. Must do @settitle before @titlepage.
3708 \newif\iffinishedtitlepage
3710 % @setcontentsaftertitlepage used to do an implicit @contents or
3711 % @shortcontents after @end titlepage, but it is now obsolete.
3712 \def\setcontentsaftertitlepage{%
3713 \errmessage{@setcontentsaftertitlepage has been removed as a Texinfo
3714 command; move your @contents command if you want the contents
3715 after the title page.}}%
3716 \def\setshortcontentsaftertitlepage{%
3717 \errmessage{@setshortcontentsaftertitlepage has been removed as a Texinfo
3718 command; move your @shortcontents and @contents commands if you
3719 want the contents after the title page.}}%
3721 \parseargdef\shorttitlepage{%
3722 \begingroup \hbox{}\vskip 1.5in \chaprm \centerline{#1}%
3723 \endgroup\page\hbox{}\page}
3726 % Open one extra group, as we want to close it in the middle of \Etitlepage.
3728 \parindent=0pt \textfonts
3729 % Leave some space at the very top of the page.
3730 \vglue\titlepagetopglue
3731 % No rule at page bottom unless we print one at the top with @title.
3732 \finishedtitlepagetrue
3734 % Most title ``pages'' are actually two pages long, with space
3735 % at the top of the second. We don't want the ragged left on the second.
3736 \let\oldpage = \page
3738 \iffinishedtitlepage\else
3741 \let\page = \oldpage
3748 \iffinishedtitlepage\else
3751 % It is important to do the page break before ending the group,
3752 % because the headline and footline are only empty inside the group.
3753 % If we use the new definition of \page, we always get a blank page
3754 % after the title page, which we certainly don't want.
3758 % Need this before the \...aftertitlepage checks so that if they are
3759 % in effect the toc pages will come out with page numbers.
3763 \def\finishtitlepage{%
3764 \vskip4pt \hrule height 2pt width \hsize
3765 \vskip\titlepagebottomglue
3766 \finishedtitlepagetrue
3769 % Settings used for typesetting titles: no hyphenation, no indentation,
3770 % don't worry much about spacing, ragged right. This should be used
3771 % inside a \vbox, and fonts need to be set appropriately first. \par should
3772 % be specified before the end of the \vbox, since a vbox is a group.
3774 \def\raggedtitlesettings{%
3776 \hyphenpenalty=10000
3782 % Macros to be used within @titlepage:
3784 \let\subtitlerm=\rmfont
3785 \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}
3787 \parseargdef\title{%
3789 \vbox{\titlefonts \raggedtitlesettings #1\par}%
3790 % print a rule at the page bottom also.
3791 \finishedtitlepagefalse
3792 \vskip4pt \hrule height 4pt width \hsize \vskip4pt
3795 \parseargdef\subtitle{%
3797 {\subtitlefont \rightline{#1}}%
3800 % @author should come last, but may come many times.
3801 % It can also be used inside @quotation.
3803 \parseargdef\author{%
3804 \def\temp{\quotation}%
3806 \def\quotationauthor{#1}% printed in \Equotation.
3809 \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi
3810 {\secfonts\rm \leftline{#1}}%
3815 % Set up page headings and footings.
3817 \let\thispage=\folio
3819 \newtoks\evenheadline % headline on even pages
3820 \newtoks\oddheadline % headline on odd pages
3821 \newtoks\evenchapheadline% headline on even pages with a new chapter
3822 \newtoks\oddchapheadline % headline on odd pages with a new chapter
3823 \newtoks\evenfootline % footline on even pages
3824 \newtoks\oddfootline % footline on odd pages
3826 % Now make \makeheadline and \makefootline in Plain TeX use those variables
3827 \headline={{\textfonts\rm
3829 \ifodd\pageno\the\oddchapheadline\else\the\evenchapheadline\fi
3831 \ifodd\pageno\the\oddheadline\else\the\evenheadline\fi
3834 \footline={{\textfonts\rm \ifodd\pageno \the\oddfootline
3835 \else \the\evenfootline \fi}\HEADINGShook}
3836 \let\HEADINGShook=\relax
3838 % Commands to set those variables.
3839 % For example, this is what @headings on does
3840 % @evenheading @thistitle|@thispage|@thischapter
3841 % @oddheading @thischapter|@thispage|@thistitle
3842 % @evenfooting @thisfile||
3843 % @oddfooting ||@thisfile
3846 \def\evenheading{\parsearg\evenheadingxxx}
3847 \def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish}
3848 \def\evenheadingyyy #1\|#2\|#3\|#4\finish{%
3849 \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}
3850 \global\evenchapheadline=\evenheadline}
3852 \def\oddheading{\parsearg\oddheadingxxx}
3853 \def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish}
3854 \def\oddheadingyyy #1\|#2\|#3\|#4\finish{%
3855 \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}%
3856 \global\oddchapheadline=\oddheadline}
3858 \parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}%
3860 \def\evenfooting{\parsearg\evenfootingxxx}
3861 \def\evenfootingxxx #1{\evenfootingyyy #1\|\|\|\|\finish}
3862 \def\evenfootingyyy #1\|#2\|#3\|#4\finish{%
3863 \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
3865 \def\oddfooting{\parsearg\oddfootingxxx}
3866 \def\oddfootingxxx #1{\oddfootingyyy #1\|\|\|\|\finish}
3867 \def\oddfootingyyy #1\|#2\|#3\|#4\finish{%
3868 \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}%
3870 % Leave some space for the footline. Hopefully ok to assume
3871 % @evenfooting will not be used by itself.
3872 \global\advance\txipageheight by -12pt
3873 \global\advance\vsize by -12pt
3876 \parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}}
3878 % @evenheadingmarks top \thischapter <- chapter at the top of a page
3879 % @evenheadingmarks bottom \thischapter <- chapter at the bottom of a page
3881 % The same set of arguments for:
3886 % @everyheadingmarks
3887 % @everyfootingmarks
3889 % These define \getoddheadingmarks, \getevenheadingmarks,
3890 % \getoddfootingmarks, and \getevenfootingmarks, each to one of
3891 % \gettopheadingmarks, \getbottomheadingmarks.
3893 \def\evenheadingmarks{\headingmarks{even}{heading}}
3894 \def\oddheadingmarks{\headingmarks{odd}{heading}}
3895 \def\evenfootingmarks{\headingmarks{even}{footing}}
3896 \def\oddfootingmarks{\headingmarks{odd}{footing}}
3897 \parseargdef\everyheadingmarks{\headingmarks{even}{heading}{#1}
3898 \headingmarks{odd}{heading}{#1} }
3899 \parseargdef\everyfootingmarks{\headingmarks{even}{footing}{#1}
3900 \headingmarks{odd}{footing}{#1} }
3901 % #1 = even/odd, #2 = heading/footing, #3 = top/bottom.
3902 \def\headingmarks#1#2#3 {%
3903 \expandafter\let\expandafter\temp \csname get#3headingmarks\endcsname
3904 \global\expandafter\let\csname get#1#2marks\endcsname \temp
3907 \everyheadingmarks bottom
3908 \everyfootingmarks bottom
3910 % @headings double turns headings on for double-sided printing.
3911 % @headings single turns headings on for single-sided printing.
3912 % @headings off turns them off.
3913 % @headings on same as @headings double, retained for compatibility.
3914 % @headings after turns on double-sided headings after this page.
3915 % @headings doubleafter turns on double-sided headings after this page.
3916 % @headings singleafter turns on single-sided headings after this page.
3917 % By default, they are off at the start of a document,
3918 % and turned `on' after @end titlepage.
3920 \parseargdef\headings{\csname HEADINGS#1\endcsname}
3922 \def\headingsoff{% non-global headings elimination
3923 \evenheadline={\hfil}\evenfootline={\hfil}\evenchapheadline={\hfil}%
3924 \oddheadline={\hfil}\oddfootline={\hfil}\oddchapheadline={\hfil}%
3927 \def\HEADINGSoff{{\globaldefs=1 \headingsoff}} % global setting
3928 \HEADINGSoff % it's the default
3930 % When we turn headings on, set the page number to 1.
3933 \global\arabiccount = \pagecount
3936 % For double-sided printing, put current file name in lower left corner,
3937 % chapter name on inside top of right hand pages, document
3938 % title on inside top of left hand pages, and page numbers on outside top
3939 % edge of all pages.
3940 \def\HEADINGSdouble{%
3944 \let\contentsalignmacro = \chappager
3946 % For single-sided printing, chapter title goes across top left of page,
3947 % page number on top right.
3948 \def\HEADINGSsingle{%
3952 \def\HEADINGSon{\HEADINGSdouble}
3954 \def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex}
3955 \let\HEADINGSdoubleafter=\HEADINGSafter
3956 \def\HEADINGSdoublex{%
3957 \global\evenfootline={\hfil}
3958 \global\oddfootline={\hfil}
3959 \global\evenheadline={\line{\folio\hfil\thistitle}}
3960 \global\oddheadline={\line{\thischapter\hfil\folio}}
3961 \global\evenchapheadline={\line{\folio\hfil}}
3962 \global\oddchapheadline={\line{\hfil\folio}}
3963 \global\let\contentsalignmacro = \chapoddpage
3966 \def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex}
3967 \def\HEADINGSsinglex{%
3968 \global\evenfootline={\hfil}
3969 \global\oddfootline={\hfil}
3970 \global\evenheadline={\line{\thischapter\hfil\folio}}
3971 \global\oddheadline={\line{\thischapter\hfil\folio}}
3972 \global\evenchapheadline={\line{\hfil\folio}}
3973 \global\oddchapheadline={\line{\hfil\folio}}
3974 \global\let\contentsalignmacro = \chappager
3977 % for @setchapternewpage off
3978 \def\HEADINGSsinglechapoff{%
3980 \global\evenfootline={\hfil}
3981 \global\oddfootline={\hfil}
3982 \global\evenheadline={\line{\thischapter\hfil\folio}}
3983 \global\oddheadline={\line{\thischapter\hfil\folio}}
3984 \global\evenchapheadline=\evenheadline
3985 \global\oddchapheadline=\oddheadline
3986 \global\let\contentsalignmacro = \chappager
3989 % Subroutines used in generating headings
3990 % This produces Day Month Year style of output.
3991 % Only define if not already defined, in case a txi-??.tex file has set
3992 % up a different format (e.g., txi-cs.tex does this).
3993 \ifx\today\thisisundefined
3997 \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr
3998 \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug
3999 \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec
4004 % @settitle line... specifies the title of the document, for headings.
4005 % It generates no output of its own.
4006 \def\thistitle{\putwordNoTitle}
4007 \def\settitle{\parsearg{\gdef\thistitle}}
4011 % Tables -- @table, @ftable, @vtable, @item(x).
4013 % default indentation of table text
4014 \newdimen\tableindent \tableindent=.8in
4015 % default indentation of @itemize and @enumerate text
4016 \newdimen\itemindent \itemindent=.3in
4017 % margin between end of table item and start of table text.
4018 \newdimen\itemmargin \itemmargin=.1in
4020 % used internally for \itemindent minus \itemmargin
4023 % Note @table, @ftable, and @vtable define @item, @itemx, etc., with
4025 % They also define \itemindex
4026 % to index the item name in whatever manner is desired (perhaps none).
4028 \newif\ifitemxneedsnegativevskip
4030 \def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi}
4032 \def\internalBitem{\smallbreak \parsearg\itemzzz}
4033 \def\internalBitemx{\itemxpar \parsearg\itemzzz}
4035 \def\itemzzz #1{\begingroup %
4036 \advance\hsize by -\rightskip
4037 \advance\hsize by -\tableindent
4038 \setbox0=\hbox{\itemindicate{#1}}%
4040 \nobreak % This prevents a break before @itemx.
4042 % If the item text does not fit in the space we have, put it on a line
4043 % by itself, and do not allow a page break either before or after that
4044 % line. We do not start a paragraph here because then if the next
4045 % command is, e.g., @kindex, the whatsit would get put into the
4046 % horizontal list on a line by itself, resulting in extra blank space.
4047 \ifdim \wd0>\itemmax
4049 % Make this a paragraph so we get the \parskip glue and wrapping,
4050 % but leave it ragged-right.
4052 \advance\leftskip by-\tableindent
4053 \advance\hsize by\tableindent
4054 \advance\rightskip by0pt plus1fil\relax
4055 \leavevmode\unhbox0\par
4058 % We're going to be starting a paragraph, but we don't want the
4059 % \parskip glue -- logically it's part of the @item we just started.
4060 \nobreak \vskip-\parskip
4062 % Stop a page break at the \parskip glue coming up. However, if
4063 % what follows is an environment such as @example, there will be no
4064 % \parskip glue; then the negative vskip we just inserted would
4065 % cause the example and the item to crash together. So we use this
4066 % bizarre value of 10001 as a signal to \aboveenvbreak to insert
4067 % \parskip glue after all. Section titles are handled this way also.
4071 \itemxneedsnegativevskipfalse
4073 % The item text fits into the space. Start a paragraph, so that the
4074 % following text (if any) will end up on the same line.
4076 % Do this with kerns and \unhbox so that if there is a footnote in
4077 % the item text, it can migrate to the main vertical list and
4078 % eventually be printed.
4079 \nobreak\kern-\tableindent
4080 \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0
4082 \nobreak\kern\dimen0
4084 \itemxneedsnegativevskiptrue
4088 \def\item{\errmessage{@item while not in a list environment}}
4089 \def\itemx{\errmessage{@itemx while not in a list environment}}
4091 % @table, @ftable, @vtable.
4093 \let\itemindex\gobble
4097 \def\itemindex ##1{\doind {fn}{\code{##1}}}%
4098 \tablecheck{ftable}%
4101 \def\itemindex ##1{\doind {vr}{\code{##1}}}%
4102 \tablecheck{vtable}%
4105 \ifnum \the\catcode`\^^M=\active
4107 \errmessage{This command won't work in this context; perhaps the problem is
4108 that we are \inenvironment\thisenv}%
4109 \def\next{\doignore{#1}}%
4116 \def\itemindicate{#1}%
4121 \makevalueexpandable
4122 \edef\temp{\noexpand\tablez #1\space\space\space}%
4126 \def\tablez #1 #2 #3 #4\endtablez{%
4128 \ifnum 0#1>0 \advance \leftskip by #1\mil \fi
4129 \ifnum 0#2>0 \tableindent=#2\mil \fi
4130 \ifnum 0#3>0 \advance \rightskip by #3\mil \fi
4131 \itemmax=\tableindent
4132 \advance \itemmax by -\itemmargin
4133 \advance \leftskip by \tableindent
4134 \exdentamount=\tableindent
4136 \parskip = \smallskipamount
4137 \ifdim \parskip=0pt \parskip=2pt \fi
4138 \let\item = \internalBitem
4139 \let\itemx = \internalBitemx
4141 \def\Etable{\endgraf\afterenvbreak}
4144 \let\Eitemize\Etable
4145 \let\Eenumerate\Etable
4147 % This is the counter used by @enumerate, which is really @itemize
4151 \envdef\itemize{\parsearg\doitemize}
4155 \itemmax=\itemindent
4156 \advance\itemmax by -\itemmargin
4157 \advance\leftskip by \itemindent
4158 \exdentamount=\itemindent
4160 \parskip=\smallskipamount
4161 \ifdim\parskip=0pt \parskip=2pt \fi
4163 % Try typesetting the item mark so that if the document erroneously says
4164 % something like @itemize @samp (intending @table), there's an error
4165 % right away at the @itemize. It's not the best error message in the
4166 % world, but it's better than leaving it to the @item. This means if
4167 % the user wants an empty mark, they have to say @w{} not just @w.
4168 \def\itemcontents{#1}%
4169 \setbox0 = \hbox{\itemcontents}%
4171 % @itemize with no arg is equivalent to @itemize @bullet.
4172 \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi
4174 \let\item=\itemizeitem
4177 % Definition of @item while inside @itemize and @enumerate.
4180 \advance\itemno by 1 % for enumerations
4181 {\let\par=\endgraf \smallbreak}% reasonable place to break
4183 % If the document has an @itemize directly after a section title, a
4184 % \nobreak will be last on the list, and \sectionheading will have
4185 % done a \vskip-\parskip. In that case, we don't want to zero
4186 % parskip, or the item text will crash with the heading. On the
4187 % other hand, when there is normal text preceding the item (as there
4188 % usually is), we do want to zero parskip, or there would be too much
4189 % space. In that case, we won't have a \nobreak before. At least
4190 % that's the theory.
4191 \ifnum\lastpenalty<10000 \parskip=0in \fi
4193 \hbox to 0pt{\hss \itemcontents \kern\itemmargin}%
4196 \vadjust{\penalty 1200}% not good to break after first line of item.
4198 % We can be in inner vertical mode in a footnote, although an
4199 % @itemize looks awful there.
4204 % \splitoff TOKENS\endmark defines \first to be the first token in
4205 % TOKENS, and \rest to be the remainder.
4207 \def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
4209 % Allow an optional argument of an uppercase letter, lowercase letter,
4210 % or number, to specify the first label in the enumerated list. No
4211 % argument is the same as `1'.
4213 \envparseargdef\enumerate{\enumeratey #1 \endenumeratey}
4214 \def\enumeratey #1 #2\endenumeratey{%
4215 % If we were given no argument, pretend we were given `1'.
4217 \ifx\thearg\empty \def\thearg{1}\fi
4219 % Detect if the argument is a single token. If so, it might be a
4220 % letter. Otherwise, the only valid thing it can be is a number.
4221 % (We will always have one token, because of the test we just made.
4222 % This is a good thing, since \splitoff doesn't work given nothing at
4223 % all -- the first parameter is undelimited.)
4224 \expandafter\splitoff\thearg\endmark
4226 % Only one token in the argument. It could still be anything.
4227 % A ``lowercase letter'' is one whose \lccode is nonzero.
4228 % An ``uppercase letter'' is one whose \lccode is both nonzero, and
4229 % not equal to itself.
4230 % Otherwise, we assume it's a number.
4232 % We need the \relax at the end of the \ifnum lines to stop TeX from
4233 % continuing to look for a <number>.
4235 \ifnum\lccode\expandafter`\thearg=0\relax
4236 \numericenumerate % a number (we hope)
4239 \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax
4240 \lowercaseenumerate % lowercase letter
4242 \uppercaseenumerate % uppercase letter
4246 % Multiple tokens in the argument. We hope it's a number.
4251 % An @enumerate whose labels are integers. The starting integer is
4254 \def\numericenumerate{%
4256 \startenumeration{\the\itemno}%
4259 % The starting (lowercase) letter is in \thearg.
4260 \def\lowercaseenumerate{%
4261 \itemno = \expandafter`\thearg
4263 % Be sure we're not beyond the end of the alphabet.
4265 \errmessage{No more lowercase letters in @enumerate; get a bigger
4272 % The starting (uppercase) letter is in \thearg.
4273 \def\uppercaseenumerate{%
4274 \itemno = \expandafter`\thearg
4276 % Be sure we're not beyond the end of the alphabet.
4278 \errmessage{No more uppercase letters in @enumerate; get a bigger
4285 % Call \doitemize, adding a period to the first argument and supplying the
4286 % common last two arguments. Also subtract one from the initial value in
4287 % \itemno, since @item increments \itemno.
4289 \def\startenumeration#1{%
4290 \advance\itemno by -1
4291 \doitemize{#1.}\flushcr
4295 % @multitable macros
4297 % Macros used to set up halign preamble:
4299 \let\endsetuptable\relax
4300 \def\xendsetuptable{\endsetuptable}
4301 \let\columnfractions\relax
4302 \def\xcolumnfractions{\columnfractions}
4305 % #1 is the @columnfraction, usually a decimal number like .5, but might
4306 % be just 1. We just use it, whatever it is.
4308 \def\pickupwholefraction#1 {%
4309 \global\advance\colcount by 1
4310 \expandafter\xdef\csname col\the\colcount\endcsname{#1\hsize}%
4317 \ifx\firstarg\xendsetuptable
4320 \ifx\firstarg\xcolumnfractions
4321 \global\setpercenttrue
4324 \let\go\pickupwholefraction
4326 \global\advance\colcount by 1
4327 \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a
4328 % separator; typically that is always in the input, anyway.
4329 \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
4332 \ifx\go\pickupwholefraction
4333 % Put the argument back for the \pickupwholefraction call, so
4334 % we'll always have a period there to be parsed.
4335 \def\go{\pickupwholefraction#1}%
4337 \let\go = \setuptable
4343 % @headitem starts a heading row, which we typeset in bold. Assignments
4344 % have to be global since we are inside the implicit group of an
4345 % alignment entry. \everycr below resets \everytab so we don't have to
4346 % undo it ourselves.
4347 \def\headitemfont{\b}% for people to use in the template row; not changeable
4349 \checkenv\multitable
4351 \gdef\headitemcrhook{\nobreak}% attempt to avoid page break after headings
4352 \global\everytab={\bf}% can't use \headitemfont since the parsing differs
4353 \the\everytab % for the first item
4356 % default for tables with no headings.
4357 \let\headitemcrhook=\relax
4359 \def\tab{\checkenv\multitable &\the\everytab}%
4361 \newtoks\everytab % insert after every tab.
4363 \envdef\multitable{%
4367 % @item within a multitable starts a normal row.
4368 % We use \def instead of \let so that if one of the multitable entries
4369 % contains an @itemize, we don't choke on the \item (seen as \crcr aka
4370 % \endtemplate) expanding \doitemize.
4382 \global\everytab={}% Reset from possible headitem.
4383 \global\colcount=0 % Reset the column counter.
4385 % Check for saved footnotes, etc.:
4388 % Perhaps a \nobreak, then reset:
4390 \global\let\headitemcrhook=\relax
4394 \parsearg\domultitable
4396 \def\domultitable#1{%
4397 % To parse everything between @multitable and @item:
4398 \setuptable#1 \endsetuptable
4400 % This preamble sets up a generic column definition, which will
4401 % be used as many times as user calls for columns.
4402 % \vtop will set a single line and will also let text wrap and
4403 % continue for many paragraphs if desired.
4405 \global\advance\colcount by 1
4408 \advance\hsize by -1\leftskip
4409 % Find the correct column width
4410 \hsize=\expandafter\csname col\the\colcount\endcsname
4412 \advance\rightskip by -1\rightskip % Zero leaving only any stretch
4414 \advance\hsize by\leftskip % Add indent of surrounding text
4416 % In order to keep entries from bumping into each other.
4419 % If a template has been used
4420 \advance\hsize by \leftskip
4423 \noindent\ignorespaces##\unskip\strut
4428 \egroup % end the \halign
4429 \global\setpercentfalse
4433 \message{conditionals,}
4435 % @iftex, @ifnotdocbook, @ifnothtml, @ifnotinfo, @ifnotplaintext,
4436 % @ifnotxml always succeed. They currently do nothing; we don't
4437 % attempt to check whether the conditionals are properly nested. But we
4438 % have to remember that they are conditionals, so that @end doesn't
4439 % attempt to close an environment group.
4442 \expandafter\let\csname #1\endcsname = \relax
4443 \expandafter\let\csname iscond.#1\endcsname = 1
4446 \makecond{ifnotdocbook}
4447 \makecond{ifnothtml}
4448 \makecond{ifnotinfo}
4449 \makecond{ifnotplaintext}
4452 % Ignore @ignore, @ifhtml, @ifinfo, and the like.
4454 \def\direntry{\doignore{direntry}}
4455 \def\documentdescription{\doignore{documentdescription}}
4456 \def\docbook{\doignore{docbook}}
4457 \def\html{\doignore{html}}
4458 \def\ifdocbook{\doignore{ifdocbook}}
4459 \def\ifhtml{\doignore{ifhtml}}
4460 \def\ifinfo{\doignore{ifinfo}}
4461 \def\ifnottex{\doignore{ifnottex}}
4462 \def\ifplaintext{\doignore{ifplaintext}}
4463 \def\ifxml{\doignore{ifxml}}
4464 \def\ignore{\doignore{ignore}}
4465 \def\menu{\doignore{menu}}
4466 \def\xml{\doignore{xml}}
4468 % Ignore text until a line `@end #1', keeping track of nested conditionals.
4470 % A count to remember the depth of nesting.
4471 \newcount\doignorecount
4473 \def\doignore#1{\begingroup
4474 % Scan in ``verbatim'' mode:
4476 \catcode`\@ = \other
4477 \catcode`\{ = \other
4478 \catcode`\} = \other
4480 % Make sure that spaces turn into tokens that match what \doignoretext wants.
4483 % Count number of #1's that we've seen.
4486 % Swallow text until we reach the matching `@end #1'.
4490 { \catcode`_=11 % We want to use \_STOP_ which cannot appear in texinfo source.
4493 \gdef\dodoignore#1{%
4494 % #1 contains the command name as a string, e.g., `ifinfo'.
4496 % Define a command to find the next `@end #1'.
4497 \long\def\doignoretext##1^^M@end #1{%
4498 \doignoretextyyy##1^^M@#1\_STOP_}%
4500 % And this command to find another #1 command, at the beginning of a
4501 % line. (Otherwise, we would consider a line `@c @ifset', for
4502 % example, to count as an @ifset for nesting.)
4503 \long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}%
4505 % And now expand that command.
4510 \def\doignoreyyy#1{%
4512 \ifx\temp\empty % Nothing found.
4513 \let\next\doignoretextzzz
4514 \else % Found a nested condition, ...
4515 \advance\doignorecount by 1
4516 \let\next\doignoretextyyy % ..., look for another.
4517 % If we're here, #1 ends with ^^M\ifinfo (for example).
4519 \next #1% the token \_STOP_ is present just after this macro.
4522 % We have to swallow the remaining "\_STOP_".
4524 \def\doignoretextzzz#1{%
4525 \ifnum\doignorecount = 0 % We have just found the outermost @end.
4526 \let\next\enddoignore
4527 \else % Still inside a nested condition.
4528 \advance\doignorecount by -1
4529 \let\next\doignoretext % Look for the next @end.
4534 % Finish off ignored text.
4536 % Ignore anything after the last `@end #1'; this matters in verbatim
4537 % environments, where otherwise the newline after an ignored conditional
4538 % would result in a blank line in the output.
4539 \gdef\enddoignore#1^^M{\endgroup\ignorespaces}%
4543 % @set VAR sets the variable VAR to an empty value.
4544 % @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
4546 % Since we want to separate VAR from REST-OF-LINE (which might be
4547 % empty), we can't just use \parsearg; we have to insert a space of our
4548 % own to delimit the rest of the line, and then take it out again if we
4550 % We rely on the fact that \parsearg sets \catcode`\ =10.
4552 \parseargdef\set{\setyyy#1 \endsetyyy}
4553 \def\setyyy#1 #2\endsetyyy{%
4555 \makevalueexpandable
4557 \edef\next{\gdef\makecsname{SET#1}}%
4565 % Remove the trailing space \setxxx inserted.
4566 \def\setzzz#1 \endsetzzz{\next{#1}}
4568 % @clear VAR clears (i.e., unsets) the variable VAR.
4570 \parseargdef\clear{%
4572 \makevalueexpandable
4573 \global\expandafter\let\csname SET#1\endcsname=\relax
4577 % @value{foo} gets the text saved in variable foo.
4578 \def\value{\begingroup\makevalueexpandable\valuexxx}
4579 \def\valuexxx#1{\expandablevalue{#1}\endgroup}
4581 \catcode`\-=\active \catcode`\_=\active
4583 \gdef\makevalueexpandable{%
4584 \let\value = \expandablevalue
4585 % We don't want these characters active, ...
4586 \catcode`\-=\other \catcode`\_=\other
4587 % ..., but we might end up with active ones in the argument if
4588 % we're called from @code, as @code{@value{foo-bar_}}, though.
4589 % So \let them to their normal equivalents.
4590 \let-\normaldash \let_\normalunderscore
4594 \def\expandablevalue#1{%
4595 \expandafter\ifx\csname SET#1\endcsname\relax
4596 {[No value for ``#1'']}%
4597 \message{Variable `#1', used in @value, is not set.}%
4599 \csname SET#1\endcsname
4603 % Like \expandablevalue, but completely expandable (the \message in the
4604 % definition above operates at the execution level of TeX). Used when
4605 % writing to auxiliary files, due to the expansion that \write does.
4606 % If flag is undefined, pass through an unexpanded @value command: maybe it
4607 % will be set by the time it is read back in.
4609 % NB flag names containing - or _ may not work here.
4611 \expandafter\ifx\csname SET#1\endcsname\relax
4614 \csname SET#1\endcsname
4618 % Used for @value's in index entries to form the sort key: expand the @value
4619 % if possible, otherwise sort late.
4620 \def\indexnofontsvalue#1{%
4621 \expandafter\ifx\csname SET#1\endcsname\relax
4624 \csname SET#1\endcsname
4628 % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
4631 % To get the special treatment we need for `@end ifset,' we call
4632 % \makecond and then redefine.
4635 \def\ifset{\parsearg{\doifset{\let\next=\ifsetfail}}}
4638 \makevalueexpandable
4640 \expandafter\ifx\csname SET#2\endcsname\relax
4641 #1% If not set, redefine \next.
4646 \def\ifsetfail{\doignore{ifset}}
4648 % @ifclear VAR ... @end executes the `...' iff VAR has never been
4649 % defined with @set, or has been undefined with @clear.
4651 % The `\else' inside the `\doifset' parameter is a trick to reuse the
4652 % above code: if the variable is not set, do nothing, if it is set,
4653 % then redefine \next to \ifclearfail.
4656 \def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}}
4657 \def\ifclearfail{\doignore{ifclear}}
4659 % @ifcommandisdefined CMD ... @end executes the `...' if CMD (written
4660 % without the @) is in fact defined. We can only feasibly check at the
4661 % TeX level, so something like `mathcode' is going to considered
4662 % defined even though it is not a Texinfo command.
4664 \makecond{ifcommanddefined}
4665 \def\ifcommanddefined{\parsearg{\doifcmddefined{\let\next=\ifcmddefinedfail}}}
4667 \def\doifcmddefined#1#2{{%
4668 \makevalueexpandable
4670 \expandafter\ifx\csname #2\endcsname\relax
4671 #1% If not defined, \let\next as above.
4676 \def\ifcmddefinedfail{\doignore{ifcommanddefined}}
4678 % @ifcommandnotdefined CMD ... handled similar to @ifclear above.
4679 \makecond{ifcommandnotdefined}
4680 \def\ifcommandnotdefined{%
4681 \parsearg{\doifcmddefined{\else \let\next=\ifcmdnotdefinedfail}}}
4682 \def\ifcmdnotdefinedfail{\doignore{ifcommandnotdefined}}
4684 % Set the `txicommandconditionals' variable, so documents have a way to
4685 % test if the @ifcommand...defined conditionals are available.
4686 \set txicommandconditionals
4688 % @dircategory CATEGORY -- specify a category of the dir file
4689 % which this file should belong to. Ignore this in TeX.
4690 \let\dircategory=\comment
4692 % @defininfoenclose.
4693 \let\definfoenclose=\comment
4697 % Index generation facilities
4699 % Define \newwrite to be identical to plain tex's \newwrite
4700 % except not \outer, so it can be used within macros and \if's.
4701 \edef\newwrite{\makecsname{ptexnewwrite}}
4703 % \newindex {foo} defines an index named IX.
4704 % It automatically defines \IXindex such that
4705 % \IXindex ...rest of line... puts an entry in the index IX.
4706 % It also defines \IXindfile to be the number of the output channel for
4707 % the file that accumulates this index. The file's extension is IX.
4708 % The name of an index should be no more than 2 characters long
4709 % for the sake of vms.
4712 \expandafter\chardef\csname#1indfile\endcsname=0
4713 \expandafter\xdef\csname#1index\endcsname{% % Define @#1index
4714 \noexpand\doindex{#1}}
4717 % @defindex foo == \newindex{foo}
4719 \def\defindex{\parsearg\newindex}
4721 % Define @defcodeindex, like @defindex except put all entries in @code.
4723 \def\defcodeindex{\parsearg\newcodeindex}
4725 \def\newcodeindex#1{%
4726 \expandafter\chardef\csname#1indfile\endcsname=0
4727 \expandafter\xdef\csname#1index\endcsname{%
4728 \noexpand\docodeindex{#1}}%
4731 % The default indices:
4732 \newindex{cp}% concepts,
4733 \newcodeindex{fn}% functions,
4734 \newcodeindex{vr}% variables,
4735 \newcodeindex{tp}% types,
4736 \newcodeindex{ky}% keys
4737 \newcodeindex{pg}% and programs.
4740 % @synindex foo bar makes index foo feed into index bar.
4741 % Do this instead of @defindex foo if you don't want it as a separate index.
4743 % @syncodeindex foo bar similar, but put all entries made for index foo
4746 \def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}}
4747 \def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}}
4749 % #1 is \doindex or \docodeindex, #2 the index getting redefined (foo),
4750 % #3 the target index (bar).
4751 \def\dosynindex#1#2#3{%
4752 \requireopenindexfile{#3}%
4753 % redefine \fooindfile:
4754 \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname
4755 \expandafter\let\csname#2indfile\endcsname=\temp
4756 % redefine \fooindex:
4757 \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}%
4760 % Define \doindex, the driver for all index macros.
4761 % Argument #1 is generated by the calling \fooindex macro,
4762 % and it is the two-letter name of the index.
4764 \def\doindex#1{\edef\indexname{#1}\parsearg\doindexxxx}
4765 \def\doindexxxx #1{\doind{\indexname}{#1}}
4767 % like the previous two, but they put @code around the argument.
4768 \def\docodeindex#1{\edef\indexname{#1}\parsearg\docodeindexxxx}
4769 \def\docodeindexxxx #1{\docind{\indexname}{#1}}
4772 % Used for the aux, toc and index files to prevent expansion of Texinfo
4776 \definedummyletter\@%
4777 \definedummyletter\ %
4778 \definedummyletter\{%
4779 \definedummyletter\}%
4780 \definedummyletter\&%
4782 % Do the redefinitions.
4787 % \definedummyword defines \#1 as \string\#1\space, thus effectively
4788 % preventing its expansion. This is used only for control words,
4789 % not control letters, because the \space would be incorrect for
4790 % control characters, but is needed to separate the control word
4791 % from whatever follows.
4793 % These can be used both for control words that take an argument and
4794 % those that do not. If it is followed by {arg} in the input, then
4795 % that will dutifully get written to the index (or wherever).
4797 % For control letters, we have \definedummyletter, which omits the
4800 \def\definedummyword #1{\def#1{\string#1\space}}%
4801 \def\definedummyletter#1{\def#1{\string#1}}%
4802 \let\definedummyaccent\definedummyletter
4804 % Called from \atdummies to prevent the expansion of commands.
4806 \def\definedummies{%
4808 \let\commondummyword\definedummyword
4809 \let\commondummyletter\definedummyletter
4810 \let\commondummyaccent\definedummyaccent
4811 \commondummiesnofonts
4813 \definedummyletter\_%
4814 \definedummyletter\-%
4816 % Non-English letters.
4827 \definedummyword\exclamdown
4831 \definedummyword\ordf
4832 \definedummyword\ordm
4833 \definedummyword\questiondown
4837 % Although these internal commands shouldn't show up, sometimes they do.
4839 \definedummyword\gtr
4840 \definedummyword\hat
4841 \definedummyword\less
4844 \definedummyword\tclose
4847 \definedummyword\LaTeX
4848 \definedummyword\TeX
4850 % Assorted special characters.
4851 \definedummyword\ampchar
4852 \definedummyword\atchar
4853 \definedummyword\arrow
4854 \definedummyword\backslashchar
4855 \definedummyword\bullet
4856 \definedummyword\comma
4857 \definedummyword\copyright
4858 \definedummyword\registeredsymbol
4859 \definedummyword\dots
4860 \definedummyword\enddots
4861 \definedummyword\entrybreak
4862 \definedummyword\equiv
4863 \definedummyword\error
4864 \definedummyword\euro
4865 \definedummyword\expansion
4866 \definedummyword\geq
4867 \definedummyword\guillemetleft
4868 \definedummyword\guillemetright
4869 \definedummyword\guilsinglleft
4870 \definedummyword\guilsinglright
4871 \definedummyword\lbracechar
4872 \definedummyword\leq
4873 \definedummyword\mathopsup
4874 \definedummyword\minus
4875 \definedummyword\ogonek
4876 \definedummyword\pounds
4877 \definedummyword\point
4878 \definedummyword\print
4879 \definedummyword\quotedblbase
4880 \definedummyword\quotedblleft
4881 \definedummyword\quotedblright
4882 \definedummyword\quoteleft
4883 \definedummyword\quoteright
4884 \definedummyword\quotesinglbase
4885 \definedummyword\rbracechar
4886 \definedummyword\result
4887 \definedummyword\sub
4888 \definedummyword\sup
4889 \definedummyword\textdegree
4891 \definedummyword\subentry
4893 % We want to disable all macros so that they are not expanded by \write.
4895 \let\value\dummyvalue
4897 \normalturnoffactive
4900 % \commondummiesnofonts: common to \definedummies and \indexnofonts.
4901 % Define \commondummyletter, \commondummyaccent and \commondummyword before
4902 % using. Used for accents, font commands, and various control letters.
4904 \def\commondummiesnofonts{%
4905 % Control letters and accents.
4906 \commondummyletter\!%
4907 \commondummyaccent\"%
4908 \commondummyaccent\'%
4909 \commondummyletter\*%
4910 \commondummyaccent\,%
4911 \commondummyletter\.%
4912 \commondummyletter\/%
4913 \commondummyletter\:%
4914 \commondummyaccent\=%
4915 \commondummyletter\?%
4916 \commondummyaccent\^%
4917 \commondummyaccent\`%
4918 \commondummyaccent\~%
4922 \commondummyword\dotaccent
4923 \commondummyword\ogonek
4924 \commondummyword\ringaccent
4925 \commondummyword\tieaccent
4926 \commondummyword\ubaraccent
4927 \commondummyword\udotaccent
4928 \commondummyword\dotless
4930 % Texinfo font commands.
4934 \commondummyword\sansserif
4936 \commondummyword\slanted
4939 % Commands that take arguments.
4940 \commondummyword\abbr
4941 \commondummyword\acronym
4942 \commondummyword\anchor
4943 \commondummyword\cite
4944 \commondummyword\code
4945 \commondummyword\command
4946 \commondummyword\dfn
4947 \commondummyword\dmn
4948 \commondummyword\email
4949 \commondummyword\emph
4950 \commondummyword\env
4951 \commondummyword\file
4952 \commondummyword\image
4953 \commondummyword\indicateurl
4954 \commondummyword\inforef
4955 \commondummyword\kbd
4956 \commondummyword\key
4957 \commondummyword\math
4958 \commondummyword\option
4959 \commondummyword\pxref
4960 \commondummyword\ref
4961 \commondummyword\samp
4962 \commondummyword\strong
4963 \commondummyword\tie
4965 \commondummyword\uref
4966 \commondummyword\url
4967 \commondummyword\var
4968 \commondummyword\verb
4970 \commondummyword\xref
4973 \let\indexlbrace\relax
4974 \let\indexrbrace\relax
4975 \let\indexatchar\relax
4976 \let\indexbackslash\relax
4980 @gdef@backslashdisappear{@def\{}}
4987 \gdef\indexnonalnumdisappear{%
4988 \expandafter\ifx\csname SETtxiindexlquoteignore\endcsname\relax\else
4989 % @set txiindexlquoteignore makes us ignore left quotes in the sort term.
4990 % (Introduced for FSFS 2nd ed.)
4994 \expandafter\ifx\csname SETtxiindexbackslashignore\endcsname\relax\else
4998 \expandafter\ifx\csname SETtxiindexhyphenignore\endcsname\relax\else
5001 \expandafter\ifx\csname SETtxiindexlessthanignore\endcsname\relax\else
5004 \expandafter\ifx\csname SETtxiindexatsignignore\endcsname\relax\else
5009 \gdef\indexnonalnumreappear{%
5016 % \indexnofonts is used when outputting the strings to sort the index
5017 % by, and when constructing control sequence names. It eliminates all
5018 % control sequences and just writes whatever the best ASCII sort string
5019 % would be for a given command (usually its argument).
5022 % Accent commands should become @asis.
5023 \def\commondummyaccent##1{\let##1\asis}%
5024 % We can just ignore other control letters.
5025 \def\commondummyletter##1{\let##1\empty}%
5026 % All control words become @asis by default; overrides below.
5027 \let\commondummyword\commondummyaccent
5028 \commondummiesnofonts
5030 % Don't no-op \tt, since it isn't a user-level command
5031 % and is used in the definitions of the active chars like <, >, |, etc.
5032 % Likewise with the other plain tex font commands.
5037 \def\_{\normalunderscore}%
5038 \def\-{}% @- shouldn't affect sorting
5040 \uccode`\1=`\{ \uppercase{\def\{{1}}%
5041 \uccode`\1=`\} \uppercase{\def\}{1}}%
5045 % Non-English letters.
5062 \def\questiondown{?}%
5066 \let\do\indexnofontsdef
5071 % Assorted special characters.
5076 \do\copyright{copyright}%
5084 \do\guillemetleft{<<}%
5085 \do\guillemetright{>>}%
5086 \do\guilsinglleft{<}%
5087 \do\guilsinglright{>}%
5094 \do\quotedblbase{"}%
5095 \do\quotedblleft{"}%
5096 \do\quotedblright{"}%
5099 \do\quotesinglbase{,}%
5101 \do\registeredsymbol{R}%
5105 % We need to get rid of all macros, leaving only the arguments (if present).
5106 % Of course this is not nearly correct, but it is the best we can do for now.
5107 % makeinfo does not expand macros in the argument to @deffn, which ends up
5108 % writing an index entry, and texindex isn't prepared for an index sort entry
5109 % that starts with \.
5111 % Since macro invocations are followed by braces, we can just redefine them
5112 % to take a single TeX argument. The case of a macro invocation that
5113 % goes to end-of-line is not handled.
5116 \let\value\indexnofontsvalue
5119 % Give the control sequence a definition that removes the {} that follows
5120 % its use, e.g. @AA{} -> AA
5121 \def\indexnofontsdef#1#2{\def#1##1{#2}}%
5126 % #1 is the index name, #2 is the entry text.
5131 \requireopenindexfile{#1}%
5132 \edef\writeto{\csname#1indfile\endcsname}%
5135 \safewhatsit\doindwrite
5140 % Same as \doind, but for code indices
5145 \requireopenindexfile{#1}%
5146 \edef\writeto{\csname#1indfile\endcsname}%
5149 \safewhatsit\docindwrite
5154 % Check if an index file has been opened, and if not, open it.
5155 \def\requireopenindexfile#1{%
5156 \ifnum\csname #1indfile\endcsname=0
5157 \expandafter\newwrite \csname#1indfile\endcsname
5159 % A .fls suffix would conflict with the file extension for the output
5160 % of -recorder, so use .f1s instead.
5161 \ifx\suffix\indexisfl\def\suffix{f1}\fi
5163 \immediate\openout\csname#1indfile\endcsname \jobname.\suffix
5164 % Using \immediate above here prevents an object entering into the current
5165 % box, which could confound checks such as those in \safewhatsit for
5167 \typeout{Writing index file \jobname.\suffix}%
5171 % Definition for writing index entry sort key.
5174 \gdef\indexwritesortas{%
5176 \indexnonalnumreappear
5177 \indexwritesortasxxx}
5178 \gdef\indexwritesortasxxx#1{%
5179 \xdef\indexsortkey{#1}\endgroup}
5182 \def\indexwriteseealso#1{
5183 \gdef\pagenumbertext{\string\seealso{#1}}%
5185 \def\indexwriteseeentry#1{
5186 \gdef\pagenumbertext{\string\seeentry{#1}}%
5189 % The default definitions
5191 \def\seealso#1{\i{\putwordSeeAlso}\ #1}% for sorted index file only
5192 \def\putwordSeeAlso{See also}
5193 \def\seeentry#1{\i{\putwordSee}\ #1}% for sorted index file only
5196 % Given index entry text like "aaa @subentry bbb @sortas{ZZZ}":
5197 % * Set \bracedtext to "{aaa}{bbb}"
5198 % * Set \fullindexsortkey to "aaa @subentry ZZZ"
5199 % * If @seealso occurs, set \pagenumbertext
5201 \def\splitindexentry#1{%
5202 \gdef\fullindexsortkey{}%
5207 \expandafter\doindexsegment#1\subentry\finish\subentry
5210 % append the results from the next segment
5211 \def\doindexsegment#1\subentry{%
5213 \ifx\segment\isfinish
5216 % Fully expand the segment, throwing away any @sortas directives, and
5218 \edef\trimmed{\segment}%
5219 \edef\trimmed{\expandafter\eatspaces\expandafter{\trimmed}}%
5221 \edef\trimmed{\noexpand\code{\trimmed}}%
5224 \xdef\bracedtext{\bracedtext{\trimmed}}%
5226 % Get the string to sort by. Process the segment with all
5227 % font commands turned off.
5229 \let\sortas\indexwritesortas
5230 \let\seealso\indexwriteseealso
5231 \let\seeentry\indexwriteseeentry
5233 % The braces around the commands are recognized by texindex.
5234 \def\lbracechar{{\string\indexlbrace}}%
5235 \def\rbracechar{{\string\indexrbrace}}%
5238 \def\@{{\string\indexatchar}}%
5240 \def\backslashchar{{\string\indexbackslash}}%
5241 \uccode`\~=`\\ \uppercase{\let~\backslashchar}%
5243 \let\indexsortkey\empty
5244 \global\let\pagenumbertext\empty
5245 % Execute the segment and throw away the typeset output. This executes
5246 % any @sortas or @seealso commands in this segment.
5247 \setbox\dummybox = \hbox{\segment}%
5248 \ifx\indexsortkey\empty{%
5249 \indexnonalnumdisappear
5250 \xdef\trimmed{\segment}%
5251 \xdef\trimmed{\expandafter\eatspaces\expandafter{\trimmed}}%
5252 \xdef\indexsortkey{\trimmed}%
5253 \ifx\indexsortkey\empty\xdef\indexsortkey{ }\fi
5256 % Append to \fullindexsortkey.
5257 \edef\tmp{\gdef\noexpand\fullindexsortkey{%
5258 \fullindexsortkey\sep\indexsortkey}}%
5261 \def\sep{\subentry}%
5263 \expandafter\doindexsegment
5266 \def\isfinish{\finish}%
5267 \newbox\dummybox % used above
5271 % Use \ instead of @ in index files. To support old texi2dvi and texindex.
5272 % This works without changing the escape character used in the toc or aux
5273 % files because the index entries are fully expanded here, and \string uses
5274 % the current value of \escapechar.
5275 \def\escapeisbackslash{\escapechar=`\\}
5277 % Use \ in index files by default. texi2dvi didn't support @ as the escape
5278 % character (as it checked for "\entry" in the files, and not "@entry"). When
5279 % the new version of texi2dvi has had a chance to become more prevalent, then
5280 % the escape character can change back to @ again. This should be an easy
5281 % change to make now because both @ and \ are only used as escape characters in
5282 % index files, never standing for themselves.
5284 \set txiindexescapeisbackslash
5286 % Write the entry in \indextext to the index file.
5289 \newif\ifincodeindex
5290 \def\doindwrite{\incodeindexfalse\doindwritex}
5291 \def\docindwrite{\incodeindextrue\doindwritex}
5298 \expandafter\ifx\csname SETtxiindexescapeisbackslash\endcsname\relax\else
5302 % For texindex which always views { and } as separators.
5303 \def\{{\lbracechar{}}%
5304 \def\}{\rbracechar{}}%
5305 \uccode`\~=`\\ \uppercase{\def~{\backslashchar{}}}%
5307 % Split the entry into primary entry and any subentries, and get the index
5309 \splitindexentry\indextext
5311 % Set up the complete index entry, with both the sort key and
5312 % the original text, including any font commands. We write
5313 % three arguments to \entry to the .?? file (four in the
5314 % subentry case), texindex reduces to two when writing the .??s
5319 \string\entry{\fullindexsortkey}%
5320 {\ifx\pagenumbertext\empty\noexpand\folio\else\pagenumbertext\fi}%
5326 % Put the index entry in the margin if desired (undocumented).
5327 \def\maybemarginindex{%
5328 \ifx\SETmarginindex\relax\else
5329 \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \relax\indextext}}%
5332 \let\SETmarginindex=\relax
5335 % Take care of unwanted page breaks/skips around a whatsit:
5337 % If a skip is the last thing on the list now, preserve it
5338 % by backing up by \lastskip, doing the \write, then inserting
5339 % the skip again. Otherwise, the whatsit generated by the
5340 % \write or \pdfdest will make \lastskip zero. The result is that
5341 % sequences like this:
5345 % will have extra space inserted, because the \medbreak in the
5346 % start of the @defun won't see the skip inserted by the @end of
5347 % the previous defun.
5349 % But don't do any of this if we're not in vertical mode. We
5350 % don't want to do a \vskip and prematurely end a paragraph.
5352 % Avoid page breaks due to these extra skips, too.
5354 % But wait, there is a catch there:
5355 % We'll have to check whether \lastskip is zero skip. \ifdim is not
5356 % sufficient for this purpose, as it ignores stretch and shrink parts
5357 % of the skip. The only way seems to be to check the textual
5358 % representation of the skip.
5360 % The following is almost like \def\zeroskipmacro{0.0pt} except that
5361 % the ``p'' and ``t'' characters have catcode \other, not 11 (letter).
5363 \edef\zeroskipmacro{\expandafter\the\csname z@skip\endcsname}
5365 \newskip\whatsitskip
5366 \newcount\whatsitpenalty
5370 \def\safewhatsit#1{\ifhmode
5373 % \lastskip and \lastpenalty cannot both be nonzero simultaneously.
5374 \whatsitskip = \lastskip
5375 \edef\lastskipmacro{\the\lastskip}%
5376 \whatsitpenalty = \lastpenalty
5378 % If \lastskip is nonzero, that means the last item was a
5379 % skip. And since a skip is discardable, that means this
5380 % -\whatsitskip glue we're inserting is preceded by a
5381 % non-discardable item, therefore it is not a potential
5382 % breakpoint, therefore no \nobreak needed.
5383 \ifx\lastskipmacro\zeroskipmacro
5390 \ifx\lastskipmacro\zeroskipmacro
5391 % If \lastskip was zero, perhaps the last item was a penalty, and
5392 % perhaps it was >=10000, e.g., a \nobreak. In that case, we want
5393 % to re-insert the same penalty (values >10000 are used for various
5394 % signals); since we just inserted a non-discardable item, any
5395 % following glue (such as a \parskip) would be a breakpoint. For example:
5396 % @deffn deffn-whatever
5397 % @vindex index-whatever
5399 % would allow a break between the index-whatever whatsit
5400 % and the "Description." paragraph.
5401 \ifnum\whatsitpenalty>9999 \penalty\whatsitpenalty \fi
5403 % On the other hand, if we had a nonzero \lastskip,
5404 % this make-up glue would be preceded by a non-discardable item
5405 % (the whatsit from the \write), so we must insert a \nobreak.
5406 \nobreak\vskip\whatsitskip
5410 % The index entry written in the file actually looks like
5411 % \entry {sortstring}{page}{topic}
5413 % \entry {sortstring}{page}{topic}{subtopic}
5414 % The texindex program reads in these files and writes files
5415 % containing these kinds of lines:
5417 % before the first topic whose initial is c
5418 % \entry {topic}{pagelist}
5419 % for a topic that is used without subtopics
5422 % for the beginning of a topic that is used with subtopics
5423 % \secondary {subtopic}{pagelist}
5424 % for each subtopic.
5425 % \secondary {subtopic}{}
5426 % for a subtopic with sub-subtopics
5427 % \tertiary {subtopic}{subsubtopic}{pagelist}
5428 % for each sub-subtopic.
5430 % Define the user-accessible indexing commands
5431 % @findex, @vindex, @kindex, @cindex.
5433 \def\findex {\fnindex}
5434 \def\kindex {\kyindex}
5435 \def\cindex {\cpindex}
5436 \def\vindex {\vrindex}
5437 \def\tindex {\tpindex}
5438 \def\pindex {\pgindex}
5440 % Define the macros used in formatting output of the sorted index material.
5442 % @printindex causes a particular index (the ??s file) to get printed.
5443 % It does not print any chapter heading (usually an @unnumbered).
5445 \parseargdef\printindex{\begingroup
5446 \dobreak \chapheadingskip{10000}%
5451 \everypar = {}% don't want the \kern\-parindent from indentation suppression.
5453 % See comment in \requireopenindexfile.
5454 \def\indexname{#1}\ifx\indexname\indexisfl\def\indexname{f1}\fi
5456 % See if the index file exists and is nonempty.
5457 \openin 1 \jobname.\indexname s
5459 % \enddoublecolumns gets confused if there is no text in the index,
5460 % and it loses the chapter title and the aux file entries for the
5461 % index. The easiest way to prevent this problem is to make sure
5462 % there is some text.
5463 \putwordIndexNonexistent
5464 \typeout{No file \jobname.\indexname s.}%
5466 % If the index file exists but is empty, then \openin leaves \ifeof
5467 % false. We have to make TeX try to read something from the file, so
5468 % it can discover if there is anything in it.
5469 \read 1 to \thisline
5471 \putwordIndexIsEmpty
5473 \expandafter\printindexzz\thisline\relax\relax\finish%
5479 % If the index file starts with a backslash, forgo reading the index
5480 % file altogether. If somebody upgrades texinfo.tex they may still have
5481 % old index files using \ as the escape character. Reading this would
5482 % at best lead to typesetting garbage, at worst a TeX syntax error.
5483 \def\printindexzz#1#2\finish{%
5484 \expandafter\ifx\csname SETtxiindexescapeisbackslash\endcsname\relax
5485 \uccode`\~=`\\ \uppercase{\if\noexpand~}\noexpand#1
5486 \expandafter\ifx\csname SETtxiskipindexfileswithbackslash\endcsname\relax
5488 ERROR: A sorted index file in an obsolete format was skipped.
5489 To fix this problem, please upgrade your version of 'texi2dvi'
5490 or 'texi2pdf' to that at <https://ftp.gnu.org/gnu/texinfo>.
5491 If you are using an old version of 'texindex' (part of the Texinfo
5492 distribution), you may also need to upgrade to a newer version (at least 6.0).
5493 You may be able to typeset the index if you run
5494 'texindex \jobname.\indexname' yourself.
5495 You could also try setting the 'txiindexescapeisbackslash' flag by
5496 running a command like
5497 'texi2dvi -t "@set txiindexescapeisbackslash" \jobname.texi'. If you do
5498 this, Texinfo will try to use index files in the old format.
5499 If you continue to have problems, deleting the index files and starting again
5500 might help (with 'rm \jobname.?? \jobname.??s')%
5503 (Skipped sorted index file in obsolete format)
5507 \input \jobname.\indexname s
5514 % Make @ an escape character to give macros a chance to work. This
5515 % should work because we (hopefully) don't otherwise use @ in index files.
5516 %\catcode`\@=12\relax
5518 \input \jobname.\indexname s
5523 % These macros are used by the sorted index file itself.
5524 % Change them to control the appearance of the index.
5526 {\catcode`\/=13 \catcode`\-=13 \catcode`\^=13 \catcode`\~=13 \catcode`\_=13
5527 \catcode`\|=13 \catcode`\<=13 \catcode`\>=13 \catcode`\+=13 \catcode`\"=13
5529 \gdef\initialglyphs{%
5530 % special control sequences used in the index sort key
5534 \def\indexbackslash{\math{\backslash}}%
5536 % Some changes for non-alphabetic characters. Using the glyphs from the
5537 % math fonts looks more consistent than the typewriter font used elsewhere
5538 % for these characters.
5539 \uccode`\~=`\\ \uppercase{\def~{\math{\backslash}}}
5541 % In case @\ is used for backslash
5542 \uppercase{\let\\=~}
5543 % Can't get bold backslash so don't use bold forward slash
5545 \def/{{\secrmnotbold \normalslash}}%
5546 \def-{{\normaldash\normaldash}}% en dash `--'
5547 \def^{{\chapbf \normalcaret}}%
5548 \def~{{\chapbf \normaltilde}}%
5550 \leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em }%
5554 \def+{$\normalplus$}%
5564 % Remove any glue we may have, we'll be inserting our own.
5567 % We like breaks before the index initials, so insert a bonus.
5568 % The glue before the bonus allows a little bit of space at the
5569 % bottom of a column to reduce an increase in inter-line spacing.
5571 \vskip 0pt plus 5\baselineskip
5573 \vskip 0pt plus -5\baselineskip
5575 % Typeset the initial. Making this add up to a whole number of
5576 % baselineskips increases the chance of the dots lining up from column
5577 % to column. It still won't often be perfect, because of the stretch
5578 % we need before each entry, but it's better.
5580 % No shrink because it confuses \balancecolumns.
5581 \vskip 1.67\baselineskip plus 1\baselineskip
5582 \leftline{\secfonts \kern-0.05em \secbf #1}%
5583 % \secfonts is inside the argument of \leftline so that the change of
5584 % \baselineskip will not affect any glue inserted before the vbox that
5585 % \leftline creates.
5586 % Do our best not to break after the initial.
5588 \vskip .33\baselineskip plus .1\baselineskip
5589 \egroup % \initialglyphs
5592 \newdimen\entryrightmargin
5593 \entryrightmargin=0pt
5595 % \entry typesets a paragraph consisting of the text (#1), dot leaders, and
5596 % then page number (#2) flushed to the right margin. It is used for index
5597 % and table of contents entries. The paragraph is indented by \leftskip.
5602 % Start a new paragraph if necessary, so our assignments below can't
5603 % affect previous text.
5606 % No extra space above this paragraph.
5609 % When reading the text of entry, convert explicit line breaks
5610 % from @* into spaces. The user might give these in long section
5611 % titles, for instance.
5612 \def\*{\unskip\space\ignorespaces}%
5613 \def\entrybreak{\hfil\break}% An undocumented command
5615 % Swallow the left brace of the text (first parameter):
5616 \afterassignment\doentry
5619 \def\entrybreak{\unskip\space\ignorespaces}%
5621 % Save the text of the entry
5622 \global\setbox\boxA=\hbox\bgroup
5623 \bgroup % Instead of the swallowed brace.
5625 \aftergroup\finishentry
5626 % And now comes the text of the entry.
5627 % Not absorbing as a macro argument reduces the chance of problems
5628 % with catcodes occurring.
5631 \gdef\finishentry#1{%
5633 \dimen@ = \wd\boxA % Length of text of entry
5634 \global\setbox\boxA=\hbox\bgroup
5636 % #1 is the page number.
5638 % Get the width of the page numbers, and only use
5639 % leaders if they are present.
5640 \global\setbox\boxB = \hbox{#1}%
5641 \ifdim\wd\boxB = 0pt
5642 \null\nobreak\hfill\ %
5645 \null\nobreak\indexdotfill % Have leaders before the page number.
5649 \hskip\skip\thinshrinkable\the\toksA
5651 \hskip\skip\thinshrinkable #1%
5655 \ifdim\wd\boxB = 0pt
5656 \noindent\unhbox\boxA\par
5659 % We want the text of the entries to be aligned to the left, and the
5660 % page numbers to be aligned to the right.
5663 \advance\leftskip by 0pt plus 1fil
5664 \advance\leftskip by 0pt plus -1fill
5665 \rightskip = 0pt plus -1fil
5666 \advance\rightskip by 0pt plus 1fill
5667 % Cause last line, which could consist of page numbers on their own
5668 % if the list of page numbers is long, to be aligned to the right.
5669 \parfillskip=0pt plus -1fill
5671 \advance\rightskip by \entryrightmargin
5672 % Determine how far we can stretch into the margin.
5673 % This allows, e.g., "Appendix H GNU Free Documentation License" to
5674 % fit on one line in @letterpaper format.
5675 \ifdim\entryrightmargin>2.1em
5680 \advance \parfillskip by 0pt minus 1\dimen@i
5683 \advance\dimen@ii by -1\leftskip
5684 \advance\dimen@ii by -1\entryrightmargin
5685 \advance\dimen@ii by 1\dimen@i
5686 \ifdim\wd\boxA > \dimen@ii % If the entry doesn't fit in one line
5687 \ifdim\dimen@ > 0.8\dimen@ii % due to long index text
5688 % Try to split the text roughly evenly. \dimen@ will be the length of
5690 \dimen@ = 0.7\dimen@
5692 \ifnum\dimen@>\dimen@ii
5693 % If the entry is too long (for example, if it needs more than
5694 % two lines), use all the space in the first line.
5697 \advance\leftskip by 0pt plus 1fill % ragged right
5698 \advance \dimen@ by 1\rightskip
5699 \parshape = 2 0pt \dimen@ 0em \dimen@ii
5700 % Ideally we'd add a finite glue at the end of the first line only,
5701 % instead of using \parshape with explicit line lengths, but TeX
5702 % doesn't seem to provide a way to do such a thing.
5704 % Indent all lines but the first one.
5705 \advance\leftskip by 1em
5706 \advance\parindent by -1em
5708 \indent % start paragraph
5711 % Do not prefer a separate line ending with a hyphen to fewer lines.
5712 \finalhyphendemerits = 0
5714 % Word spacing - no stretch
5715 \spaceskip=\fontdimen2\font minus \fontdimen4\font
5717 \linepenalty=1000 % Discourage line breaks.
5718 \hyphenpenalty=5000 % Discourage hyphenation.
5720 \par % format the paragraph
5726 \newskip\thinshrinkable
5727 \skip\thinshrinkable=.15em minus .15em
5729 % Like plain.tex's \dotfill, except uses up at least 1 em.
5730 % The filll stretch here overpowers both the fil and fill stretch to push
5731 % the page number to the right.
5732 \def\indexdotfill{\cleaders
5733 \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1filll}
5736 \def\primary #1{\line{#1\hfil}}
5738 \def\secondary{\indententry{0.5cm}}
5739 \def\tertiary{\indententry{1cm}}
5741 \def\indententry#1#2#3{%
5748 % Define two-column mode, which we use to typeset indexes.
5749 % Adapted from the TeXbook, page 416, which is to say,
5750 % the manmac.tex format used to print the TeXbook itself.
5751 \catcode`\@=11 % private names
5754 \newdimen\doublecolumnhsize
5756 \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
5757 % If not much space left on page, start a new page.
5758 \ifdim\pagetotal>0.8\vsize\vfill\eject\fi
5760 % Grab any single-column material above us.
5764 \global\setbox\partialpage = \vbox{%
5765 % Unvbox the main output page.
5767 \kern-\topskip \kern\baselineskip
5770 \eject % run that output routine to set \partialpage
5772 % Use the double-column output routine for subsequent pages.
5773 \output = {\doublecolumnout}%
5775 % Change the page size parameters. We could do this once outside this
5776 % routine, in each of @smallbook, @afourpaper, and the default 8.5x11
5777 % format, but then we repeat the same computation. Repeating a couple
5778 % of assignments once per index is clearly meaningless for the
5779 % execution time, so we may as well do it in one place.
5781 % First we halve the line length, less a little for the gutter between
5782 % the columns. We compute the gutter based on the line length, so it
5783 % changes automatically with the paper format. The magic constant
5784 % below is chosen so that the gutter has the same value (well, +-<1pt)
5785 % as it did when we hard-coded it.
5787 % We put the result in a separate register, \doublecolumhsize, so we
5788 % can restore it in \pagesofar, after \hsize itself has (potentially)
5791 \doublecolumnhsize = \hsize
5792 \advance\doublecolumnhsize by -.04154\hsize
5793 \divide\doublecolumnhsize by 2
5794 \hsize = \doublecolumnhsize
5796 % Get the available space for the double columns -- the normal
5797 % (undoubled) page height minus any material left over from the
5799 \advance\vsize by -\ht\partialpage
5802 % For the benefit of balancing columns
5803 \advance\baselineskip by 0pt plus 0.5pt
5806 % The double-column output routine for all double-column pages except
5807 % the last, which is done by \balancecolumns.
5809 \def\doublecolumnout{%
5812 \splittopskip=\topskip \splitmaxdepth=\maxdepth
5816 % box0 will be the left-hand column, box2 the right.
5817 \setbox0=\vsplit\PAGE to\dimen@ \setbox2=\vsplit\PAGE to\dimen@
5818 \global\advance\vsize by 2\ht\partialpage
5819 \onepageout\pagesofar % empty except for the first time we are called
5821 \penalty\outputpenalty
5824 % Re-output the contents of the output page -- any previous material,
5825 % followed by the two boxes we just split, in box0 and box2.
5829 \hsize = \doublecolumnhsize
5830 \wd0=\hsize \wd2=\hsize
5831 \hbox to\txipagewidth{\box0\hfil\box2}%
5835 % Finished with double columns.
5836 \def\enddoublecolumns{%
5837 % The following penalty ensures that the page builder is exercised
5838 % _before_ we change the output routine. This is necessary in the
5839 % following situation:
5841 % The last section of the index consists only of a single entry.
5842 % Before this section, \pagetotal is less than \pagegoal, so no
5843 % break occurs before the last section starts. However, the last
5844 % section, consisting of \initial and the single \entry, does not
5845 % fit on the page and has to be broken off. Without the following
5846 % penalty the page builder will not be exercised until \eject
5847 % below, and by that time we'll already have changed the output
5848 % routine to the \balancecolumns version, so the next-to-last
5849 % double-column page will be processed with \balancecolumns, which
5850 % is wrong: The two columns will go to the main vertical list, with
5851 % the broken-off section in the recent contributions. As soon as
5852 % the output routine finishes, TeX starts reconsidering the page
5853 % break. The two columns and the broken-off section both fit on the
5854 % page, because the two columns now take up only half of the page
5855 % goal. When TeX sees \eject from below which follows the final
5856 % section, it invokes the new output routine that we've set after
5857 % \balancecolumns below; \onepageout will try to fit the two columns
5858 % and the final section into the vbox of \txipageheight (see
5859 % \pagebody), causing an overfull box.
5861 % Note that glue won't work here, because glue does not exercise the
5862 % page builder, unlike penalties (see The TeXbook, pp. 280-281).
5866 % Split the last of the double-column material.
5870 \eject % call the \output just set
5871 \ifdim\pagetotal=0pt
5872 % Having called \balancecolumns once, we do not
5873 % want to call it again. Therefore, reset \output to its normal
5874 % definition right away.
5875 \global\output=\expandafter{\the\defaultoutput}
5877 \endgroup % started in \begindoublecolumns
5878 % Leave the double-column material on the current page, no automatic
5880 \box\balancedcolumns
5882 % \pagegoal was set to the doubled \vsize above, since we restarted
5883 % the current page. We're now back to normal single-column
5884 % typesetting, so reset \pagegoal to the normal \vsize.
5885 \global\vsize = \txipageheight %
5886 \pagegoal = \txipageheight %
5888 % We had some left-over material. This might happen when \doublecolumnout
5889 % is called in \balancecolumns. Try again.
5890 \expandafter\enddoublecolumns
5893 \newbox\balancedcolumns
5894 \setbox\balancedcolumns=\vbox{shouldnt see this}%
5896 % Only called for the last of the double column material. \doublecolumnout
5898 \def\balancecolumns{%
5899 \setbox0 = \vbox{\unvbox\PAGE}% like \box255 but more efficient, see p.120.
5901 \ifdim\dimen@<7\baselineskip
5902 % Don't split a short final column in two.
5904 \global\setbox\balancedcolumns=\vbox{\pagesofar}%
5906 % double the leading vertical space
5907 \advance\dimen@ by \topskip
5908 \advance\dimen@ by-\baselineskip
5909 \divide\dimen@ by 2 % target to split to
5911 \splittopskip = \topskip
5912 % Loop until left column is at least as high as the right column.
5916 \global\setbox3 = \copy0
5917 \global\setbox1 = \vsplit3 to \dimen@
5919 \global\advance\dimen@ by 1pt
5922 % Now the left column is in box 1, and the right column in box 3.
5924 % Check whether the left column has come out higher than the page itself.
5925 % (Note that we have doubled \vsize for the double columns, so
5926 % the actual height of the page is 0.5\vsize).
5928 % It appears that we have been called upon to balance too much material.
5929 % Output some of it with \doublecolumnout, leaving the rest on the page.
5933 % Compare the heights of the two columns.
5935 % Column heights are too different, so don't make their bottoms
5936 % flush with each other.
5937 \setbox2=\vbox to \ht1 {\unvbox3\vfill}%
5938 \setbox0=\vbox to \ht1 {\unvbox1\vfill}%
5940 % Make column bottoms flush with each other.
5941 \setbox2=\vbox to\ht1{\unvbox3\unskip}%
5942 \setbox0=\vbox to\ht1{\unvbox1\unskip}%
5944 \global\setbox\balancedcolumns=\vbox{\pagesofar}%
5949 \catcode`\@ = \other
5952 \message{sectioning,}
5953 % Chapters, sections, etc.
5955 % Let's start with @part.
5956 \parseargdef\part{\partzzz{#1}}
5960 \vskip.3\vsize % move it down on the page a bit
5962 \noindent \titlefonts\rm #1\par % the text
5963 \let\lastnode=\empty % no node to associate with
5964 \writetocentry{part}{#1}{}% but put it in the toc
5965 \headingsoff % no headline or footline on the part page
5966 % This outputs a mark at the end of the page that clears \thischapter
5967 % and \thissection, as is done in \startcontents.
5968 \let\pchapsepmacro\relax
5969 \chapmacro{}{Yomitfromtoc}{}%
5974 % \unnumberedno is an oxymoron. But we count the unnumbered
5975 % sections so that we can refer to them unambiguously in the pdf
5976 % outlines by their "section number". We avoid collisions with chapter
5977 % numbers by starting them at 10000. (If a document ever has 10000
5978 % chapters, we're in trouble anyway, I'm sure.)
5979 \newcount\unnumberedno \unnumberedno = 10000
5981 \newcount\secno \secno=0
5982 \newcount\subsecno \subsecno=0
5983 \newcount\subsubsecno \subsubsecno=0
5985 % This counter is funny since it counts through charcodes of letters A, B, ...
5986 \newcount\appendixno \appendixno = `\@
5988 % \def\appendixletter{\char\the\appendixno}
5989 % We do the following ugly conditional instead of the above simple
5990 % construct for the sake of pdftex, which needs the actual
5991 % letter in the expansion, not just typeset.
5993 \def\appendixletter{%
5994 \ifnum\appendixno=`A A%
5995 \else\ifnum\appendixno=`B B%
5996 \else\ifnum\appendixno=`C C%
5997 \else\ifnum\appendixno=`D D%
5998 \else\ifnum\appendixno=`E E%
5999 \else\ifnum\appendixno=`F F%
6000 \else\ifnum\appendixno=`G G%
6001 \else\ifnum\appendixno=`H H%
6002 \else\ifnum\appendixno=`I I%
6003 \else\ifnum\appendixno=`J J%
6004 \else\ifnum\appendixno=`K K%
6005 \else\ifnum\appendixno=`L L%
6006 \else\ifnum\appendixno=`M M%
6007 \else\ifnum\appendixno=`N N%
6008 \else\ifnum\appendixno=`O O%
6009 \else\ifnum\appendixno=`P P%
6010 \else\ifnum\appendixno=`Q Q%
6011 \else\ifnum\appendixno=`R R%
6012 \else\ifnum\appendixno=`S S%
6013 \else\ifnum\appendixno=`T T%
6014 \else\ifnum\appendixno=`U U%
6015 \else\ifnum\appendixno=`V V%
6016 \else\ifnum\appendixno=`W W%
6017 \else\ifnum\appendixno=`X X%
6018 \else\ifnum\appendixno=`Y Y%
6019 \else\ifnum\appendixno=`Z Z%
6020 % The \the is necessary, despite appearances, because \appendixletter is
6021 % expanded while writing the .toc file. \char\appendixno is not
6022 % expandable, thus it is written literally, thus all appendixes come out
6023 % with the same letter (or @) in the toc without it.
6024 \else\char\the\appendixno
6025 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
6026 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
6028 % Each @chapter defines these (using marks) as the number+name, number
6029 % and name of the chapter. Page headings and footings can use
6030 % these. @section does likewise.
6032 \def\thischapternum{}
6033 \def\thischaptername{}
6035 \def\thissectionnum{}
6036 \def\thissectionname{}
6038 \newcount\absseclevel % used to calculate proper heading level
6039 \newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count
6041 % @raisesections: treat @section as chapter, @subsection as section, etc.
6042 \def\raisesections{\global\advance\secbase by -1}
6044 % @lowersections: treat @chapter as section, @section as subsection, etc.
6045 \def\lowersections{\global\advance\secbase by 1}
6047 % we only have subsub.
6048 \chardef\maxseclevel = 3
6050 % A numbered section within an unnumbered changes to unnumbered too.
6051 % To achieve this, remember the "biggest" unnum. sec. we are currently in:
6052 \chardef\unnlevel = \maxseclevel
6054 % Trace whether the current chapter is an appendix or not:
6055 % \chapheadtype is "N" or "A", unnumbered chapters are ignored.
6056 \def\chapheadtype{N}
6058 % Choose a heading macro
6059 % #1 is heading type
6060 % #2 is heading level
6061 % #3 is text for heading
6062 \def\genhead#1#2#3{%
6063 % Compute the abs. sec. level:
6065 \advance\absseclevel by \secbase
6066 % Make sure \absseclevel doesn't fall outside the range:
6067 \ifnum \absseclevel < 0
6070 \ifnum \absseclevel > 3
6077 \ifnum \absseclevel < \unnlevel
6078 \chardef\unnlevel = \absseclevel
6081 % Check for appendix sections:
6082 \ifnum \absseclevel = 0
6083 \edef\chapheadtype{\headtype}%
6085 \if \headtype A\if \chapheadtype N%
6086 \errmessage{@appendix... within a non-appendix chapter}%
6089 % Check for numbered within unnumbered:
6090 \ifnum \absseclevel > \unnlevel
6093 \chardef\unnlevel = 3
6096 % Now print the heading:
6100 \or \unnumberedseczzz{#3}%
6101 \or \unnumberedsubseczzz{#3}%
6102 \or \unnumberedsubsubseczzz{#3}%
6108 \or \appendixsectionzzz{#3}%
6109 \or \appendixsubseczzz{#3}%
6110 \or \appendixsubsubseczzz{#3}%
6116 \or \numberedsubseczzz{#3}%
6117 \or \numberedsubsubseczzz{#3}%
6121 \suppressfirstparagraphindent
6125 \def\numhead{\genhead N}
6126 \def\apphead{\genhead A}
6127 \def\unnmhead{\genhead U}
6129 % @chapter, @appendix, @unnumbered. Increment top-level counter, reset
6130 % all lower-level sectioning counters to zero.
6132 % Also set \chaplevelprefix, which we prepend to @float sequence numbers
6133 % (e.g., figures), q.v. By default (before any chapter), that is empty.
6134 \let\chaplevelprefix = \empty
6136 \outer\parseargdef\chapter{\numhead0{#1}} % normally numhead0 calls chapterzzz
6138 % section resetting is \global in case the chapter is in a group, such
6139 % as an @include file.
6140 \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
6141 \global\advance\chapno by 1
6144 \gdef\chaplevelprefix{\the\chapno.}%
6147 % \putwordChapter can contain complex things in translations.
6148 \toks0=\expandafter{\putwordChapter}%
6149 \message{\the\toks0 \space \the\chapno}%
6151 % Write the actual heading.
6152 \chapmacro{#1}{Ynumbered}{\the\chapno}%
6154 % So @section and the like are numbered underneath this chapter.
6155 \global\let\section = \numberedsec
6156 \global\let\subsection = \numberedsubsec
6157 \global\let\subsubsection = \numberedsubsubsec
6160 \outer\parseargdef\appendix{\apphead0{#1}} % normally calls appendixzzz
6162 \def\appendixzzz#1{%
6163 \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
6164 \global\advance\appendixno by 1
6165 \gdef\chaplevelprefix{\appendixletter.}%
6168 % \putwordAppendix can contain complex things in translations.
6169 \toks0=\expandafter{\putwordAppendix}%
6170 \message{\the\toks0 \space \appendixletter}%
6172 \chapmacro{#1}{Yappendix}{\appendixletter}%
6174 \global\let\section = \appendixsec
6175 \global\let\subsection = \appendixsubsec
6176 \global\let\subsubsection = \appendixsubsubsec
6179 % normally unnmhead0 calls unnumberedzzz:
6180 \outer\parseargdef\unnumbered{\unnmhead0{#1}}
6181 \def\unnumberedzzz#1{%
6182 \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
6183 \global\advance\unnumberedno by 1
6185 % Since an unnumbered has no number, no prefix for figures.
6186 \global\let\chaplevelprefix = \empty
6189 % This used to be simply \message{#1}, but TeX fully expands the
6190 % argument to \message. Therefore, if #1 contained @-commands, TeX
6191 % expanded them. For example, in `@unnumbered The @cite{Book}', TeX
6192 % expanded @cite (which turns out to cause errors because \cite is meant
6193 % to be executed, not expanded).
6195 % Anyway, we don't want the fully-expanded definition of @cite to appear
6196 % as a result of the \message, we just want `@cite' itself. We use
6197 % \the<toks register> to achieve this: TeX expands \the<toks> only once,
6198 % simply yielding the contents of <toks register>. (We also do this for
6201 \message{(\the\toks0)}%
6203 \chapmacro{#1}{Ynothing}{\the\unnumberedno}%
6205 \global\let\section = \unnumberedsec
6206 \global\let\subsection = \unnumberedsubsec
6207 \global\let\subsubsection = \unnumberedsubsubsec
6210 % @centerchap is like @unnumbered, but the heading is centered.
6211 \outer\parseargdef\centerchap{%
6212 \let\centerparametersmaybe = \centerparameters
6214 \let\centerparametersmaybe = \relax
6217 % @top is like @unnumbered.
6222 \outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz
6224 \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
6225 \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}%
6228 % normally calls appendixsectionzzz:
6229 \outer\parseargdef\appendixsection{\apphead1{#1}}
6230 \def\appendixsectionzzz#1{%
6231 \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
6232 \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}%
6234 \let\appendixsec\appendixsection
6236 % normally calls unnumberedseczzz:
6237 \outer\parseargdef\unnumberedsec{\unnmhead1{#1}}
6238 \def\unnumberedseczzz#1{%
6239 \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
6240 \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}%
6245 % normally calls numberedsubseczzz:
6246 \outer\parseargdef\numberedsubsec{\numhead2{#1}}
6247 \def\numberedsubseczzz#1{%
6248 \global\subsubsecno=0 \global\advance\subsecno by 1
6249 \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}%
6252 % normally calls appendixsubseczzz:
6253 \outer\parseargdef\appendixsubsec{\apphead2{#1}}
6254 \def\appendixsubseczzz#1{%
6255 \global\subsubsecno=0 \global\advance\subsecno by 1
6256 \sectionheading{#1}{subsec}{Yappendix}%
6257 {\appendixletter.\the\secno.\the\subsecno}%
6260 % normally calls unnumberedsubseczzz:
6261 \outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}}
6262 \def\unnumberedsubseczzz#1{%
6263 \global\subsubsecno=0 \global\advance\subsecno by 1
6264 \sectionheading{#1}{subsec}{Ynothing}%
6265 {\the\unnumberedno.\the\secno.\the\subsecno}%
6270 % normally numberedsubsubseczzz:
6271 \outer\parseargdef\numberedsubsubsec{\numhead3{#1}}
6272 \def\numberedsubsubseczzz#1{%
6273 \global\advance\subsubsecno by 1
6274 \sectionheading{#1}{subsubsec}{Ynumbered}%
6275 {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}%
6278 % normally appendixsubsubseczzz:
6279 \outer\parseargdef\appendixsubsubsec{\apphead3{#1}}
6280 \def\appendixsubsubseczzz#1{%
6281 \global\advance\subsubsecno by 1
6282 \sectionheading{#1}{subsubsec}{Yappendix}%
6283 {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}%
6286 % normally unnumberedsubsubseczzz:
6287 \outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}}
6288 \def\unnumberedsubsubseczzz#1{%
6289 \global\advance\subsubsecno by 1
6290 \sectionheading{#1}{subsubsec}{Ynothing}%
6291 {\the\unnumberedno.\the\secno.\the\subsecno.\the\subsubsecno}%
6294 % These macros control what the section commands do, according
6295 % to what kind of chapter we are in (ordinary, appendix, or unnumbered).
6296 % Define them by default for a numbered chapter.
6297 \let\section = \numberedsec
6298 \let\subsection = \numberedsubsec
6299 \let\subsubsection = \numberedsubsubsec
6301 % Define @majorheading, @heading and @subheading
6304 {\advance\chapheadingskip by 10pt \chapbreak }%
6305 \parsearg\chapheadingzzz
6308 \def\chapheading{\chapbreak \parsearg\chapheadingzzz}
6309 \def\chapheadingzzz#1{%
6310 \vbox{\chapfonts \raggedtitlesettings #1\par}%
6311 \nobreak\bigskip \nobreak
6312 \suppressfirstparagraphindent
6315 % @heading, @subheading, @subsubheading.
6316 \parseargdef\heading{\sectionheading{#1}{sec}{Yomitfromtoc}{}
6317 \suppressfirstparagraphindent}
6318 \parseargdef\subheading{\sectionheading{#1}{subsec}{Yomitfromtoc}{}
6319 \suppressfirstparagraphindent}
6320 \parseargdef\subsubheading{\sectionheading{#1}{subsubsec}{Yomitfromtoc}{}
6321 \suppressfirstparagraphindent}
6323 % These macros generate a chapter, section, etc. heading only
6324 % (including whitespace, linebreaking, etc. around it),
6325 % given all the information in convenient, parsed form.
6327 % Args are the skip and penalty (usually negative)
6328 \def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}
6330 % Parameter controlling skip before chapter headings (if needed)
6331 \newskip\chapheadingskip
6333 % Define plain chapter starts, and page on/off switching for it.
6334 \def\chapbreak{\dobreak \chapheadingskip {-4000}}
6337 \def\chappager{\par\vfill\supereject}
6339 % \chapoddpage - start on an odd page for a new chapter
6340 % Because \domark is called before \chapoddpage, the filler page will
6341 % get the headings for the next chapter, which is wrong. But we don't
6342 % care -- we just disable all headings on the filler page.
6354 \parseargdef\setchapternewpage{\csname CHAPPAG#1\endcsname}
6357 \global\let\contentsalignmacro = \chappager
6358 \global\let\pchapsepmacro=\chapbreak
6359 \global\def\HEADINGSon{\HEADINGSsinglechapoff}}
6362 \global\let\contentsalignmacro = \chappager
6363 \global\let\pchapsepmacro=\chappager
6364 \global\def\HEADINGSon{\HEADINGSsingle}}
6367 \global\let\contentsalignmacro = \chapoddpage
6368 \global\let\pchapsepmacro=\chapoddpage
6369 \global\def\HEADINGSon{\HEADINGSdouble}}
6373 % \chapmacro - Chapter opening.
6375 % #1 is the text, #2 is the section type (Ynumbered, Ynothing,
6376 % Yappendix, Yomitfromtoc), #3 the chapter number.
6377 % Not used for @heading series.
6379 % To test against our argument.
6380 \def\Ynothingkeyword{Ynothing}
6381 \def\Yappendixkeyword{Yappendix}
6382 \def\Yomitfromtockeyword{Yomitfromtoc}
6384 \def\chapmacro#1#2#3{%
6385 \expandafter\ifx\thisenv\titlepage\else
6386 \checkenv{}% chapters, etc., should not start inside an environment.
6388 % Insert the first mark before the heading break (see notes for \domark).
6389 \let\prevchapterdefs=\currentchapterdefs
6390 \let\prevsectiondefs=\currentsectiondefs
6391 \gdef\currentsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}%
6392 \gdef\thissection{}}%
6395 \ifx\temptype\Ynothingkeyword
6396 \gdef\currentchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
6397 \gdef\thischapter{\thischaptername}}%
6398 \else\ifx\temptype\Yomitfromtockeyword
6399 \gdef\currentchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
6400 \gdef\thischapter{}}%
6401 \else\ifx\temptype\Yappendixkeyword
6403 \xdef\currentchapterdefs{%
6404 \gdef\noexpand\thischaptername{\the\toks0}%
6405 \gdef\noexpand\thischapternum{\appendixletter}%
6406 % \noexpand\putwordAppendix avoids expanding indigestible
6407 % commands in some of the translations.
6408 \gdef\noexpand\thischapter{\noexpand\putwordAppendix{}
6409 \noexpand\thischapternum:
6410 \noexpand\thischaptername}%
6414 \xdef\currentchapterdefs{%
6415 \gdef\noexpand\thischaptername{\the\toks0}%
6416 \gdef\noexpand\thischapternum{\the\chapno}%
6417 % \noexpand\putwordChapter avoids expanding indigestible
6418 % commands in some of the translations.
6419 \gdef\noexpand\thischapter{\noexpand\putwordChapter{}
6420 \noexpand\thischapternum:
6421 \noexpand\thischaptername}%
6425 % Output the mark. Pass it through \safewhatsit, to take care of
6426 % the preceding space.
6429 % Insert the chapter heading break.
6432 % Now the second mark, after the heading break. No break points
6433 % between here and the heading.
6434 \let\prevchapterdefs=\currentchapterdefs
6435 \let\prevsectiondefs=\currentsectiondefs
6440 \let\footnote=\errfootnoteheading % give better error message
6442 % Have to define \currentsection before calling \donoderef, because the
6443 % xref code eventually uses it. On the other hand, it has to be called
6444 % after \pchapsepmacro, or the headline will change too soon.
6445 \gdef\currentsection{#1}%
6447 % Only insert the separating space if we have a chapter/appendix
6448 % number, and don't print the unnumbered ``number''.
6449 \ifx\temptype\Ynothingkeyword
6451 \def\toctype{unnchap}%
6452 \else\ifx\temptype\Yomitfromtockeyword
6453 \setbox0 = \hbox{}% contents like unnumbered, but no toc entry
6455 \else\ifx\temptype\Yappendixkeyword
6456 \setbox0 = \hbox{\putwordAppendix{} #3\enspace}%
6459 \setbox0 = \hbox{#3\enspace}%
6460 \def\toctype{numchap}%
6463 % Write the toc entry for this chapter. Must come before the
6464 % \donoderef, because we include the current node name in the toc
6465 % entry, and \donoderef resets it to empty.
6466 \writetocentry{\toctype}{#1}{#3}%
6468 % For pdftex, we have to write out the node definition (aka, make
6469 % the pdfdest) after any page break, but before the actual text has
6470 % been typeset. If the destination for the pdf outline is after the
6471 % text, then jumping from the outline may wind up with the text not
6472 % being visible, for instance under high magnification.
6475 % Typeset the actual heading.
6476 \nobreak % Avoid page breaks at the interline glue.
6477 \vbox{\raggedtitlesettings \hangindent=\wd0 \centerparametersmaybe
6480 \nobreak\bigskip % no page break after a chapter title
6484 % @centerchap -- centered and unnumbered.
6485 \let\centerparametersmaybe = \relax
6486 \def\centerparameters{%
6487 \advance\rightskip by 3\rightskip
6488 \leftskip = \rightskip
6493 % Section titles. These macros combine the section number parts and
6494 % call the generic \sectionheading to do the printing.
6496 \newskip\secheadingskip
6497 \def\secheadingbreak{\dobreak \secheadingskip{-1000}}
6499 % Subsection titles.
6500 \newskip\subsecheadingskip
6501 \def\subsecheadingbreak{\dobreak \subsecheadingskip{-500}}
6503 % Subsubsection titles.
6504 \def\subsubsecheadingskip{\subsecheadingskip}
6505 \def\subsubsecheadingbreak{\subsecheadingbreak}
6508 % Print any size, any type, section title.
6510 % #1 is the text of the title,
6511 % #2 is the section level (sec/subsec/subsubsec),
6512 % #3 is the section type (Ynumbered, Ynothing, Yappendix, Yomitfromtoc),
6513 % #4 is the section number.
6515 \def\seckeyword{sec}
6517 \def\sectionheading#1#2#3#4{%
6519 \def\sectionlevel{#2}%
6522 % It is ok for the @heading series commands to appear inside an
6523 % environment (it's been historically allowed, though the logic is
6524 % dubious), but not the others.
6525 \ifx\temptype\Yomitfromtockeyword\else
6526 \checkenv{}% non-@*heading should not be in an environment.
6528 \let\footnote=\errfootnoteheading
6530 % Switch to the right set of fonts.
6531 \csname #2fonts\endcsname \rm
6533 % Insert first mark before the heading break (see notes for \domark).
6534 \let\prevsectiondefs=\currentsectiondefs
6535 \ifx\temptype\Ynothingkeyword
6536 \ifx\sectionlevel\seckeyword
6537 \gdef\currentsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}%
6538 \gdef\thissection{\thissectionname}}%
6540 \else\ifx\temptype\Yomitfromtockeyword
6541 % Don't redefine \thissection.
6542 \else\ifx\temptype\Yappendixkeyword
6543 \ifx\sectionlevel\seckeyword
6545 \xdef\currentsectiondefs{%
6546 \gdef\noexpand\thissectionname{\the\toks0}%
6547 \gdef\noexpand\thissectionnum{#4}%
6548 % \noexpand\putwordSection avoids expanding indigestible
6549 % commands in some of the translations.
6550 \gdef\noexpand\thissection{\noexpand\putwordSection{}
6551 \noexpand\thissectionnum:
6552 \noexpand\thissectionname}%
6556 \ifx\sectionlevel\seckeyword
6558 \xdef\currentsectiondefs{%
6559 \gdef\noexpand\thissectionname{\the\toks0}%
6560 \gdef\noexpand\thissectionnum{#4}%
6561 % \noexpand\putwordSection avoids expanding indigestible
6562 % commands in some of the translations.
6563 \gdef\noexpand\thissection{\noexpand\putwordSection{}
6564 \noexpand\thissectionnum:
6565 \noexpand\thissectionname}%
6570 % Go into vertical mode. Usually we'll already be there, but we
6571 % don't want the following whatsit to end up in a preceding paragraph
6572 % if the document didn't happen to have a blank line.
6575 % Output the mark. Pass it through \safewhatsit, to take care of
6576 % the preceding space.
6579 % Insert space above the heading.
6580 \csname #2headingbreak\endcsname
6582 % Now the second mark, after the heading break. No break points
6583 % between here and the heading.
6584 \global\let\prevsectiondefs=\currentsectiondefs
6587 % Only insert the space after the number if we have a section number.
6588 \ifx\temptype\Ynothingkeyword
6591 \gdef\currentsection{#1}%
6592 \else\ifx\temptype\Yomitfromtockeyword
6593 % for @headings -- no section number, don't include in toc,
6594 % and don't redefine \currentsection.
6597 \let\sectionlevel=\empty
6598 \else\ifx\temptype\Yappendixkeyword
6599 \setbox0 = \hbox{#4\enspace}%
6601 \gdef\currentsection{#1}%
6603 \setbox0 = \hbox{#4\enspace}%
6605 \gdef\currentsection{#1}%
6608 % Write the toc entry (before \donoderef). See comments in \chapmacro.
6609 \writetocentry{\toctype\sectionlevel}{#1}{#4}%
6611 % Write the node reference (= pdf destination for pdftex).
6612 % Again, see comments in \chapmacro.
6615 % Interline glue will be inserted when the vbox is completed.
6616 % That glue will be a valid breakpoint for the page, since it'll be
6617 % preceded by a whatsit (usually from the \donoderef, or from the
6618 % \writetocentry if there was no node). We don't want to allow that
6619 % break, since then the whatsits could end up on page n while the
6620 % section is on page n+1, thus toc/etc. are wrong. Debian bug 276000.
6623 % Output the actual section heading.
6624 \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright
6625 \hangindent=\wd0 % zero if no section number
6628 % Add extra space after the heading -- half of whatever came above it.
6629 % Don't allow stretch, though.
6630 \kern .5 \csname #2headingskip\endcsname
6632 % Do not let the kern be a potential breakpoint, as it would be if it
6633 % was followed by glue.
6636 % We'll almost certainly start a paragraph next, so don't let that
6637 % glue accumulate. (Not a breakpoint because it's preceded by a
6638 % discardable item.) However, when a paragraph is not started next
6639 % (\startdefun, \cartouche, \center, etc.), this needs to be wiped out
6640 % or the negative glue will cause weirdly wrong output, typically
6641 % obscuring the section heading with something else.
6644 % This is so the last item on the main vertical list is a known
6645 % \penalty > 10000, so \startdefun, etc., can recognize the situation
6646 % and do the needful.
6652 % Table of contents.
6655 % Write an entry to the toc file, opening it if necessary.
6656 % Called from @chapter, etc.
6658 % Example usage: \writetocentry{sec}{Section Name}{\the\chapno.\the\secno}
6659 % We append the current node name (if any) and page number as additional
6660 % arguments for the \{chap,sec,...}entry macros which will eventually
6661 % read this. The node name is used in the pdf outlines as the
6662 % destination to jump to.
6664 % We open the .toc file for writing here instead of at @setfilename (or
6665 % any other fixed time) so that @contents can be anywhere in the document.
6666 % But if #1 is `omit', then we don't do anything. This is used for the
6667 % table of contents chapter openings themselves.
6669 \newif\iftocfileopened
6670 \def\omitkeyword{omit}%
6672 \def\writetocentry#1#2#3{%
6673 \edef\writetoctype{#1}%
6674 \ifx\writetoctype\omitkeyword \else
6675 \iftocfileopened\else
6676 \immediate\openout\tocfile = \jobname.toc
6677 \global\tocfileopenedtrue
6683 \write\tocfile{@#1entry{#2}{#3}{\lastnode}{\noexpand\folio}}}%
6689 % Tell \shipout to create a pdf destination on each page, if we're
6690 % writing pdf. These are used in the table of contents. We can't
6691 % just write one on every page because the title pages are numbered
6692 % 1 and 2 (the page numbers aren't printed), and so are the first
6693 % two pages of the document. Thus, we'd have two destinations named
6694 % `1', and two named `2'.
6696 \global\pdfmakepagedesttrue
6701 % These characters do not print properly in the Computer Modern roman
6702 % fonts, so we must take special care. This is more or less redundant
6703 % with the Texinfo input format setup at the end of this file.
6705 \def\activecatcodes{%
6718 % Read the toc file, which is essentially Texinfo input.
6722 \input \tocreadfilename
6725 \newskip\contentsrightmargin \contentsrightmargin=1in
6726 \newcount\savepageno
6727 \newcount\lastnegativepageno \lastnegativepageno = -1
6729 % Prepare to read what we've written to \tocfile.
6731 \def\startcontents#1{%
6732 % If @setchapternewpage on, and @headings double, the contents should
6733 % start on an odd page, unlike chapters.
6735 \immediate\closeout\tocfile
6737 % Don't need to put `Contents' or `Short Contents' in the headline.
6738 % It is abundantly clear what they are.
6739 \chapmacro{#1}{Yomitfromtoc}{}%
6741 \savepageno = \pageno
6742 \begingroup % Set up to handle contents files properly.
6743 \raggedbottom % Worry more about breakpoints than the bottom.
6744 \entryrightmargin=\contentsrightmargin % Don't use the full line length.
6746 % Roman numerals for page numbers.
6747 \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi
6748 \def\thistitle{}% no title in double-sided headings
6749 % Record where the Roman numerals started.
6750 \ifnum\romancount=0 \global\romancount=\pagecount \fi
6753 % redefined for the two-volume lispref. We always output on
6754 % \jobname.toc even if this is redefined.
6756 \def\tocreadfilename{\jobname.toc}
6758 % Normal (long) toc.
6761 \startcontents{\putwordTOC}%
6762 \openin 1 \tocreadfilename\space
6767 \contentsalignmacro % in case @setchapternewpage odd is in effect
6776 % And just the chapters.
6777 \def\summarycontents{%
6778 \startcontents{\putwordShortTOC}%
6780 \let\partentry = \shortpartentry
6781 \let\numchapentry = \shortchapentry
6782 \let\appentry = \shortchapentry
6783 \let\unnchapentry = \shortunnchapentry
6784 % We want a true roman here for the page numbers.
6786 \let\rm=\shortcontrm \let\bf=\shortcontbf
6787 \let\sl=\shortcontsl \let\tt=\shortconttt
6789 \hyphenpenalty = 10000
6790 \advance\baselineskip by 1pt % Open it up a little.
6791 \def\numsecentry##1##2##3##4{}
6792 \let\appsecentry = \numsecentry
6793 \let\unnsecentry = \numsecentry
6794 \let\numsubsecentry = \numsecentry
6795 \let\appsubsecentry = \numsecentry
6796 \let\unnsubsecentry = \numsecentry
6797 \let\numsubsubsecentry = \numsecentry
6798 \let\appsubsubsecentry = \numsecentry
6799 \let\unnsubsubsecentry = \numsecentry
6800 \openin 1 \tocreadfilename\space
6806 \contentsalignmacro % in case @setchapternewpage odd is in effect
6810 \let\shortcontents = \summarycontents
6812 % Get ready to use Arabic numerals again
6813 \def\contentsendroman{%
6814 \lastnegativepageno = \pageno
6815 \global\pageno = \savepageno
6817 % If \romancount > \arabiccount, the contents are at the end of the
6818 % document. Otherwise, advance where the Arabic numerals start for
6820 \ifnum\romancount>\arabiccount\else\global\arabiccount=\pagecount\fi
6823 % Typeset the label for a chapter or appendix for the short contents.
6824 % The arg is, e.g., `A' for an appendix, or `3' for a chapter.
6826 \def\shortchaplabel#1{%
6827 % This space should be enough, since a single number is .5em, and the
6828 % widest letter (M) is 1em, at least in the Computer Modern fonts.
6829 % But use \hss just in case.
6830 % (This space doesn't include the extra space that gets added after
6831 % the label; that gets put in by \shortchapentry above.)
6833 % We'd like to right-justify chapter numbers, but that looks strange
6834 % with appendix letters. And right-justifying numbers and
6835 % left-justifying letters looks strange when there is less than 10
6836 % chapters. Have to read the whole toc once to know how many chapters
6837 % there are before deciding ...
6838 \hbox to 1em{#1\hss}%
6841 % These macros generate individual entries in the table of contents.
6842 % The first argument is the chapter or section name.
6843 % The last argument is the page number.
6844 % The arguments in between are the chapter number, section number, ...
6846 % Parts, in the main contents. Replace the part number, which doesn't
6847 % exist, with an empty box. Let's hope all the numbers have the same width.
6848 % Also ignore the page number, which is conventionally not printed.
6849 \def\numeralbox{\setbox0=\hbox{8}\hbox to \wd0{\hfil}}
6850 \def\partentry#1#2#3#4{%
6851 % Add stretch and a bonus for breaking the page before the part heading.
6852 % This reduces the chance of the page being broken immediately after the
6853 % part heading, before a following chapter heading.
6854 \vskip 0pt plus 5\baselineskip
6856 \vskip 0pt plus -5\baselineskip
6857 \dochapentry{\numeralbox\labelspace#1}{}%
6860 % Parts, in the short toc.
6861 \def\shortpartentry#1#2#3#4{%
6863 \vskip.5\baselineskip plus.15\baselineskip minus.1\baselineskip
6864 \shortchapentry{{\bf #1}}{\numeralbox}{}{}%
6867 % Chapters, in the main contents.
6868 \def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}}
6870 % Chapters, in the short toc.
6871 % See comments in \dochapentry re vbox and related settings.
6872 \def\shortchapentry#1#2#3#4{%
6873 \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#4\egroup}%
6876 % Appendices, in the main contents.
6877 % Need the word Appendix, and a fixed-size box.
6879 \def\appendixbox#1{%
6880 % We use M since it's probably the widest letter.
6881 \setbox0 = \hbox{\putwordAppendix{} M}%
6882 \hbox to \wd0{\putwordAppendix{} #1\hss}}
6884 \def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\hskip.7em#1}{#4}}
6886 % Unnumbered chapters.
6887 \def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}}
6888 \def\shortunnchapentry#1#2#3#4{\tocentry{#1}{\doshortpageno\bgroup#4\egroup}}
6891 \def\numsecentry#1#2#3#4{\dosecentry{#2\labelspace#1}{#4}}
6892 \let\appsecentry=\numsecentry
6893 \def\unnsecentry#1#2#3#4{\dosecentry{#1}{#4}}
6896 \def\numsubsecentry#1#2#3#4{\dosubsecentry{#2\labelspace#1}{#4}}
6897 \let\appsubsecentry=\numsubsecentry
6898 \def\unnsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}}
6900 % And subsubsections.
6901 \def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#2\labelspace#1}{#4}}
6902 \let\appsubsubsecentry=\numsubsubsecentry
6903 \def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#4}}
6905 % This parameter controls the indentation of the various levels.
6906 % Same as \defaultparindent.
6907 \newdimen\tocindent \tocindent = 15pt
6909 % Now for the actual typesetting. In all these, #1 is the text and #2 is the
6912 % If the toc has to be broken over pages, we want it to be at chapters
6913 % if at all possible; hence the \penalty.
6914 \def\dochapentry#1#2{%
6915 \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip
6917 % Move the page numbers slightly to the right
6918 \advance\entryrightmargin by -0.05em
6920 \tocentry{#1}{\dopageno\bgroup#2\egroup}%
6922 \nobreak\vskip .25\baselineskip plus.1\baselineskip
6925 \def\dosecentry#1#2{\begingroup
6926 \secentryfonts \leftskip=\tocindent
6927 \tocentry{#1}{\dopageno\bgroup#2\egroup}%
6930 \def\dosubsecentry#1#2{\begingroup
6931 \subsecentryfonts \leftskip=2\tocindent
6932 \tocentry{#1}{\dopageno\bgroup#2\egroup}%
6935 \def\dosubsubsecentry#1#2{\begingroup
6936 \subsubsecentryfonts \leftskip=3\tocindent
6937 \tocentry{#1}{\dopageno\bgroup#2\egroup}%
6940 % We use the same \entry macro as for the index entries.
6941 \let\tocentry = \entry
6943 % Space between chapter (or whatever) number and the title.
6944 \def\labelspace{\hskip1em \relax}
6946 \def\dopageno#1{{\rm #1}}
6947 \def\doshortpageno#1{{\rm #1}}
6949 \def\chapentryfonts{\secfonts \rm}
6950 \def\secentryfonts{\textfonts}
6951 \def\subsecentryfonts{\textfonts}
6952 \def\subsubsecentryfonts{\textfonts}
6955 \message{environments,}
6956 % @foo ... @end foo.
6958 % @tex ... @end tex escapes into raw TeX temporarily.
6959 % One exception: @ is still an escape character, so that @end tex works.
6960 % But \@ or @@ will get a plain @ character.
6964 \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
6965 \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
6966 \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie
6976 % ' is active in math mode (mathcode"8000). So reset it, and all our
6977 % other math active characters (just in case), to plain's definitions.
6980 % Inverse of the list at the beginning of the file.
6982 \let\bullet=\ptexbullet
6987 \let\equiv=\ptexequiv
6990 \let\indent=\ptexindent
6991 \let\noindent=\ptexnoindent
6998 %\let\sup=\ptexsup % do not redefine, we want @sup to work in math mode
7000 \expandafter \let\csname top\endcsname=\ptextop % we've made it outer
7001 \let\frenchspacing=\plainfrenchspacing
7003 \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
7004 \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}%
7007 % There is no need to define \Etex.
7009 % Define @lisp ... @end lisp.
7010 % @lisp environment forms a group so it can rebind things,
7011 % including the definition of @end lisp (which normally is erroneous).
7013 % Amount to narrow the margins by for @lisp.
7014 \newskip\lispnarrowing \lispnarrowing=0.4in
7016 % This is the definition that ^^M gets inside @lisp, @example, and other
7017 % such environments. \null is better than a space, since it doesn't
7019 \def\lisppar{\null\endgraf}
7021 % This space is always present above and below environments.
7022 \newskip\envskipamount \envskipamount = 0pt
7024 % Make spacing and below environment symmetrical. We use \parskip here
7025 % to help in doing that, since in @example-like environments \parskip
7026 % is reset to zero; thus the \afterenvbreak inserts no space -- but the
7027 % start of the next paragraph will insert \parskip.
7029 \def\aboveenvbreak{{%
7030 % =10000 instead of <10000 because of a special case in \itemzzz and
7031 % \sectionheading, q.v.
7032 \ifnum \lastpenalty=10000 \else
7033 \advance\envskipamount by \parskip
7035 \ifdim\lastskip<\envskipamount
7037 \ifnum\lastpenalty<10000
7038 % Penalize breaking before the environment, because preceding text
7039 % often leads into it.
7042 \vskip\envskipamount
7047 \def\afterenvbreak{{%
7048 % =10000 instead of <10000 because of a special case in \itemzzz and
7049 % \sectionheading, q.v.
7050 \ifnum \lastpenalty=10000 \else
7051 \advance\envskipamount by \parskip
7053 \ifdim\lastskip<\envskipamount
7055 % it's not a good place to break if the last penalty was \nobreak
7057 \ifnum\lastpenalty<10000 \penalty-50 \fi
7058 \vskip\envskipamount
7063 % \nonarrowing is a flag. If "set", @lisp etc don't narrow margins; it will
7064 % also clear it, so that its embedded environments do the narrowing again.
7065 \let\nonarrowing=\relax
7067 % @cartouche ... @end cartouche: draw rectangle w/rounded corners around
7068 % environment contents.
7071 \def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth
7072 \def\ctr{{\hskip 6pt\circle\char'010}}
7073 \def\cbl{{\circle\char'012\hskip -6pt}}
7074 \def\cbr{{\hskip 6pt\circle\char'011}}
7075 \def\carttop{\hbox to \cartouter{\hskip\lskip
7076 \ctl\leaders\hrule height\circthick\hfil\ctr
7078 \def\cartbot{\hbox to \cartouter{\hskip\lskip
7079 \cbl\leaders\hrule height\circthick\hfil\cbr
7082 \newskip\lskip\newskip\rskip
7084 % only require the font if @cartouche is actually used
7085 \def\cartouchefontdefs{%
7086 \font\circle=lcircle10\relax
7087 \circthick=\fontdimen8\circle
7090 \newdimen\cartouter\newdimen\cartinner
7091 \newskip\normbskip\newskip\normpskip\newskip\normlskip
7096 \ifhmode\par\fi % can't be in the midst of a paragraph.
7098 \lskip=\leftskip \rskip=\rightskip
7099 \leftskip=0pt\rightskip=0pt % we want these *outside*.
7100 \cartinner=\hsize \advance\cartinner by-\lskip
7101 \advance\cartinner by-\rskip
7103 \advance\cartouter by 18.4pt % allow for 3pt kerns on either
7104 % side, and for 6pt waste from
7105 % each corner char, and rule thickness
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=\vbox\bgroup
7114 \baselineskip=0pt\parskip=0pt\lineskip=0pt
7122 \baselineskip=\normbskip
7123 \lineskip=\normlskip
7126 \comment % For explanation, see the end of def\group.
7142 % This macro is called at the beginning of all the @example variants,
7144 \newdimen\nonfillparindent
7147 \ifdim\hfuzz < 12pt \hfuzz = 12pt \fi % Don't be fussy
7148 \sepspaces % Make spaces be word-separators rather than space tokens.
7149 \let\par = \lisppar % don't ignore blank lines
7150 \obeylines % each line of input is a line of output
7152 % Turn off paragraph indentation but redefine \indent to emulate
7153 % the normal \indent.
7154 \nonfillparindent=\parindent
7156 \let\indent\nonfillindent
7158 \emergencystretch = 0pt % don't try to avoid overfull boxes
7159 \ifx\nonarrowing\relax
7160 \advance \leftskip by \lispnarrowing
7161 \exdentamount=\lispnarrowing
7163 \let\nonarrowing = \relax
7165 \let\exdent=\nofillexdent
7170 % We want to swallow spaces (but not other tokens) after the fake
7171 % @indent in our nonfill-environments, where spaces are normally
7172 % active and set to @tie, resulting in them not being ignored after
7174 \gdef\nonfillindent{\futurelet\temp\nonfillindentcheck}%
7175 \gdef\nonfillindentcheck{%
7177 \expandafter\nonfillindentgobble%
7179 \leavevmode\nonfillindentbox%
7183 \def\nonfillindentgobble#1{\nonfillindent}
7184 \def\nonfillindentbox{\hbox to \nonfillparindent{\hss}}
7186 % If you want all examples etc. small: @set dispenvsize small.
7187 % If you want even small examples the full size: @set dispenvsize nosmall.
7188 % This affects the following displayed environments:
7189 % @example, @display, @format, @lisp, @verbatim
7191 \def\smallword{small}
7192 \def\nosmallword{nosmall}
7193 \let\SETdispenvsize\relax
7194 \def\setnormaldispenv{%
7195 \ifx\SETdispenvsize\smallword
7196 % end paragraph for sake of leading, in case document has no blank
7197 % line. This is redundant with what happens in \aboveenvbreak, but
7198 % we need to do it before changing the fonts, and it's inconvenient
7199 % to change the fonts afterward.
7200 \ifnum \lastpenalty=10000 \else \endgraf \fi
7201 \smallexamplefonts \rm
7204 \def\setsmalldispenv{%
7205 \ifx\SETdispenvsize\nosmallword
7207 \ifnum \lastpenalty=10000 \else \endgraf \fi
7208 \smallexamplefonts \rm
7212 % We often define two environments, @foo and @smallfoo.
7213 % Let's do it in one command. #1 is the env name, #2 the definition.
7214 \def\makedispenvdef#1#2{%
7215 \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2}%
7216 \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2}%
7217 \expandafter\let\csname E#1\endcsname \afterenvbreak
7218 \expandafter\let\csname Esmall#1\endcsname \afterenvbreak
7221 % Define two environment synonyms (#1 and #2) for an environment.
7222 \def\maketwodispenvdef#1#2#3{%
7223 \makedispenvdef{#1}{#3}%
7224 \makedispenvdef{#2}{#3}%
7227 % @lisp: indented, narrowed, typewriter font;
7228 % @example: same as @lisp.
7230 % @smallexample and @smalllisp: use smaller fonts.
7231 % Originally contributed by Pavel@xerox.
7233 \maketwodispenvdef{lisp}{example}{%
7236 \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
7239 % @display/@smalldisplay: same as @lisp except keep current font.
7241 \makedispenvdef{display}{%
7246 % @format/@smallformat: same as @display except don't narrow margins.
7248 \makedispenvdef{format}{%
7249 \let\nonarrowing = t%
7254 % @flushleft: same as @format, but doesn't obey \SETdispenvsize.
7256 \let\nonarrowing = t%
7260 \let\Eflushleft = \afterenvbreak
7264 \envdef\flushright{%
7265 \let\nonarrowing = t%
7267 \advance\leftskip by 0pt plus 1fill\relax
7270 \let\Eflushright = \afterenvbreak
7273 % @raggedright does more-or-less normal line breaking but no right
7274 % justification. From plain.tex.
7275 \envdef\raggedright{%
7276 \rightskip0pt plus2.4em \spaceskip.3333em \xspaceskip.5em\relax
7278 \let\Eraggedright\par
7280 \envdef\raggedleft{%
7281 \parindent=0pt \leftskip0pt plus2em
7282 \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt
7283 \hbadness=10000 % Last line will usually be underfull, so turn off
7284 % badness reporting.
7286 \let\Eraggedleft\par
7288 \envdef\raggedcenter{%
7289 \parindent=0pt \rightskip0pt plus1em \leftskip0pt plus1em
7290 \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt
7291 \hbadness=10000 % Last line will usually be underfull, so turn off
7292 % badness reporting.
7294 \let\Eraggedcenter\par
7297 % @quotation does normal linebreaking (hence we can't use \nonfillstart)
7298 % and narrows the margins. We keep \parskip nonzero in general, since
7299 % we're doing normal filling. So, when using \aboveenvbreak and
7300 % \afterenvbreak, temporarily make \parskip 0.
7302 \makedispenvdef{quotation}{\quotationstart}
7304 \def\quotationstart{%
7305 \indentedblockstart % same as \indentedblock, but increase right margin too.
7306 \ifx\nonarrowing\relax
7307 \advance\rightskip by \lispnarrowing
7309 \parsearg\quotationlabel
7312 % We have retained a nonzero parskip for the environment, since we're
7313 % doing normal filling.
7317 \ifx\quotationauthor\thisisundefined\else
7319 \leftline{\kern 2\leftskip \sl ---\quotationauthor}%
7321 {\parskip=0pt \afterenvbreak}%
7323 \def\Esmallquotation{\Equotation}
7325 % If we're given an argument, typeset it in bold with a colon after.
7326 \def\quotationlabel#1{%
7328 \ifx\temp\empty \else
7333 % @indentedblock is like @quotation, but indents only on the left and
7334 % has no optional argument.
7336 \makedispenvdef{indentedblock}{\indentedblockstart}
7338 \def\indentedblockstart{%
7339 {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
7342 % @cartouche defines \nonarrowing to inhibit narrowing at next level down.
7343 \ifx\nonarrowing\relax
7344 \advance\leftskip by \lispnarrowing
7345 \exdentamount = \lispnarrowing
7347 \let\nonarrowing = \relax
7351 % Keep a nonzero parskip for the environment, since we're doing normal filling.
7353 \def\Eindentedblock{%
7355 {\parskip=0pt \afterenvbreak}%
7357 \def\Esmallindentedblock{\Eindentedblock}
7360 % LaTeX-like @verbatim...@end verbatim and @verb{<char>...<char>}
7361 % If we want to allow any <char> as delimiter,
7362 % we need the curly braces so that makeinfo sees the @verb command, eg:
7363 % `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org
7365 % [Knuth]: Donald Ervin Knuth, 1996. The TeXbook.
7367 % [Knuth] p.344; only we need to do the other characters Texinfo sets
7368 % active too. Otherwise, they get lost as the first character on a
7371 \do\ \do\\\do\{\do\}\do\$\do\&%
7372 \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~%
7373 \do\<\do\>\do\|\do\@\do+\do\"%
7374 % Don't do the quotes -- if we do, @set txicodequoteundirected and
7375 % @set txicodequotebacktick will not have effect on @verb and
7376 % @verbatim, and ?` and !` ligatures won't get disabled.
7381 \def\uncatcodespecials{%
7382 \def\do##1{\catcode`##1=\other}\dospecials}
7384 % Setup for the @verb command.
7386 % Eight spaces for a tab
7388 \catcode`\^^I=\active
7389 \gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }}
7393 \tt % easiest (and conventionally used) font for verbatim
7394 \def\par{\leavevmode\endgraf}%
7397 % Respect line breaks,
7398 % print special symbols as themselves, and
7399 % make each space count
7400 % must do in this order:
7401 \obeylines \uncatcodespecials \sepspaces
7404 % Setup for the @verbatim environment
7406 % Real tab expansion.
7407 \newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount
7409 % We typeset each line of the verbatim in an \hbox, so we can handle
7412 \def\starttabbox{\setbox\verbbox=\hbox\bgroup}
7415 \catcode`\^^I=\active
7417 \catcode`\^^I=\active
7418 \def^^I{\leavevmode\egroup
7419 \dimen\verbbox=\wd\verbbox % the width so far, or since the previous tab
7420 \divide\dimen\verbbox by\tabw
7421 \multiply\dimen\verbbox by\tabw % compute previous multiple of \tabw
7422 \advance\dimen\verbbox by\tabw % advance to next multiple of \tabw
7423 \wd\verbbox=\dimen\verbbox
7424 \leavevmode\box\verbbox \starttabbox
7429 % start the verbatim environment.
7430 \def\setupverbatim{%
7431 \let\nonarrowing = t%
7433 \tt % easiest (and conventionally used) font for verbatim
7434 \def\par{\egroup\leavevmode\box\verbbox\endgraf\starttabbox}%
7437 % Respect line breaks,
7438 % print special symbols as themselves, and
7439 % make each space count.
7440 % Must do in this order:
7441 \obeylines \uncatcodespecials \sepspaces
7444 % Do the @verb magic: verbatim text is quoted by unique
7445 % delimiter characters. Before first delimiter expect a
7446 % right brace, after last delimiter expect closing brace:
7448 % \def\doverb'{'<char>#1<char>'}'{#1}
7450 % [Knuth] p. 382; only eat outer {}
7452 \catcode`[=1\catcode`]=2\catcode`\{=\other\catcode`\}=\other
7453 \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next]
7456 \def\verb{\begingroup\setupverb\doverb}
7459 % Do the @verbatim magic: define the macro \doverbatim so that
7460 % the (first) argument ends when '@end verbatim' is reached, ie:
7462 % \def\doverbatim#1@end verbatim{#1}
7464 % For Texinfo it's a lot easier than for LaTeX,
7465 % because texinfo's \verbatim doesn't stop at '\end{verbatim}':
7466 % we need not redefine '\', '{' and '}'.
7468 % Inspired by LaTeX's verbatim command set [latex.ltx]
7473 % ignore everything up to the first ^^M, that's the newline at the end
7474 % of the @verbatim input line itself. Otherwise we get an extra blank
7475 % line in the output.
7476 \xdef\doverbatim#1^^M#2@end verbatim{%
7477 \starttabbox#2\egroup\noexpand\end\gobble verbatim}%
7478 % We really want {...\end verbatim} in the body of the macro, but
7479 % without the active space; thus we have to use \xdef and \gobble.
7480 % The \egroup ends the \verbbox started at the end of the last line in
7485 \setnormaldispenv\setupverbatim\doverbatim
7487 \let\Everbatim = \afterenvbreak
7490 % @verbatiminclude FILE - insert text of file in verbatim environment.
7492 \def\verbatiminclude{\parseargusing\filenamecatcodes\doverbatiminclude}
7494 \def\doverbatiminclude#1{%
7496 \makevalueexpandable
7499 \indexnofonts % Allow `@@' and other weird things in file names.
7500 \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}%
7501 \edef\tmp{\noexpand\input #1 }
7503 }\expandafter\starttabbox\tmp\egroup
7508 % @copying ... @end copying.
7509 % Save the text away for @insertcopying later.
7511 % We save the uninterpreted tokens, rather than creating a box.
7512 % Saving the text in a box would be much easier, but then all the
7513 % typesetting commands (@smallbook, font changes, etc.) have to be done
7514 % beforehand -- and a) we want @copying to be done first in the source
7515 % file; b) letting users define the frontmatter in as flexible order as
7516 % possible is desirable.
7518 \def\copying{\checkenv{}\begingroup\scanargctxt\docopying}
7519 \def\docopying#1@end copying{\endgroup\def\copyingtext{#1}}
7521 \def\insertcopying{%
7523 \parindent = 0pt % paragraph indentation looks wrong on title page
7524 \scanexp\copyingtext
7532 \newskip\defbodyindent \defbodyindent=.4in
7533 \newskip\defargsindent \defargsindent=50pt
7534 \newskip\deflastargmargin \deflastargmargin=18pt
7535 \newcount\defunpenalty
7537 % Start the processing of @deffn:
7539 \ifnum\lastpenalty<10000
7541 \defunpenalty=10003 % Will keep this @deffn together with the
7542 % following @def command, see below.
7544 % If there are two @def commands in a row, we'll have a \nobreak,
7545 % which is there to keep the function description together with its
7546 % header. But if there's nothing but headers, we need to allow a
7547 % break somewhere. Check specifically for penalty 10002, inserted
7548 % by \printdefunline, instead of 10000, since the sectioning
7549 % commands also insert a nobreak penalty, and we don't want to allow
7550 % a break between a section heading and a defun.
7552 % As a further refinement, we avoid "club" headers by signalling
7553 % with penalty of 10003 after the very first @deffn in the
7554 % sequence (see above), and penalty of 10002 after any following
7556 \ifnum\lastpenalty=10002 \penalty2000 \else \defunpenalty=10002 \fi
7558 % Similarly, after a section heading, do not allow a break.
7559 % But do insert the glue.
7560 \medskip % preceded by discardable penalty, so not a breakpoint
7564 \advance\leftskip by \defbodyindent
7565 \exdentamount=\defbodyindent
7569 % First, check whether we are in the right environment:
7572 % As above, allow line break if we have multiple x headers in a row.
7573 % It's not a great place, though.
7574 \ifnum\lastpenalty=10002 \penalty3000 \else \defunpenalty=10002 \fi
7576 % And now, it's time to reuse the body of the original defun:
7577 \expandafter\gobbledefun#1%
7579 \def\gobbledefun#1\startdefun{}
7581 % \printdefunline \deffnheader{text}
7583 \def\printdefunline#1#2{%
7586 % call \deffnheader:
7589 \interlinepenalty = 10000
7590 \advance\rightskip by 0pt plus 1fil\relax
7592 \nobreak\vskip -\parskip
7593 \penalty\defunpenalty % signal to \startdefun and \dodefunx
7594 % Some of the @defun-type tags do not enable magic parentheses,
7595 % rendering the following check redundant. But we don't optimize.
7600 \def\Edefun{\endgraf\medbreak}
7602 % \makedefun{deffn} creates \deffn, \deffnx and \Edeffn;
7603 % the only thing remaining is to define \deffnheader.
7606 \expandafter\let\csname E#1\endcsname = \Edefun
7607 \edef\temp{\noexpand\domakedefun
7608 \makecsname{#1}\makecsname{#1x}\makecsname{#1header}}%
7612 % \domakedefun \deffn \deffnx \deffnheader { (defn. of \deffnheader) }
7614 % Define \deffn and \deffnx, without parameters.
7615 % \deffnheader has to be defined explicitly.
7617 \def\domakedefun#1#2#3{%
7620 \doingtypefnfalse % distinguish typed functions from all else
7621 \parseargusing\activeparens{\printdefunline#3}%
7623 \def#2{\dodefunx#1}%
7627 \newif\ifdoingtypefn % doing typed function?
7628 \newif\ifrettypeownline % typeset return type on its own line?
7630 % @deftypefnnewline on|off says whether the return type of typed functions
7631 % are printed on their own line. This affects @deftypefn, @deftypefun,
7632 % @deftypeop, and @deftypemethod.
7634 \parseargdef\deftypefnnewline{%
7637 \expandafter\let\csname SETtxideftypefnnl\endcsname
7639 \else\ifx\temp\offword
7640 \expandafter\let\csname SETtxideftypefnnl\endcsname
7643 \errhelp = \EMsimple
7644 \errmessage{Unknown @txideftypefnnl value `\temp',
7649 % \dosubind {index}{topic}{subtopic}
7651 % If SUBTOPIC is present, precede it with a space, and call \doind.
7652 % (At some time during the 20th century, this made a two-level entry in an
7653 % index such as the operation index. Nobody seemed to notice the change in
7654 % behaviour though.)
7655 \def\dosubind#1#2#3{%
7660 \doind{#1}{#2\space#3}%
7664 % Untyped functions:
7666 % @deffn category name args
7667 \makedefun{deffn}{\deffngeneral{}}
7669 % @deffn category class name args
7670 \makedefun{defop}#1 {\defopon{#1\ \putwordon}}
7672 % \defopon {category on}class name args
7673 \def\defopon#1#2 {\deffngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} }
7675 % \deffngeneral {subind}category name args
7677 \def\deffngeneral#1#2 #3 #4\endheader{%
7678 \dosubind{fn}{\code{#3}}{#1}%
7679 \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}%
7684 % @deftypefn category type name args
7685 \makedefun{deftypefn}{\deftypefngeneral{}}
7687 % @deftypeop category class type name args
7688 \makedefun{deftypeop}#1 {\deftypeopon{#1\ \putwordon}}
7690 % \deftypeopon {category on}class type name args
7691 \def\deftypeopon#1#2 {\deftypefngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} }
7693 % \deftypefngeneral {subind}category type name args
7695 \def\deftypefngeneral#1#2 #3 #4 #5\endheader{%
7696 \dosubind{fn}{\code{#4}}{#1}%
7698 \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
7703 % @deftypevr category type var args
7704 \makedefun{deftypevr}{\deftypecvgeneral{}}
7706 % @deftypecv category class type var args
7707 \makedefun{deftypecv}#1 {\deftypecvof{#1\ \putwordof}}
7709 % \deftypecvof {category of}class type var args
7710 \def\deftypecvof#1#2 {\deftypecvgeneral{\putwordof\ \code{#2}}{#1\ \code{#2}} }
7712 % \deftypecvgeneral {subind}category type var args
7714 \def\deftypecvgeneral#1#2 #3 #4 #5\endheader{%
7715 \dosubind{vr}{\code{#4}}{#1}%
7716 \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
7719 % Untyped variables:
7721 % @defvr category var args
7722 \makedefun{defvr}#1 {\deftypevrheader{#1} {} }
7724 % @defcv category class var args
7725 \makedefun{defcv}#1 {\defcvof{#1\ \putwordof}}
7727 % \defcvof {category of}class var args
7728 \def\defcvof#1#2 {\deftypecvof{#1}#2 {} }
7732 % @deftp category name args
7733 \makedefun{deftp}#1 #2 #3\endheader{%
7734 \doind{tp}{\code{#2}}%
7735 \defname{#1}{}{#2}\defunargs{#3\unskip}%
7738 % Remaining @defun-like shortcuts:
7739 \makedefun{defun}{\deffnheader{\putwordDeffunc} }
7740 \makedefun{defmac}{\deffnheader{\putwordDefmac} }
7741 \makedefun{defspec}{\deffnheader{\putwordDefspec} }
7742 \makedefun{deftypefun}{\deftypefnheader{\putwordDeffunc} }
7743 \makedefun{defvar}{\defvrheader{\putwordDefvar} }
7744 \makedefun{defopt}{\defvrheader{\putwordDefopt} }
7745 \makedefun{deftypevar}{\deftypevrheader{\putwordDefvar} }
7746 \makedefun{defmethod}{\defopon\putwordMethodon}
7747 \makedefun{deftypemethod}{\deftypeopon\putwordMethodon}
7748 \makedefun{defivar}{\defcvof\putwordInstanceVariableof}
7749 \makedefun{deftypeivar}{\deftypecvof\putwordInstanceVariableof}
7751 % \defname, which formats the name of the @def (not the args).
7752 % #1 is the category, such as "Function".
7753 % #2 is the return type, if any.
7754 % #3 is the function name.
7756 % We are followed by (but not passed) the arguments, if any.
7758 \def\defname#1#2#3{%
7760 % Get the values of \leftskip and \rightskip as they were outside the @def...
7761 \advance\leftskip by -\defbodyindent
7763 % Determine if we are typesetting the return type of a typed function
7764 % on a line by itself.
7765 \rettypeownlinefalse
7766 \ifdoingtypefn % doing a typed function specifically?
7767 % then check user option for putting return type on its own line:
7768 \expandafter\ifx\csname SETtxideftypefnnl\endcsname\relax \else
7773 % How we'll format the category name. Putting it in brackets helps
7774 % distinguish it from the body text that may end up on the next line
7777 \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi}
7779 % Figure out line sizes for the paragraph shape. We'll always have at
7783 % The first line needs space for \box0; but if \rightskip is nonzero,
7784 % we need only space for the part of \box0 which exceeds it:
7785 \dimen0=\hsize \advance\dimen0 by -\wd0 \advance\dimen0 by \rightskip
7787 % If doing a return type on its own line, we'll have another line.
7789 \advance\tempnum by 1
7790 \def\maybeshapeline{0in \hsize}%
7792 \def\maybeshapeline{}%
7795 % The continuations:
7796 \dimen2=\hsize \advance\dimen2 by -\defargsindent
7798 % The final paragraph shape:
7799 \parshape \tempnum 0in \dimen0 \maybeshapeline \defargsindent \dimen2
7801 % Put the category name at the right margin.
7804 \hfil\box0 \kern-\hsize
7805 % \hsize has to be shortened this way:
7807 % Intentionally do not respect \rightskip, since we need the space.
7810 % Allow all lines to be underfull without complaint:
7811 \tolerance=10000 \hbadness=10000
7812 \exdentamount=\defbodyindent
7814 % defun fonts. We use typewriter by default (used to be bold) because:
7815 % . we're printing identifiers, they should be in tt in principle.
7816 % . in languages with many accents, such as Czech or French, it's
7817 % common to leave accents off identifiers. The result looks ok in
7818 % tt, but exceedingly strange in rm.
7819 % . we don't want -- and --- to be treated as ligatures.
7820 % . this still does not fix the ?` and !` ligatures, but so far no
7821 % one has made identifiers using them :).
7823 \def\temp{#2}% text of the return type
7824 \ifx\temp\empty\else
7825 \tclose{\temp}% typeset the return type
7827 % put return type on its own line; prohibit line break following:
7828 \hfil\vadjust{\nobreak}\break
7830 \space % type on same line, so just followed by a space
7832 \fi % no return type
7833 #3% output function name
7835 {\rm\enskip}% hskip 0.5 em of \rmfont
7838 % arguments will be output next, if any.
7841 % Print arguments in slanted roman (not ttsl), inconsistently with using
7842 % tt for the name. This is because literal text is sometimes needed in
7843 % the argument list (groff manual), and ttsl and tt are not very
7844 % distinguishable. Prevent hyphenation at `-' chars.
7847 % use sl by default (not ttsl),
7849 \df \sl \hyphenchar\font=0
7851 % On the other hand, if an argument has two dashes (for instance), we
7852 % want a way to get ttsl. We used to recommend @var for that, so
7853 % leave the code in, but it's strange for @var to lead to typewriter.
7854 % Nowadays we recommend @code, since the difference between a ttsl hyphen
7855 % and a tt hyphen is pretty tiny. @code also disables ?` !`.
7856 \def\var##1{{\setregularquotes\ttslanted{##1}}}%
7858 \sl\hyphenchar\font=45
7861 % We want ()&[] to print specially on the defun line.
7864 \catcode`\(=\active \catcode`\)=\active
7865 \catcode`\[=\active \catcode`\]=\active
7869 % Make control sequences which act like normal parenthesis chars.
7870 \let\lparen = ( \let\rparen = )
7872 % Be sure that we always have a definition for `(', etc. For example,
7873 % if the fn name has parens in it, \boldbrax will not be in effect yet,
7874 % so TeX would otherwise complain about undefined control sequence.
7877 \global\let(=\lparen \global\let)=\rparen
7878 \global\let[=\lbrack \global\let]=\rbrack
7881 \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}
7882 \gdef\magicamp{\let&=\amprm}
7886 \newcount\parencount
7888 % If we encounter &foo, then turn on ()-hacking afterwards
7890 \def\amprm#1 {\ampseentrue{\bf\ }}
7894 % At the first level, print parens in roman,
7895 % otherwise use the default font.
7896 \ifnum \parencount=1 \rm \fi
7898 % The \sf parens (in \boldbrax) actually are a little bolder than
7899 % the contained text. This is especially needed for [ and ] .
7903 \def\infirstlevel#1{%
7910 \def\bfafterword#1 {#1 \bf}
7913 \global\advance\parencount by 1
7915 \infirstlevel \bfafterword
7920 \global\advance\parencount by -1
7923 \newcount\brackcount
7925 \global\advance\brackcount by 1
7930 \global\advance\brackcount by -1
7933 \def\checkparencounts{%
7934 \ifnum\parencount=0 \else \badparencount \fi
7935 \ifnum\brackcount=0 \else \badbrackcount \fi
7937 % these should not use \errmessage; the glibc manual, at least, actually
7938 % has such constructs (when documenting function pointers).
7939 \def\badparencount{%
7940 \message{Warning: unbalanced parentheses in @def...}%
7941 \global\parencount=0
7943 \def\badbrackcount{%
7944 \message{Warning: unbalanced square brackets in @def...}%
7945 \global\brackcount=0
7952 % To do this right we need a feature of e-TeX, \scantokens,
7953 % which we arrange to emulate with a temporary file in ordinary TeX.
7954 \ifx\eTeXversion\thisisundefined
7955 \newwrite\macscribble
7958 \immediate\openout\macscribble=\jobname.tmp
7959 \immediate\write\macscribble{\the\toks0}%
7960 \immediate\closeout\macscribble
7967 % Used at the time of macro expansion.
7968 % Argument is macro body with arguments substituted
7971 % expand the expansion of \eatleadingcr twice to maybe remove a leading
7972 % newline (and \else and \fi tokens), then call \eatspaces on the result.
7973 \def\xeatspaces##1{%
7974 \E\E\E\E\E\E\E\eatspaces\E\E\E\E\E\E\E{\eatleadingcr##1%
7978 % Process the macro body under the current catcode regime.
7979 \scantokens{#1@comment}%
7981 % The \comment is to remove the \newlinechar added by \scantokens, and
7982 % can be noticed by \parsearg. Note \c isn't used because this means cedilla
7986 % Used for copying and captions
7988 \expandafter\scanmacro\expandafter{#1}%
7991 \newcount\paramno % Count of parameters
7992 \newtoks\macname % Macro name
7993 \newif\ifrecursive % Is it recursive?
7995 % List of all defined macros in the form
7996 % \commondummyword\macro1\commondummyword\macro2...
7997 % Currently is also contains all @aliases; the list can be split
7998 % if there is a need.
8001 % Add the macro to \macrolist
8002 \def\addtomacrolist#1{\expandafter \addtomacrolistxxx \csname#1\endcsname}
8003 \def\addtomacrolistxxx#1{%
8004 \toks0 = \expandafter{\macrolist\commondummyword#1}%
8005 \xdef\macrolist{\the\toks0}%
8009 % This does \let #1 = #2, with \csnames; that is,
8010 % \let \csname#1\endcsname = \csname#2\endcsname
8011 % (except of course we have to play expansion games).
8015 \csname#1\expandafter\endcsname
8019 % Trim leading and trailing spaces off a string.
8020 % Concepts from aro-bend problem 15 (see CTAN).
8022 \gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }}
8023 \gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@}
8024 \gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @}
8026 \unbrace{\gdef\trim@@@ #1 } #2@{#1}
8029 {\catcode`\^^M=\other%
8030 \gdef\eatleadingcr#1{\if\noexpand#1\noexpand^^M\else\E#1\fi}}%
8031 % Warning: this won't work for a delimited argument
8032 % or for an empty argument
8034 % Trim a single trailing ^^M off a string.
8035 {\catcode`\^^M=\other \catcode`\Q=3%
8036 \gdef\eatcr #1{\eatcra #1Q^^MQ}%
8037 \gdef\eatcra#1^^MQ{\eatcrb#1Q}%
8038 \gdef\eatcrb#1Q#2Q{#1}%
8041 % Macro bodies are absorbed as an argument in a context where
8042 % all characters are catcode 10, 11 or 12, except \ which is active
8043 % (as in normal texinfo). It is necessary to change the definition of \
8044 % to recognize macro arguments; this is the job of \mbodybackslash.
8046 % Non-ASCII encodings make 8-bit characters active, so un-activate
8047 % them to avoid their expansion. Must do this non-globally, to
8048 % confine the change to the current group.
8050 % It's necessary to have hard CRs when the macro is executed. This is
8051 % done by making ^^M (\endlinechar) catcode 12 when reading the macro
8052 % body, and then making it the \newlinechar in \scanmacro.
8054 \def\scanctxt{% used as subroutine
8063 \passthroughcharstrue
8066 \def\scanargctxt{% used for copying and captions, not macros.
8070 \catcode`\^^M=\other
8073 \def\macrobodyctxt{% used for @macro definitions
8079 \catcode`\^^M=\other
8083 % Used when scanning braced macro arguments. Note, however, that catcode
8084 % changes here are ineffectual if the macro invocation was nested inside
8085 % an argument to another Texinfo command.
8090 \catcode`\^^M=\other
8094 \def\macrolineargctxt{% used for whole-line arguments without braces
8101 % \mbodybackslash is the definition of \ in @macro bodies.
8102 % It maps \foo\ => \csname macarg.foo\endcsname => #N
8103 % where N is the macro parameter number.
8104 % We define \csname macarg.\endcsname to be \realbackslash, so
8105 % \\ in macro replacement text gets you a backslash.
8107 {\catcode`@=0 @catcode`@\=@active
8108 @gdef@usembodybackslash{@let\=@mbodybackslash}
8109 @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname}
8111 \expandafter\def\csname macarg.\endcsname{\realbackslash}
8113 \def\margbackslash#1{\char`\#1 }
8115 \def\macro{\recursivefalse\parsearg\macroxxx}
8116 \def\rmacro{\recursivetrue\parsearg\macroxxx}
8119 \getargs{#1}% now \macname is the macname and \argl the arglist
8120 \ifx\argl\empty % no arguments
8123 \expandafter\parsemargdef \argl;%
8124 \if\paramno>256\relax
8125 \ifx\eTeXversion\thisisundefined
8126 \errhelp = \EMsimple
8127 \errmessage{You need eTeX to compile a file with macros with more than 256 arguments}
8131 \if1\csname ismacro.\the\macname\endcsname
8132 \message{Warning: redefining \the\macname}%
8134 \expandafter\ifx\csname \the\macname\endcsname \relax
8135 \else \errmessage{Macro name \the\macname\space already defined}\fi
8136 \global\cslet{macsave.\the\macname}{\the\macname}%
8137 \global\expandafter\let\csname ismacro.\the\macname\endcsname=1%
8138 \addtomacrolist{\the\macname}%
8140 \begingroup \macrobodyctxt
8141 \ifrecursive \expandafter\parsermacbody
8142 \else \expandafter\parsemacbody
8145 \parseargdef\unmacro{%
8146 \if1\csname ismacro.#1\endcsname
8147 \global\cslet{#1}{macsave.#1}%
8148 \global\expandafter\let \csname ismacro.#1\endcsname=0%
8149 % Remove the macro name from \macrolist:
8151 \expandafter\let\csname#1\endcsname \relax
8152 \let\commondummyword\unmacrodo
8153 \xdef\macrolist{\macrolist}%
8156 \errmessage{Macro #1 not defined}%
8160 % Called by \do from \dounmacro on each macro. The idea is to omit any
8161 % macro definitions that have been changed to \relax.
8167 \noexpand\commondummyword \noexpand#1%
8171 % \getargs -- Parse the arguments to a @macro line. Set \macname to
8172 % the name of the macro, and \argl to the braced argument list.
8173 \def\getargs#1{\getargsxxx#1{}}
8174 \def\getargsxxx#1#{\getmacname #1 \relax\getmacargs}
8175 \def\getmacname#1 #2\relax{\macname={#1}}
8176 \def\getmacargs#1{\def\argl{#1}}
8177 % This made use of the feature that if the last token of a
8178 % <parameter list> is #, then the preceding argument is delimited by
8179 % an opening brace, and that opening brace is not consumed.
8181 % Parse the optional {params} list to @macro or @rmacro.
8182 % Set \paramno to the number of arguments,
8183 % and \paramlist to a parameter text for the macro (e.g. #1,#2,#3 for a
8184 % three-param macro.) Define \macarg.BLAH for each BLAH in the params
8185 % list to some hook where the argument is to be expanded. If there are
8186 % less than 10 arguments that hook is to be replaced by ##N where N
8187 % is the position in that list, that is to say the macro arguments are to be
8188 % defined `a la TeX in the macro body.
8190 % That gets used by \mbodybackslash (above).
8192 % If there are 10 or more arguments, a different technique is used: see
8193 % \parsemmanyargdef.
8195 \def\parsemargdef#1;{%
8196 \paramno=0\def\paramlist{}%
8198 % \hash is redefined to `#' later to get it into definitions
8199 \let\xeatspaces\relax
8201 \parsemargdefxxx#1,;,%
8202 \ifnum\paramno<10\relax\else
8204 \parsemmanyargdef@@#1,;,% 10 or more arguments
8207 \def\parsemargdefxxx#1,{%
8208 \if#1;\let\next=\relax
8209 \else \let\next=\parsemargdefxxx
8210 \advance\paramno by 1
8211 \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname
8212 {\xeatspaces{\hash\the\paramno\noexpand\xempty{}}}%
8213 \edef\paramlist{\paramlist\hash\the\paramno,}%
8215 % the \xempty{} is to give \eatleadingcr an argument in the case of an
8216 % empty macro argument.
8218 % \parsemacbody, \parsermacbody
8220 % Read recursive and nonrecursive macro bodies. (They're different since
8221 % rec and nonrec macros end differently.)
8223 % We are in \macrobodyctxt, and the \xdef causes backslashshes in the macro
8224 % body to be transformed.
8225 % Set \macrobody to the body of the macro, and call \defmacro.
8227 {\catcode`\ =\other\long\gdef\parsemacbody#1@end macro{%
8228 \xdef\macrobody{\eatcr{#1}}\endgroup\defmacro}}%
8229 {\catcode`\ =\other\long\gdef\parsermacbody#1@end rmacro{%
8230 \xdef\macrobody{\eatcr{#1}}\endgroup\defmacro}}%
8232 % Make @ a letter, so that we can make private-to-Texinfo macro names.
8233 \edef\texiatcatcode{\the\catcode`\@}
8234 \catcode `@=11\relax
8236 %%%%%%%%%%%%%% Code for > 10 arguments only %%%%%%%%%%%%%%%%%%
8238 % If there are 10 or more arguments, a different technique is used, where the
8239 % hook remains in the body, and when macro is to be expanded the body is
8240 % processed again to replace the arguments.
8242 % In that case, the hook is \the\toks N-1, and we simply set \toks N-1 to the
8243 % argument N value and then \edef the body (nothing else will expand because of
8244 % the catcode regime under which the body was input).
8246 % If you compile with TeX (not eTeX), and you have macros with 10 or more
8247 % arguments, no macro can have more than 256 arguments (else error).
8249 % In case that there are 10 or more arguments we parse again the arguments
8250 % list to set new definitions for the \macarg.BLAH macros corresponding to
8251 % each BLAH argument. It was anyhow needed to parse already once this list
8252 % in order to count the arguments, and as macros with at most 9 arguments
8253 % are by far more frequent than macro with 10 or more arguments, defining
8254 % twice the \macarg.BLAH macros does not cost too much processing power.
8255 \def\parsemmanyargdef@@#1,{%
8256 \if#1;\let\next=\relax
8258 \let\next=\parsemmanyargdef@@
8259 \edef\tempb{\eatspaces{#1}}%
8260 \expandafter\def\expandafter\tempa
8261 \expandafter{\csname macarg.\tempb\endcsname}%
8262 % Note that we need some extra \noexpand\noexpand, this is because we
8263 % don't want \the to be expanded in the \parsermacbody as it uses an
8265 \expandafter\edef\tempa
8266 {\noexpand\noexpand\noexpand\the\toks\the\paramno}%
8267 \advance\paramno by 1\relax
8274 \long\def\nillm@{\nil@}%
8276 % This macro is expanded during the Texinfo macro expansion, not during its
8277 % definition. It gets all the arguments' values and assigns them to macros
8280 % #1 is the macro name
8281 % #2 is the list of argument names
8282 % #3 is the list of argument values
8283 \def\getargvals@#1#2#3{%
8284 \def\macargdeflist@{}%
8285 \def\saveparamlist@{#2}% Need to keep a copy for parameter expansion.
8286 \def\paramlist{#2,\nil@}%
8290 \def\argvaluelist{#3,\nil@}%
8299 \ifx\paramlist\nilm@
8300 % Some sanity check needed here that \argvaluelist is also empty.
8301 \ifx\argvaluelist\nillm@
8303 \errhelp = \EMsimple
8304 \errmessage{Too many arguments in macro `\macroname'!}%
8306 \let\next\macargexpandinbody@
8308 \ifx\argvaluelist\nillm@
8309 % No more arguments values passed to macro. Set remaining named-arg
8311 \let\next\setemptyargvalues@
8313 % pop current arg name into \@tempb
8314 \def\@tempa##1{\pop@{\@tempb}{\paramlist}##1\endargs@}%
8315 \expandafter\@tempa\expandafter{\paramlist}%
8316 % pop current argument value into \@tempc
8317 \def\@tempa##1{\longpop@{\@tempc}{\argvaluelist}##1\endargs@}%
8318 \expandafter\@tempa\expandafter{\argvaluelist}%
8319 % Here \@tempb is the current arg name and \@tempc is the current arg value.
8320 % First place the new argument macro definition into \@tempd
8321 \expandafter\macname\expandafter{\@tempc}%
8322 \expandafter\let\csname macarg.\@tempb\endcsname\relax
8323 \expandafter\def\expandafter\@tempe\expandafter{%
8324 \csname macarg.\@tempb\endcsname}%
8325 \edef\@tempd{\long\def\@tempe{\the\macname}}%
8326 \push@\@tempd\macargdeflist@
8327 \let\next\getargvals@@
8334 \expandafter\expandafter\expandafter\def
8335 \expandafter\expandafter\expandafter#2%
8336 \expandafter\expandafter\expandafter{%
8340 % Replace arguments by their values in the macro body, and place the result
8343 \def\macvalstoargs@{%
8344 % To do this we use the property that token registers that are \the'ed
8345 % within an \edef expand only once. So we are going to place all argument
8346 % values into respective token registers.
8348 % First we save the token context, and initialize argument numbering.
8351 % Then, for each argument number #N, we place the corresponding argument
8352 % value into a new token list register \toks#N
8353 \expandafter\putargsintokens@\saveparamlist@,;,%
8354 % Then, we expand the body so that argument are replaced by their
8355 % values. The trick for values not to be expanded themselves is that they
8356 % are within tokens and that tokens expand only once in an \edef .
8357 \edef\@tempc{\csname mac.\macroname .body\endcsname}%
8358 % Now we restore the token stack pointer to free the token list registers
8359 % which we have used, but we make sure that expanded body is saved after
8363 \expandafter\def\expandafter\@tempa\expandafter{\@tempc}%
8366 % Define the named-macro outside of this group and then close this group.
8368 \def\macargexpandinbody@{%
8372 % First the replace in body the macro arguments by their values, the result
8375 % Then we point at the \norecurse or \gobble (for recursive) macro value
8377 \expandafter\let\expandafter\@tempb\csname mac.\macroname .recurse\endcsname
8378 % Depending on whether it is recursive or not, we need some tailing
8385 % And now we do the real job:
8386 \edef\@tempd{\noexpand\@tempb{\macroname}\noexpand\scanmacro{\@tempa}\@tempc}%
8390 \def\putargsintokens@#1,{%
8391 \if#1;\let\next\relax
8393 \let\next\putargsintokens@
8394 % First we allocate the new token list register, and give it a temporary
8396 \toksdef\@tempb\the\paramno
8397 % Then we place the argument value into that token list register.
8398 \expandafter\let\expandafter\@tempa\csname macarg.#1\endcsname
8399 \expandafter\@tempb\expandafter{\@tempa}%
8400 \advance\paramno by 1\relax
8405 % Trailing missing arguments are set to empty.
8407 \def\setemptyargvalues@{%
8408 \ifx\paramlist\nilm@
8409 \let\next\macargexpandinbody@
8411 \expandafter\setemptyargvaluesparser@\paramlist\endargs@
8412 \let\next\setemptyargvalues@
8417 \def\setemptyargvaluesparser@#1,#2\endargs@{%
8418 \expandafter\def\expandafter\@tempa\expandafter{%
8419 \expandafter\def\csname macarg.#1\endcsname{}}%
8420 \push@\@tempa\macargdeflist@
8424 % #1 is the element target macro
8425 % #2 is the list macro
8426 % #3,#4\endargs@ is the list value
8427 \def\pop@#1#2#3,#4\endargs@{%
8431 \long\def\longpop@#1#2#3,#4\endargs@{%
8437 %%%%%%%%%%%%%% End of code for > 10 arguments %%%%%%%%%%%%%%%%%%
8440 % This defines a Texinfo @macro or @rmacro, called by \parsemacbody.
8441 % \macrobody has the body of the macro in it, with placeholders for
8442 % its parameters, looking like "\xeatspaces{\hash 1}".
8443 % \paramno is the number of parameters
8444 % \paramlist is a TeX parameter text, e.g. "#1,#2,#3,"
8445 % There are four cases: macros of zero, one, up to nine, and many arguments.
8446 % \xdef is used so that macro definitions will survive the file
8447 % they're defined in: @include reads the file inside a group.
8450 \let\hash=##% convert placeholders to macro parameter chars
8452 \def\xeatspaces##1{##1}%
8453 % This removes the pair of braces around the argument. We don't
8454 % use \eatspaces, because this can cause ends of lines to be lost
8455 % when the argument to \eatspaces is read, leading to line-based
8456 % commands like "@itemize" not being read correctly.
8458 \let\xeatspaces\relax % suppress expansion
8462 \expandafter\xdef\csname\the\macname\endcsname{%
8464 \noexpand\spaceisspace
8465 \noexpand\endlineisspace
8466 \noexpand\expandafter % skip any whitespace after the macro name.
8467 \expandafter\noexpand\csname\the\macname @@@\endcsname}%
8468 \expandafter\xdef\csname\the\macname @@@\endcsname{%
8470 \noexpand\scanmacro{\macrobody}}%
8472 \expandafter\xdef\csname\the\macname\endcsname{%
8474 \noexpand\braceorline
8475 \expandafter\noexpand\csname\the\macname @@@\endcsname}%
8476 \expandafter\xdef\csname\the\macname @@@\endcsname##1{%
8478 \noexpand\scanmacro{\macrobody}%
8481 \ifnum\paramno<10\relax
8482 % @MACNAME sets the context for reading the macro argument
8483 % @MACNAME@@ gets the argument, processes backslashes and appends a
8485 % @MACNAME@@@ removes braces surrounding the argument list.
8486 % @MACNAME@@@@ scans the macro body with arguments substituted.
8487 \expandafter\xdef\csname\the\macname\endcsname{%
8489 \noexpand\expandafter % This \expandafter skip any spaces after the
8490 \noexpand\macroargctxt % macro before we change the catcode of space.
8491 \noexpand\expandafter
8492 \expandafter\noexpand\csname\the\macname @@\endcsname}%
8493 \expandafter\xdef\csname\the\macname @@\endcsname##1{%
8494 \noexpand\passargtomacro
8495 \expandafter\noexpand\csname\the\macname @@@\endcsname{##1,}}%
8496 \expandafter\xdef\csname\the\macname @@@\endcsname##1{%
8497 \expandafter\noexpand\csname\the\macname @@@@\endcsname ##1}%
8498 \expandafter\expandafter
8500 \expandafter\expandafter
8501 \csname\the\macname @@@@\endcsname\paramlist{%
8502 \egroup\noexpand\scanmacro{\macrobody}}%
8504 \expandafter\xdef\csname\the\macname\endcsname{%
8505 \noexpand\getargvals@{\the\macname}{\argl}%
8507 \global\expandafter\let\csname mac.\the\macname .body\endcsname\macrobody
8508 \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\gobble
8512 \catcode `\@\texiatcatcode\relax % end private-to-Texinfo catcodes
8514 \def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}}
8517 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8519 {\catcode`\@=0 \catcode`\\=13 % We need to manipulate \ so use @ as escape
8520 @catcode`@_=11 % private names
8521 @catcode`@!=11 % used as argument separator
8523 % \passargtomacro#1#2 -
8524 % Call #1 with a list of tokens #2, with any doubled backslashes in #2
8525 % compressed to one.
8527 % This implementation works by expansion, and not execution (so we cannot use
8528 % \def or similar). This reduces the risk of this failing in contexts where
8529 % complete expansion is done with no execution (for example, in writing out to
8530 % an auxiliary file for an index entry).
8532 % State is kept in the input stream: the argument passed to
8533 % @look_ahead, @gobble_and_check_finish and @add_segment is
8535 % THE_MACRO ARG_RESULT ! {PENDING_BS} NEXT_TOKEN (... rest of input)
8538 % THE_MACRO - name of the macro we want to call
8539 % ARG_RESULT - argument list we build to pass to that macro
8540 % PENDING_BS - either a backslash or nothing
8541 % NEXT_TOKEN - used to look ahead in the input stream to see what's coming next
8543 @gdef@passargtomacro#1#2{%
8544 @add_segment #1!{}@relax#2\@_finish\%
8546 @gdef@_finish{@_finishx} @global@let@_finishx@relax
8548 % #1 - THE_MACRO ARG_RESULT
8551 % #4 used to look ahead
8553 % If the next token is not a backslash, process the rest of the argument;
8554 % otherwise, remove the next token.
8555 @gdef@look_ahead#1!#2#3#4{%
8557 @expandafter@gobble_and_check_finish
8559 @expandafter@add_segment
8563 % #1 - THE_MACRO ARG_RESULT
8566 % #4 should be a backslash, which is gobbled.
8569 % Double backslash found. Add a single backslash, and look ahead.
8570 @gdef@gobble_and_check_finish#1!#2#3#4#5{%
8571 @add_segment#1\!{}#5#5%
8576 % #1 - THE_MACRO ARG_RESULT
8579 % #4 is input stream until next backslash
8581 % Input stream is either at the start of the argument, or just after a
8582 % backslash sequence, either a lone backslash, or a doubled backslash.
8583 % NEXT_TOKEN contains the first token in the input stream: if it is \finish,
8584 % finish; otherwise, append to ARG_RESULT the segment of the argument up until
8585 % the next backslash. PENDING_BACKSLASH contains a backslash to represent
8586 % a backslash just before the start of the input stream that has not been
8587 % added to ARG_RESULT.
8588 @gdef@add_segment#1!#2#3#4\{%
8592 % append the pending backslash to the result, followed by the next segment
8593 @expandafter@is_fi@look_ahead#1#2#4!{\}@fi
8594 % this @fi is discarded by @look_ahead.
8595 % we can't get rid of it with \expandafter because we don't know how
8601 % #3 discards the res of the conditional in @add_segment, and @is_fi ends the
8603 @gdef@call_the_macro#1#2!#3@fi{@is_fi #1{#2}}
8606 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8608 % \braceorline MAC is used for a one-argument macro MAC. It checks
8609 % whether the next non-whitespace character is a {. It sets the context
8610 % for reading the argument (slightly different in the two cases). Then,
8611 % to read the argument, in the whole-line case, it then calls the regular
8612 % \parsearg MAC; in the lbrace case, it calls \passargtomacro MAC.
8614 \def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx}
8615 \def\braceorlinexxx{%
8618 \expandafter\passargtomacro
8620 \macrolineargctxt\expandafter\parsearg
8625 % We need some trickery to remove the optional spaces around the equal
8626 % sign. Make them active and then expand them all to nothing.
8628 \def\alias{\parseargusing\obeyspaces\aliasxxx}
8629 \def\aliasxxx #1{\aliasyyy#1\relax}
8630 \def\aliasyyy #1=#2\relax{%
8632 \expandafter\let\obeyedspace=\empty
8633 \addtomacrolist{#1}%
8634 \xdef\next{\global\let\makecsname{#1}=\makecsname{#2}}%
8640 \message{cross references,}
8643 \newif\ifhavexrefs % True if xref values are known.
8644 \newif\ifwarnedxrefs % True if we warned once that they aren't known.
8646 % @inforef is relatively simple.
8647 \def\inforef #1{\inforefzzz #1,,,,**}
8648 \def\inforefzzz #1,#2,#3,#4**{%
8649 \putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
8650 node \samp{\ignorespaces#1{}}}
8652 % @node's only job in TeX is to define \lastnode, which is used in
8653 % cross-references. The @node line might or might not have commas, and
8654 % might or might not have spaces before the first comma, like:
8655 % @node foo , bar , ...
8656 % We don't want such trailing spaces in the node name.
8658 \parseargdef\node{\checkenv{}\donode #1 ,\finishnodeparse}
8660 % also remove a trailing comma, in case of something like this:
8661 % @node Help-Cross, , , Cross-refs
8662 \def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse}
8663 \def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}\omittopnode}
8665 % Used so that the @top node doesn't have to be wrapped in an @ifnottex
8667 % \doignore goes to more effort to skip nested conditionals but we don't need
8670 \ifx\lastnode\wordTop
8671 \expandafter\ignorenode\fi
8675 % Until the next @node, @part or @bye command, divert output to a box that
8677 \def\ignorenode{\setbox\dummybox\vbox\bgroup
8678 \def\part{\egroup\part}%
8679 \def\node{\egroup\node}%
8684 \gdef\ignorenodebye{\let\bye\ignorenodebyedef}
8685 \gdef\ignorenodebyedef{\egroup(`Top' node ignored)\bye}}
8686 % The redefinition of \bye here is because it is declared \outer
8688 \let\lastnode=\empty
8690 % Write a cross-reference definition for the current node. #1 is the
8691 % type (Ynumbered, Yappendix, Ynothing).
8694 \ifx\lastnode\empty\else
8695 \setref{\lastnode}{#1}%
8696 \global\let\lastnode=\empty
8700 % @anchor{NAME} -- define xref target at arbitrary point.
8702 \newcount\savesfregister
8704 \def\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi}
8705 \def\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi}
8706 \def\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces}
8708 % \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an
8709 % anchor), which consists of three parts:
8710 % 1) NAME-title - the current sectioning name taken from \currentsection,
8711 % or the anchor name.
8712 % 2) NAME-snt - section number and type, passed as the SNT arg, or
8713 % empty for anchors.
8714 % 3) NAME-pg - the page number.
8716 % This is called from \donoderef, \anchor, and \dofloat. In the case of
8717 % floats, there is an additional part, which is not written here:
8718 % 4) NAME-lof - the text as it should appear in a @listoffloats.
8725 \atdummies % preserve commands, but don't expand them
8726 % match definition in \xrdef, \refx, \xrefX.
8728 \edef\writexrdef##1##2{%
8729 \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef
8730 ##1}{##2}}% these are parameters of \writexrdef
8732 \toks0 = \expandafter{\currentsection}%
8733 \immediate \writexrdef{title}{\the\toks0 }%
8734 \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc.
8735 \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, at \shipout
8740 % @xrefautosectiontitle on|off says whether @section(ing) names are used
8741 % automatically in xrefs, if the third arg is not explicitly specified.
8742 % This was provided as a "secret" @set xref-automatic-section-title
8743 % variable, now it's official.
8745 \parseargdef\xrefautomaticsectiontitle{%
8748 \expandafter\let\csname SETxref-automatic-section-title\endcsname
8750 \else\ifx\temp\offword
8751 \expandafter\let\csname SETxref-automatic-section-title\endcsname
8754 \errhelp = \EMsimple
8755 \errmessage{Unknown @xrefautomaticsectiontitle value `\temp',
8761 % @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is
8762 % the node name, #2 the name of the Info cross-reference, #3 the printed
8763 % node name, #4 the name of the Info file, #5 the name of the printed
8764 % manual. All but the node name can be omitted.
8766 \def\pxref{\putwordsee{} \xrefXX}
8767 \def\xref{\putwordSee{} \xrefXX}
8770 \def\xrefXX#1{\def\xrefXXarg{#1}\futurelet\tokenafterxref\xrefXXX}
8771 \def\xrefXXX{\expandafter\xrefX\expandafter[\xrefXXarg,,,,,,,]}
8774 \newbox\printedrefnamebox
8775 \newbox\infofilenamebox
8776 \newbox\printedmanualbox
8778 \def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
8781 % Get args without leading/trailing spaces.
8782 \def\printedrefname{\ignorespaces #3}%
8783 \setbox\printedrefnamebox = \hbox{\printedrefname\unskip}%
8785 \def\infofilename{\ignorespaces #4}%
8786 \setbox\infofilenamebox = \hbox{\infofilename\unskip}%
8788 \def\printedmanual{\ignorespaces #5}%
8789 \setbox\printedmanualbox = \hbox{\printedmanual\unskip}%
8791 % If the printed reference name (arg #3) was not explicitly given in
8792 % the @xref, figure out what we want to use.
8793 \ifdim \wd\printedrefnamebox = 0pt
8794 % No printed node name was explicitly given.
8795 \expandafter\ifx\csname SETxref-automatic-section-title\endcsname \relax
8796 % Not auto section-title: use node name inside the square brackets.
8797 \def\printedrefname{\ignorespaces #1}%
8799 % Auto section-title: use chapter/section title inside
8800 % the square brackets if we have it.
8801 \ifdim \wd\printedmanualbox > 0pt
8802 % It is in another manual, so we don't have it; use node name.
8803 \def\printedrefname{\ignorespaces #1}%
8806 % We (should) know the real title if we have the xref values.
8807 \def\printedrefname{\refx{#1-title}}%
8809 % Otherwise just copy the Info node name.
8810 \def\printedrefname{\ignorespaces #1}%
8816 % Make link in pdf output.
8818 % For pdfTeX and LuaTeX
8820 \makevalueexpandable
8822 % This expands tokens, so do it after making catcode changes, so _
8823 % etc. don't get their TeX definitions. This ignores all spaces in
8824 % #4, including (wrongly) those in the middle of the filename.
8827 % This (wrongly) does not take account of leading or trailing
8828 % spaces in #1, which should be ignored.
8829 \setpdfdestname{#1}%
8831 \ifx\pdfdestname\empty
8832 \def\pdfdestname{Top}% no empty targets
8836 \startlink attr{/Border [0 0 0]}%
8837 \ifnum\filenamelength>0
8838 goto file{\the\filename.pdf} name{\pdfdestname}%
8840 goto name{\pdfmkpgn{\pdfdestname}}%
8843 \setcolor{\linkcolor}%
8845 \ifx\XeTeXrevision\thisisundefined
8849 \makevalueexpandable
8851 % This expands tokens, so do it after making catcode changes, so _
8852 % etc. don't get their TeX definitions. This ignores all spaces in
8853 % #4, including (wrongly) those in the middle of the filename.
8856 % This (wrongly) does not take account of leading or trailing
8857 % spaces in #1, which should be ignored.
8858 \setpdfdestname{#1}%
8860 \ifx\pdfdestname\empty
8861 \def\pdfdestname{Top}% no empty targets
8865 \ifnum\filenamelength>0
8866 % With default settings,
8867 % XeTeX (xdvipdfmx) replaces link destination names with integers.
8868 % In this case, the replaced destination names of
8869 % remote PDFs are no longer known. In order to avoid a replacement,
8870 % you can use xdvipdfmx's command line option `-C 0x0010'.
8871 % If you use XeTeX 0.99996+ (TeX Live 2016+),
8872 % this command line option is no longer necessary
8873 % because we can use the `dvipdfmx:config' special.
8874 \special{pdf:bann << /Border [0 0 0] /Type /Annot /Subtype /Link /A
8875 << /S /GoToR /F (\the\filename.pdf) /D (\pdfdestname) >> >>}%
8877 \special{pdf:bann << /Border [0 0 0] /Type /Annot /Subtype /Link /A
8878 << /S /GoTo /D (\pdfdestname) >> >>}%
8881 \setcolor{\linkcolor}%
8885 % Have to otherify everything special to allow the \csname to
8886 % include an _ in the xref name, etc.
8890 \expandafter\global\expandafter\let\expandafter\Xthisreftitle
8891 \csname XR#1-title\endcsname
8894 % Float references are printed completely differently: "Figure 1.2"
8895 % instead of "[somenode], p.3". \iffloat distinguishes them by
8896 % \Xthisreftitle being set to a magic string.
8897 \iffloat\Xthisreftitle
8898 % If the user specified the print name (third arg) to the ref,
8899 % print it instead of our usual "Figure 1.2".
8900 \ifdim\wd\printedrefnamebox = 0pt
8906 % If the user also gave the printed manual name (fifth arg), append
8908 \ifdim \wd\printedmanualbox > 0pt
8909 \space \putwordin{} \cite{\printedmanual}%
8912 % node/anchor (non-float) references.
8914 % If we use \unhbox to print the node names, TeX does not insert
8915 % empty discretionaries after hyphens, which means that it will not
8916 % find a line break at a hyphen in a node names. Since some manuals
8917 % are best written with fairly long node names, containing hyphens,
8918 % this is a loss. Therefore, we give the text of the node name
8919 % again, so it is as if TeX is seeing it for the first time.
8921 \ifdim \wd\printedmanualbox > 0pt
8922 % Cross-manual reference with a printed manual name.
8924 \crossmanualxref{\cite{\printedmanual\unskip}}%
8926 \else\ifdim \wd\infofilenamebox > 0pt
8927 % Cross-manual reference with only an info filename (arg 4), no
8928 % printed manual name (arg 5). This is essentially the same as
8929 % the case above; we output the filename, since we have nothing else.
8931 \crossmanualxref{\code{\infofilename\unskip}}%
8934 % Reference within this manual.
8936 % Only output a following space if the -snt ref is nonempty, as the ref
8937 % will be empty for @unnumbered and @anchor.
8938 \setbox2 = \hbox{\ignorespaces \refx{#1-snt}}%
8939 \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
8941 % output the `[mynode]' via the macro below so it can be overridden.
8942 \xrefprintnodename\printedrefname
8944 \expandafter\ifx\csname SETtxiomitxrefpg\endcsname\relax
8945 % But we always want a comma and a space:
8948 % output the `page 3'.
8949 \turnoffactive \putwordpage\tie\refx{#1-pg}%
8950 % Add a , if xref followed by a space
8951 \if\space\noexpand\tokenafterxref ,%
8952 \else\ifx\ \tokenafterxref ,% @TAB
8953 \else\ifx\*\tokenafterxref ,% @*
8954 \else\ifx\ \tokenafterxref ,% @SPACE
8956 \tokenafterxref ,% @NL
8957 \else\ifx\tie\tokenafterxref ,% @tie
8965 % Output a cross-manual xref to #1. Used just above (twice).
8967 % Only include the text "Section ``foo'' in" if the foo is neither
8968 % missing or Top. Thus, @xref{,,,foo,The Foo Manual} outputs simply
8969 % "see The Foo Manual", the idea being to refer to the whole manual.
8971 % But, this being TeX, we can't easily compare our node name against the
8972 % string "Top" while ignoring the possible spaces before and after in
8973 % the input. By adding the arbitrary 7sp below, we make it much less
8974 % likely that a real node name would have the same width as "Top" (e.g.,
8975 % in a monospaced font). Hopefully it will never happen in practice.
8977 % For the same basic reason, we retypeset the "Top" at every
8978 % reference, since the current font is indeterminate.
8980 \def\crossmanualxref#1{%
8981 \setbox\toprefbox = \hbox{Top\kern7sp}%
8982 \setbox2 = \hbox{\ignorespaces \printedrefname \unskip \kern7sp}%
8983 \ifdim \wd2 > 7sp % nonempty?
8984 \ifdim \wd2 = \wd\toprefbox \else % same as Top?
8985 \putwordSection{} ``\printedrefname'' \putwordin{}\space
8991 % This macro is called from \xrefX for the `[nodename]' part of xref
8992 % output. It's a separate macro only so it can be changed more easily,
8993 % since square brackets don't work well in some documents. Particularly
8994 % one that Bob is working on :).
8996 \def\xrefprintnodename#1{[#1]}
8998 % Things referred to by \setref.
9004 \putwordChapter@tie \the\chapno
9005 \else \ifnum\subsecno=0
9006 \putwordSection@tie \the\chapno.\the\secno
9007 \else \ifnum\subsubsecno=0
9008 \putwordSection@tie \the\chapno.\the\secno.\the\subsecno
9010 \putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno
9015 \putwordAppendix@tie @char\the\appendixno{}%
9016 \else \ifnum\subsecno=0
9017 \putwordSection@tie @char\the\appendixno.\the\secno
9018 \else \ifnum\subsubsecno=0
9019 \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno
9022 @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno
9026 % \refx{NAME} - reference a cross-reference string named NAME.
9033 \expandafter\global\expandafter\let\expandafter\thisrefX
9034 \csname XR#1\endcsname
9037 % If not defined, say something at least.
9038 \angleleft un\-de\-fined\angleright
9041 {\toks0 = {#1}% avoid expansion of possibly-complex value
9042 \message{\linenumber Undefined cross reference `\the\toks0'.}}%
9045 \global\warnedxrefstrue
9046 \message{Cross reference values unknown; you must run TeX again.}%
9051 % It's defined, so just use it.
9056 % This is the macro invoked by entries in the aux file. Define a control
9057 % sequence for a cross-reference target (we prepend XR to the control sequence
9058 % name to avoid collisions). The value is the page number. If this is a float
9059 % type, we have more work to do.
9062 {% Expand the node or anchor name to remove control sequences.
9063 % \turnoffactive stops 8-bit characters being changed to commands
9064 % like @'e. \refx does the same to retrieve the value in the definition.
9068 \xdef\safexrefname{#1}%
9072 \expandafter\gdef\csname XR\safexrefname\endcsname{#2}%
9074 % We put the \gdef inside a group to avoid the definitions building up on
9075 % TeX's save stack, which can cause it to run out of space for aux files with
9076 % thousands of lines. \gdef doesn't use the save stack, but \csname does
9077 % when it defines an unknown control sequence as \relax.
9079 % Was that xref control sequence that we just defined for a float?
9080 \expandafter\iffloat\csname XR\safexrefname\endcsname
9081 % it was a float, and we have the (safe) float type in \iffloattype.
9082 \expandafter\let\expandafter\floatlist
9083 \csname floatlist\iffloattype\endcsname
9085 % Is this the first time we've seen this float type?
9086 \expandafter\ifx\floatlist\relax
9087 \toks0 = {\do}% yes, so just \do
9089 % had it before, so preserve previous elements in list.
9090 \toks0 = \expandafter{\floatlist\do}%
9093 % Remember this xref in the control sequence \floatlistFLOATTYPE,
9094 % for later use in \listoffloats.
9095 \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0
9100 % If working on a large document in chapters, it is convenient to
9101 % be able to disable indexing, cross-referencing, and contents, for test runs.
9102 % This is done with @novalidate at the beginning of the file.
9104 \newif\iflinks \linkstrue % by default we want the aux files.
9105 \let\novalidate = \linksfalse
9107 % Used when writing to the aux file, or when using data from it.
9108 \def\requireauxfile{%
9111 % Open the new aux file. TeX will close it automatically at exit.
9112 \immediate\openout\auxfile=\jobname.aux
9114 \global\let\requireauxfile=\relax % Only do this once.
9117 % Read the last existing aux file, if any. No error if none exists.
9120 \openin 1 \jobname.aux
9123 \global\havexrefstrue
9128 \def\setupdatafile{%
9129 \catcode`\^^@=\other
9130 \catcode`\^^A=\other
9131 \catcode`\^^B=\other
9132 \catcode`\^^C=\other
9133 \catcode`\^^D=\other
9134 \catcode`\^^E=\other
9135 \catcode`\^^F=\other
9136 \catcode`\^^G=\other
9137 \catcode`\^^H=\other
9138 \catcode`\^^K=\other
9139 \catcode`\^^L=\other
9140 \catcode`\^^N=\other
9141 \catcode`\^^P=\other
9142 \catcode`\^^Q=\other
9143 \catcode`\^^R=\other
9144 \catcode`\^^S=\other
9145 \catcode`\^^T=\other
9146 \catcode`\^^U=\other
9147 \catcode`\^^V=\other
9148 \catcode`\^^W=\other
9149 \catcode`\^^X=\other
9150 \catcode`\^^Z=\other
9151 \catcode`\^^[=\other
9152 \catcode`\^^\=\other
9153 \catcode`\^^]=\other
9154 \catcode`\^^^=\other
9155 \catcode`\^^_=\other
9158 % Special characters. Should be turned off anyway, but...
9171 \catcode`+=\other % avoid \+ for paranoia even though we've turned it off
9175 % @ is our escape character in .aux files, and we need braces.
9181 \def\readdatafile#1{%
9188 \message{insertions,}
9189 % including footnotes.
9191 \newcount \footnoteno
9193 % The trailing space in the following definition for supereject is
9194 % vital for proper filling; pages come out unaligned when you do a
9195 % pagealignmacro call if that space before the closing brace is
9196 % removed. (Generally, numeric constants should always be followed by a
9197 % space to prevent strange expansion errors.)
9198 \def\supereject{\par\penalty -20000\footnoteno =0 }
9200 % @footnotestyle is meaningful for Info output only.
9201 \let\footnotestyle=\comment
9205 % Auto-number footnotes. Otherwise like plain.
9207 \global\advance\footnoteno by \@ne
9208 \edef\thisfootno{$^{\the\footnoteno}$}%
9210 % In case the footnote comes at the end of a sentence, preserve the
9211 % extra spacing after we do the footnote number.
9213 \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi
9215 % Remove inadvertent blank space before typesetting the footnote number.
9221 % Don't bother with the trickery in plain.tex to not require the
9222 % footnote text as a parameter. Our footnotes don't need to be so general.
9224 % Oh yes, they do; otherwise, @ifset (and anything else that uses
9225 % \parseargline) fails inside footnotes because the tokens are fixed when
9226 % the footnote is read. --karl, 16nov96.
9229 \insert\footins\bgroup
9231 % Nested footnotes are not supported in TeX, that would take a lot
9232 % more work. (\startsavinginserts does not suffice.)
9233 \let\footnote=\errfootnotenest
9235 % We want to typeset this text as a normal paragraph, even if the
9236 % footnote reference occurs in (for example) a display environment.
9237 % So reset some parameters.
9238 \hsize=\txipagewidth
9239 \interlinepenalty\interfootnotelinepenalty
9240 \splittopskip\ht\strutbox % top baseline for broken footnotes
9241 \splitmaxdepth\dp\strutbox
9242 \floatingpenalty\@MM
9247 \parindent\defaultparindent
9251 % Because we use hanging indentation in footnotes, a @noindent appears
9252 % to exdent this text, so make it be a no-op. makeinfo does not use
9253 % hanging indentation so @noindent can still be needed within footnote
9254 % text after an @example or the like (not that this is good style).
9255 \let\noindent = \relax
9257 % Hang the footnote text off the number. Use \everypar in case the
9258 % footnote extends for more than one paragraph.
9259 \everypar = {\hang}%
9260 \textindent{\thisfootno}%
9262 % Don't crash into the line above the footnote text. Since this
9263 % expands into a box, it must come within the paragraph, lest it
9264 % provide a place where TeX can split the footnote.
9267 % Invoke rest of plain TeX footnote routine.
9268 \futurelet\next\fo@t
9270 }%end \catcode `\@=11
9272 \def\errfootnotenest{%
9274 \errmessage{Nested footnotes not supported in texinfo.tex,
9275 even though they work in makeinfo; sorry}
9278 \def\errfootnoteheading{%
9280 \errmessage{Footnotes in chapters, sections, etc., are not supported}
9283 % In case a @footnote appears in a vbox, save the footnote text and create
9284 % the real \insert just after the vbox finished. Otherwise, the insertion
9286 % Similarly, if a @footnote appears inside an alignment, save the footnote
9287 % text to a box and make the \insert when a row of the table is finished.
9288 % And the same can be done for other insert classes. --kasal, 16nov03.
9290 % Replace the \insert primitive by a cheating macro.
9291 % Deeper inside, just make sure that the saved insertions are not spilled
9294 \def\startsavinginserts{%
9295 \ifx \insert\ptexinsert
9296 \let\insert\saveinsert
9298 \let\checkinserts\relax
9302 % This \insert replacement works for both \insert\footins{foo} and
9303 % \insert\footins\bgroup foo\egroup, but it doesn't work for \insert27{foo}.
9306 \edef\next{\noexpand\savetobox \makeSAVEname#1}%
9307 \afterassignment\next
9308 % swallow the left brace
9311 \def\makeSAVEname#1{\makecsname{SAVE\expandafter\gobble\string#1}}
9312 \def\savetobox#1{\global\setbox#1 = \vbox\bgroup \unvbox#1}
9314 \def\checksaveins#1{\ifvoid#1\else \placesaveins#1\fi}
9316 \def\placesaveins#1{%
9317 \ptexinsert \csname\expandafter\gobblesave\string#1\endcsname
9321 % eat @SAVE -- beware, all of them have catcode \other:
9323 \def\dospecials{\do S\do A\do V\do E} \uncatcodespecials % ;-)
9324 \gdef\gobblesave @SAVE{}
9328 \def\newsaveins #1{%
9329 \edef\next{\noexpand\newsaveinsX \makeSAVEname#1}%
9332 \def\newsaveinsX #1{%
9333 \csname newbox\endcsname #1%
9334 \expandafter\def\expandafter\checkinserts\expandafter{\checkinserts
9339 \let\checkinserts\empty
9344 % @image. We use the macros from epsf.tex to support this.
9345 % If epsf.tex is not installed and @image is used, we complain.
9347 % Check for and read epsf.tex up front. If we read it only at @image
9348 % time, we might be inside a group, and then its definitions would get
9349 % undone and the next image would fail.
9350 \openin 1 = epsf.tex
9352 % Do not bother showing banner with epsf.tex v2.7k (available in
9353 % doc/epsf.tex and on ctan).
9354 \def\epsfannounce{\toks0 = }%
9359 % We will only complain once about lack of epsf.tex.
9360 \newif\ifwarnednoepsf
9361 \newhelp\noepsfhelp{epsf.tex must be installed for images to
9362 work. It is also included in the Texinfo distribution, or you can get
9363 it from https://ctan.org/texarchive/macros/texinfo/texinfo/doc/epsf.tex.}
9366 \ifx\epsfbox\thisisundefined
9367 \ifwarnednoepsf \else
9368 \errhelp = \noepsfhelp
9369 \errmessage{epsf.tex not found, images will be ignored}%
9370 \global\warnednoepsftrue
9373 \imagexxx #1,,,,,\finish
9377 % Arguments to @image:
9378 % #1 is (mandatory) image filename; we tack on .eps extension.
9379 % #2 is (optional) width, #3 is (optional) height.
9380 % #4 is (ignored optional) html alt text.
9381 % #5 is (ignored optional) extension.
9382 % #6 is just the usual extra ignored arg for parsing stuff.
9384 \def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup
9385 \catcode`\^^M = 5 % in case we're inside an example
9386 \normalturnoffactive % allow _ et al. in names
9387 \makevalueexpandable
9390 \else \ifx\centersub\centerV
9391 % for @center @image, we need a vbox so we can have our vertical space
9393 \vbox\bgroup % vbox has better behavior than vtop here
9398 % Usually we'll have text after the image which will insert
9399 % \parskip glue, so insert it here too to equalize the space
9403 % Place image in a \vtop for a top page margin that is (close to) correct,
9404 % as \topskip glue is relative to the first baseline.
9405 \vtop\bgroup\hrule height 0pt\vskip-\parskip
9408 % Enter horizontal mode so that indentation from an enclosing
9409 % environment such as @quotation is respected.
9410 % However, if we're at the top level, we don't want the
9411 % normal paragraph indentation.
9412 % On the other hand, if we are in the case of @center @image, we don't
9413 % want to start a paragraph, which will create a hsize-width box and
9414 % eradicate the centering.
9415 \ifx\centersub\centerV \else \imageindent \fi
9419 % For pdfTeX and LuaTeX <= 0.80
9420 \dopdfimage{#1}{#2}{#3}%
9422 \ifx\XeTeXrevision\thisisundefined
9424 % \epsfbox itself resets \epsf?size at each figure.
9425 \setbox0 = \hbox{\ignorespaces #2}%
9426 \ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
9427 \setbox0 = \hbox{\ignorespaces #3}%
9428 \ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
9432 \doxeteximage{#1}{#2}{#3}%
9438 \medskip % space after a standalone image
9440 \ifx\centersub\centerV \egroup \fi
9444 % @float FLOATTYPE,LABEL,LOC ... @end float for displayed figures, tables,
9445 % etc. We don't actually implement floating yet, we always include the
9446 % float "here". But it seemed the best name for the future.
9448 \envparseargdef\float{\eatcommaspace\eatcommaspace\dofloat#1, , ,\finish}
9450 % There may be a space before second and/or third parameter; delete it.
9451 \def\eatcommaspace#1, {#1,}
9453 % #1 is the optional FLOATTYPE, the text label for this float, typically
9454 % "Figure", "Table", "Example", etc. Can't contain commas. If omitted,
9455 % this float will not be numbered and cannot be referred to.
9457 % #2 is the optional xref label. Also must be present for the float to
9460 % #3 is the optional positioning argument; for now, it is ignored. It
9461 % will somehow specify the positions allowed to float to (here, top, bottom).
9463 % We keep a separate counter for each FLOATTYPE, which we reset at each
9464 % chapter-level command.
9465 \let\resetallfloatnos=\empty
9467 \def\dofloat#1,#2,#3,#4\finish{%
9468 \let\thiscaption=\empty
9469 \let\thisshortcaption=\empty
9471 % don't lose footnotes inside @float.
9473 % BEWARE: when the floats start float, we have to issue warning whenever an
9474 % insert appears inside a float which could possibly float. --kasal, 26may04
9478 % We can't be used inside a paragraph.
9483 \def\floatlabel{#2}%
9484 \def\floatloc{#3}% we do nothing with this yet.
9486 \ifx\floattype\empty
9487 \let\safefloattype=\empty
9490 % the floattype might have accents or other special characters,
9491 % but we need to use it in a control sequence name.
9494 \xdef\safefloattype{\floattype}%
9498 % If label is given but no type, we handle that as the empty type.
9499 \ifx\floatlabel\empty \else
9500 % We want each FLOATTYPE to be numbered separately (Figure 1,
9501 % Table 1, Figure 2, ...). (And if no label, no number.)
9503 \expandafter\getfloatno\csname\safefloattype floatno\endcsname
9504 \global\advance\floatno by 1
9507 % This magic value for \currentsection is output by \setref as the
9508 % XREFLABEL-title value. \xrefX uses it to distinguish float
9509 % labels (which have a completely different output format) from
9510 % node and anchor labels. And \xrdef uses it to construct the
9513 \edef\currentsection{\floatmagic=\safefloattype}%
9514 \setref{\floatlabel}{Yfloat}%
9518 % start with \parskip glue, I guess.
9521 % Don't suppress indentation if a float happens to start a section.
9522 \restorefirstparagraphindent
9525 % we have these possibilities:
9526 % @float Foo,lbl & @caption{Cap}: Foo 1.1: Cap
9527 % @float Foo,lbl & no caption: Foo 1.1
9528 % @float Foo & @caption{Cap}: Foo: Cap
9529 % @float Foo & no caption: Foo
9530 % @float ,lbl & Caption{Cap}: 1.1: Cap
9531 % @float ,lbl & no caption: 1.1
9532 % @float & @caption{Cap}: Cap
9533 % @float & no caption:
9536 \let\floatident = \empty
9538 % In all cases, if we have a float type, it comes first.
9539 \ifx\floattype\empty \else \def\floatident{\floattype}\fi
9541 % If we have an xref label, the number comes next.
9542 \ifx\floatlabel\empty \else
9543 \ifx\floattype\empty \else % if also had float type, need tie first.
9544 \appendtomacro\floatident{\tie}%
9547 \appendtomacro\floatident{\chaplevelprefix\the\floatno}%
9550 % Start the printed caption with what we've constructed in
9551 % \floatident, but keep it separate; we need \floatident again.
9552 \let\captionline = \floatident
9554 \ifx\thiscaption\empty \else
9555 \ifx\floatident\empty \else
9556 \appendtomacro\captionline{: }% had ident, so need a colon between
9560 \appendtomacro\captionline{\scanexp\thiscaption}%
9563 % If we have anything to print, print it, with space before.
9564 % Eventually this needs to become an \insert.
9565 \ifx\captionline\empty \else
9569 % Space below caption.
9573 % If have an xref label, write the list of floats info. Do this
9574 % after the caption, to avoid chance of it being a breakpoint.
9575 \ifx\floatlabel\empty \else
9576 % Write the text that goes in the lof to the aux file as
9577 % \floatlabel-lof. Besides \floatident, we include the short
9578 % caption if specified, else the full caption if specified, else nothing.
9583 \ifx\thisshortcaption\empty
9584 \def\gtemp{\thiscaption}%
9586 \def\gtemp{\thisshortcaption}%
9588 \immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident
9589 \ifx\gtemp\empty \else : \gtemp \fi}}%
9592 \egroup % end of \vtop
9597 % Append the tokens #2 to the definition of macro #1, not expanding either.
9599 \def\appendtomacro#1#2{%
9600 \expandafter\def\expandafter#1\expandafter{#1#2}%
9603 % @caption, @shortcaption
9605 \def\caption{\docaption\thiscaption}
9606 \def\shortcaption{\docaption\thisshortcaption}
9607 \def\docaption{\checkenv\float \bgroup\scanargctxt\defcaption}
9608 \def\defcaption#1#2{\egroup \def#1{#2}}
9610 % The parameter is the control sequence identifying the counter we are
9611 % going to use. Create it if it doesn't exist and assign it to \floatno.
9614 % Haven't seen this figure type before.
9615 \csname newcount\endcsname #1%
9617 % Remember to reset this floatno at the next chap.
9618 \expandafter\gdef\expandafter\resetallfloatnos
9619 \expandafter{\resetallfloatnos #1=0 }%
9624 % \setref calls this to get the XREFLABEL-snt value. We want an @xref
9625 % to the FLOATLABEL to expand to "Figure 3.1". We call \setref when we
9626 % first read the @float command.
9628 \def\Yfloat{\floattype@tie \chaplevelprefix\the\floatno}%
9630 % Magic string used for the XREFLABEL-title value, so \xrefX can
9631 % distinguish floats from other xref types.
9632 \def\floatmagic{!!float!!}
9634 % #1 is the control sequence we are passed; we expand into a conditional
9635 % which is true if #1 represents a float ref. That is, the magic
9636 % \currentsection value which we \setref above.
9638 \def\iffloat#1{\expandafter\doiffloat#1==\finish}
9640 % #1 is (maybe) the \floatmagic string. If so, #2 will be the
9641 % (safe) float type for this float. We set \iffloattype to #2.
9643 \def\doiffloat#1=#2=#3\finish{%
9645 \def\iffloattype{#2}%
9646 \ifx\temp\floatmagic
9649 % @listoffloats FLOATTYPE - print a list of floats like a table of contents.
9651 \parseargdef\listoffloats{%
9652 \def\floattype{#1}% floattype
9654 % the floattype might have accents or other special characters,
9655 % but we need to use it in a control sequence name.
9658 \xdef\safefloattype{\floattype}%
9661 % \xrdef saves the floats as a \do-list in \floatlistSAFEFLOATTYPE.
9662 \expandafter\ifx\csname floatlist\safefloattype\endcsname \relax
9664 % if the user said @listoffloats foo but never @float foo.
9665 \message{\linenumber No `\safefloattype' floats to list.}%
9669 \leftskip=\tocindent % indent these entries like a toc
9670 \let\do=\listoffloatsdo
9671 \csname floatlist\safefloattype\endcsname
9676 % This is called on each entry in a list of floats. We're passed the
9677 % xref label, in the form LABEL-title, which is how we save it in the
9678 % aux file. We strip off the -title and look up \XRLABEL-lof, which
9679 % has the text we're supposed to typeset here.
9681 % Figures without xref labels will not be included in the list (since
9682 % they won't appear in the aux file).
9684 \def\listoffloatsdo#1{\listoffloatsdoentry#1\finish}
9685 \def\listoffloatsdoentry#1-title\finish{{%
9686 % Can't fully expand XR#1-lof because it can contain anything. Just
9687 % pass the control sequence. On the other hand, XR#1-pg is just the
9688 % page number, and we want to fully expand that so we can get a link
9690 \toksA = \expandafter{\csname XR#1-lof\endcsname}%
9692 % use the same \entry macro we use to generate the TOC and index.
9693 \edef\writeentry{\noexpand\entry{\the\toksA}{\csname XR#1-pg\endcsname}}%
9698 \message{localization,}
9700 % For single-language documents, @documentlanguage is usually given very
9701 % early, just after @documentencoding. Single argument is the language
9702 % (de) or locale (de_DE) abbreviation.
9705 \catcode`\_ = \active
9707 \parseargdef\documentlanguage{%
9708 \tex % read txi-??.tex file in plain TeX.
9709 % Read the file by the name they passed if it exists.
9710 \let_ = \normalunderscore % normal _ character for filename test
9711 \openin 1 txi-#1.tex
9713 \documentlanguagetrywithoutunderscore #1_\finish
9715 \globaldefs = 1 % everything in the txi-LL files needs to persist
9719 \endgroup % end raw TeX
9722 % If they passed de_DE, and txi-de_DE.tex doesn't exist,
9725 \gdef\documentlanguagetrywithoutunderscore#1_#2\finish{%
9726 \openin 1 txi-#1.tex
9728 \errhelp = \nolanghelp
9729 \errmessage{Cannot read language file txi-#1.tex}%
9731 \globaldefs = 1 % everything in the txi-LL files needs to persist
9736 }% end of special _ catcode
9738 \newhelp\nolanghelp{The given language definition file cannot be found or
9739 is empty. Maybe you need to install it? Putting it in the current
9740 directory should work if nowhere else does.}
9742 % This macro is called from txi-??.tex files; the first argument is the
9743 % \language name to set (without the "\lang@" prefix), the second and
9744 % third args are \{left,right}hyphenmin.
9746 % The language names to pass are determined when the format is built.
9747 % See the etex.log file created at that time, e.g.,
9748 % /usr/local/texlive/2008/texmf-var/web2c/pdftex/etex.log.
9750 % With TeX Live 2008, etex now includes hyphenation patterns for all
9751 % available languages. This means we can support hyphenation in
9752 % Texinfo, at least to some extent. (This still doesn't solve the
9753 % accented characters problem.)
9756 \def\txisetlanguage#1#2#3{%
9757 % do not set the language if the name is undefined in the current TeX.
9758 \expandafter\ifx\csname lang@#1\endcsname \relax
9759 \message{no patterns for #1}%
9761 \global\language = \csname lang@#1\endcsname
9763 % but there is no harm in adjusting the hyphenmin values regardless.
9764 \global\lefthyphenmin = #2\relax
9765 \global\righthyphenmin = #3\relax
9768 % XeTeX and LuaTeX can handle Unicode natively.
9769 % Their default I/O uses UTF-8 sequences instead of a byte-wise operation.
9770 % Other TeX engines' I/O (pdfTeX, etc.) is byte-wise.
9772 \newif\iftxinativeunicodecapable
9773 \newif\iftxiusebytewiseio
9775 \ifx\XeTeXrevision\thisisundefined
9776 \ifx\luatexversion\thisisundefined
9777 \txinativeunicodecapablefalse
9778 \txiusebytewiseiotrue
9780 \txinativeunicodecapabletrue
9781 \txiusebytewiseiofalse
9784 \txinativeunicodecapabletrue
9785 \txiusebytewiseiofalse
9788 % Set I/O by bytes instead of UTF-8 sequence for XeTeX and LuaTex
9789 % for non-UTF-8 (byte-wise) encodings.
9791 \def\setbytewiseio{%
9792 \ifx\XeTeXrevision\thisisundefined
9794 \XeTeXdefaultencoding "bytes" % For subsequent files to be read
9795 \XeTeXinputencoding "bytes" % For document root file
9796 % Unfortunately, there seems to be no corresponding XeTeX command for
9797 % output encoding. This is a problem for auxiliary index and TOC files.
9798 % The only solution would be perhaps to write out @U{...} sequences in
9799 % place of non-ASCII characters.
9802 \ifx\luatexversion\thisisundefined
9805 local utf8_char, byte, gsub = unicode.utf8.char, string.byte, string.gsub
9806 local function convert_char (char)
9807 return utf8_char(byte(char))
9810 local function convert_line (line)
9811 return gsub(line, ".", convert_char)
9814 callback.register("process_input_buffer", convert_line)
9816 local function convert_line_out (line)
9818 for c in string.utfvalues(line) do
9819 line_out = line_out .. string.char(c)
9824 callback.register("process_output_buffer", convert_line_out)
9828 \txiusebytewiseiotrue
9832 % Helpers for encodings.
9833 % Set the catcode of characters 128 through 255 to the specified number.
9835 \def\setnonasciicharscatcode#1{%
9837 \loop\ifnum\count255<256
9838 \global\catcode\count255=#1\relax
9839 \advance\count255 by 1
9843 \def\setnonasciicharscatcodenonglobal#1{%
9845 \loop\ifnum\count255<256
9846 \catcode\count255=#1\relax
9847 \advance\count255 by 1
9851 % @documentencoding sets the definition of non-ASCII characters
9852 % according to the specified encoding.
9854 \def\documentencoding{\parseargusing\filenamecatcodes\documentencodingzzz}
9855 \def\documentencodingzzz#1{%
9857 % Encoding being declared for the document.
9858 \def\declaredencoding{\csname #1.enc\endcsname}%
9860 % Supported encodings: names converted to tokens in order to be able
9861 % to compare them with \ifx.
9862 \def\ascii{\csname US-ASCII.enc\endcsname}%
9863 \def\latnine{\csname ISO-8859-15.enc\endcsname}%
9864 \def\latone{\csname ISO-8859-1.enc\endcsname}%
9865 \def\lattwo{\csname ISO-8859-2.enc\endcsname}%
9866 \def\utfeight{\csname UTF-8.enc\endcsname}%
9868 \ifx \declaredencoding \ascii
9871 \else \ifx \declaredencoding \lattwo
9872 \iftxinativeunicodecapable
9875 \setnonasciicharscatcode\active
9878 \else \ifx \declaredencoding \latone
9879 \iftxinativeunicodecapable
9882 \setnonasciicharscatcode\active
9885 \else \ifx \declaredencoding \latnine
9886 \iftxinativeunicodecapable
9889 \setnonasciicharscatcode\active
9892 \else \ifx \declaredencoding \utfeight
9893 \iftxinativeunicodecapable
9894 % For native Unicode handling (XeTeX and LuaTeX)
9895 \nativeunicodechardefs
9897 % For treating UTF-8 as byte sequences (TeX, eTeX and pdfTeX)
9898 \setnonasciicharscatcode\active
9899 % since we already invoked \utfeightchardefs at the top level
9900 % (below), do not re-invoke it, otherwise our check for duplicated
9901 % definitions gets triggered. Making non-ascii chars active is
9906 \message{Ignoring unknown document encoding: #1.}%
9914 \ifx\XeTeXrevision\thisisundefined
9916 \ifx \declaredencoding \utfeight
9918 \ifx \declaredencoding \ascii
9920 \message{Warning: XeTeX with non-UTF-8 encodings cannot handle %
9921 non-ASCII characters in auxiliary files.}%
9928 % A message to be logged when using a character that isn't available
9929 % the default font encoding (OT1).
9931 \def\missingcharmsg#1{\message{Character missing, sorry: #1.}}
9933 % Take account of \c (plain) vs. \, (Texinfo) difference.
9934 \def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi}
9936 % First, make active non-ASCII characters in order for them to be
9937 % correctly categorized when TeX reads the replacement text of
9938 % macros containing the character definitions.
9939 \setnonasciicharscatcode\active
9951 % Latin1 (ISO-8859-1) character definitions.
9952 \def\latonechardefs{%
9954 \gdefchar^^a1{\exclamdown}
9955 \gdefchar^^a2{{\tcfont \char162}} % cent
9956 \gdefchar^^a3{\pounds{}}
9957 \gdefchar^^a4{{\tcfont \char164}} % currency
9958 \gdefchar^^a5{{\tcfont \char165}} % yen
9959 \gdefchar^^a6{{\tcfont \char166}} % broken bar
9962 \gdefchar^^a9{\copyright{}}
9963 \gdefchar^^aa{\ordf}
9964 \gdefchar^^ab{\guillemetleft{}}
9965 \gdefchar^^ac{\ensuremath\lnot}
9967 \gdefchar^^ae{\registeredsymbol{}}
9970 \gdefchar^^b0{\textdegree}
9971 \gdefchar^^b1{$\pm$}
9975 \gdefchar^^b5{$\mu$}
9977 \gdefchar^^b7{\ensuremath\cdot}
9978 \gdefchar^^b8{\cedilla\ }
9980 \gdefchar^^ba{\ordm}
9981 \gdefchar^^bb{\guillemetright{}}
9982 \gdefchar^^bc{$1\over4$}
9983 \gdefchar^^bd{$1\over2$}
9984 \gdefchar^^be{$3\over4$}
9985 \gdefchar^^bf{\questiondown}
9992 \gdefchar^^c5{\ringaccent A}
9994 \gdefchar^^c7{\cedilla C}
10011 \gdefchar^^d7{$\times$}
10026 \gdefchar^^e5{\ringaccent a}
10028 \gdefchar^^e7{\cedilla c}
10033 \gdefchar^^ec{\`{\dotless i}}
10034 \gdefchar^^ed{\'{\dotless i}}
10035 \gdefchar^^ee{\^{\dotless i}}
10036 \gdefchar^^ef{\"{\dotless i}}
10045 \gdefchar^^f7{$\div$}
10056 % Latin9 (ISO-8859-15) encoding character definitions.
10057 \def\latninechardefs{%
10058 % Encoding is almost identical to Latin1.
10061 \gdefchar^^a4{\euro{}}
10062 \gdefchar^^a6{\v S}
10063 \gdefchar^^a8{\v s}
10064 \gdefchar^^b4{\v Z}
10065 \gdefchar^^b8{\v z}
10071 % Latin2 (ISO-8859-2) character definitions.
10072 \def\lattwochardefs{%
10073 \gdefchar^^a0{\tie}
10074 \gdefchar^^a1{\ogonek{A}}
10075 \gdefchar^^a2{\u{}}
10077 \gdefchar^^a4{\missingcharmsg{CURRENCY SIGN}}
10078 \gdefchar^^a5{\v L}
10081 \gdefchar^^a8{\"{}}
10082 \gdefchar^^a9{\v S}
10083 \gdefchar^^aa{\cedilla S}
10084 \gdefchar^^ab{\v T}
10087 \gdefchar^^ae{\v Z}
10088 \gdefchar^^af{\dotaccent Z}
10090 \gdefchar^^b0{\textdegree{}}
10091 \gdefchar^^b1{\ogonek{a}}
10092 \gdefchar^^b2{\ogonek{ }}
10094 \gdefchar^^b4{\'{}}
10095 \gdefchar^^b5{\v l}
10097 \gdefchar^^b7{\v{}}
10098 \gdefchar^^b8{\cedilla\ }
10099 \gdefchar^^b9{\v s}
10100 \gdefchar^^ba{\cedilla s}
10101 \gdefchar^^bb{\v t}
10103 \gdefchar^^bd{\H{}}
10104 \gdefchar^^be{\v z}
10105 \gdefchar^^bf{\dotaccent z}
10110 \gdefchar^^c3{\u A}
10114 \gdefchar^^c7{\cedilla C}
10115 \gdefchar^^c8{\v C}
10117 \gdefchar^^ca{\ogonek{E}}
10119 \gdefchar^^cc{\v E}
10122 \gdefchar^^cf{\v D}
10126 \gdefchar^^d2{\v N}
10129 \gdefchar^^d5{\H O}
10131 \gdefchar^^d7{$\times$}
10132 \gdefchar^^d8{\v R}
10133 \gdefchar^^d9{\ringaccent U}
10135 \gdefchar^^db{\H U}
10138 \gdefchar^^de{\cedilla T}
10144 \gdefchar^^e3{\u a}
10148 \gdefchar^^e7{\cedilla c}
10149 \gdefchar^^e8{\v c}
10151 \gdefchar^^ea{\ogonek{e}}
10153 \gdefchar^^ec{\v e}
10154 \gdefchar^^ed{\'{\dotless{i}}}
10155 \gdefchar^^ee{\^{\dotless{i}}}
10156 \gdefchar^^ef{\v d}
10160 \gdefchar^^f2{\v n}
10163 \gdefchar^^f5{\H o}
10165 \gdefchar^^f7{$\div$}
10166 \gdefchar^^f8{\v r}
10167 \gdefchar^^f9{\ringaccent u}
10169 \gdefchar^^fb{\H u}
10172 \gdefchar^^fe{\cedilla t}
10173 \gdefchar^^ff{\dotaccent{}}
10176 % UTF-8 character definitions.
10178 % This code to support UTF-8 is based on LaTeX's utf8.def, with some
10179 % changes for Texinfo conventions. It is included here under the GPL by
10180 % permission from Frank Mittelbach and the LaTeX team.
10182 \newcount\countUTFx
10183 \newcount\countUTFy
10184 \newcount\countUTFz
10186 \gdef\UTFviiiTwoOctets#1#2{\expandafter
10187 \UTFviiiDefined\csname u8:#1\string #2\endcsname}
10189 \gdef\UTFviiiThreeOctets#1#2#3{\expandafter
10190 \UTFviiiDefined\csname u8:#1\string #2\string #3\endcsname}
10192 \gdef\UTFviiiFourOctets#1#2#3#4{\expandafter
10193 \UTFviiiDefined\csname u8:#1\string #2\string #3\string #4\endcsname}
10195 \gdef\UTFviiiDefined#1{%
10197 \message{\linenumber Unicode char \string #1 not defined for Texinfo}%
10203 % Give non-ASCII bytes the active definitions for processing UTF-8 sequences
10209 % Loop from \countUTFx to \countUTFy, performing \UTFviiiTmp
10210 % substituting ~ and $ with a character token of that value.
10212 \global\catcode\countUTFx\active
10213 \uccode`\~\countUTFx
10214 \uccode`\$\countUTFx
10215 \uppercase\expandafter{\UTFviiiTmp}%
10216 \advance\countUTFx by 1
10217 \ifnum\countUTFx < \countUTFy
10218 \expandafter\UTFviiiLoop
10221 % For bytes other than the first in a UTF-8 sequence. Not expected to
10222 % be expanded except when writing to auxiliary files.
10227 \ifpassthroughchars $\fi}}%
10234 \ifpassthroughchars $%
10235 \else\expandafter\UTFviiiTwoOctets\expandafter$\fi}}%
10242 \ifpassthroughchars $%
10243 \else\expandafter\UTFviiiThreeOctets\expandafter$\fi}}%
10250 \ifpassthroughchars $%
10251 \else\expandafter\UTFviiiFourOctets\expandafter$\fi
10256 \def\globallet{\global\let} % save some \expandafter's below
10258 % @U{xxxx} to produce U+xxxx, if we support it.
10260 \expandafter\ifx\csname uni:#1\endcsname \relax
10261 \iftxinativeunicodecapable
10262 % All Unicode characters can be used if native Unicode handling is
10263 % active. However, if the font does not have the glyph,
10264 % letters are missing.
10266 \uccode`\.="#1\relax
10270 \errhelp = \EMsimple
10271 \errmessage{Unicode character U+#1 not supported, sorry}%
10274 \csname uni:#1\endcsname
10278 % These macros are used here to construct the name of a control
10279 % sequence to be defined.
10280 \def\UTFviiiTwoOctetsName#1#2{%
10281 \csname u8:#1\string #2\endcsname}%
10282 \def\UTFviiiThreeOctetsName#1#2#3{%
10283 \csname u8:#1\string #2\string #3\endcsname}%
10284 \def\UTFviiiFourOctetsName#1#2#3#4{%
10285 \csname u8:#1\string #2\string #3\string #4\endcsname}%
10287 % For UTF-8 byte sequences (TeX, e-TeX and pdfTeX),
10288 % provide a definition macro to replace a Unicode character;
10289 % this gets used by the @U command
10299 \gdef\DeclareUnicodeCharacterUTFviii#1#2{%
10300 \countUTFz = "#1\relax
10304 % Give \u8:... its definition. The sequence of seven \expandafter's
10305 % expands after the \gdef three times, e.g.
10307 % 1. \UTFviiTwoOctetsName B1 B2
10308 % 2. \csname u8:B1 \string B2 \endcsname
10309 % 3. \u8: B1 B2 (a single control sequence token)
10311 \expandafter\expandafter
10312 \expandafter\expandafter
10313 \expandafter\expandafter
10314 \expandafter\gdef \UTFviiiTmp{#2}%
10316 \expandafter\ifx\csname uni:#1\endcsname \relax \else
10317 \message{Internal error, already defined: #1}%
10320 % define an additional control sequence for this code point.
10321 \expandafter\globallet\csname uni:#1\endcsname \UTFviiiTmp
10324 % Given the value in \countUTFz as a Unicode code point, set \UTFviiiTmp
10325 % to the corresponding UTF-8 sequence.
10326 \gdef\parseXMLCharref{%
10327 \ifnum\countUTFz < "A0\relax
10328 \errhelp = \EMsimple
10329 \errmessage{Cannot define Unicode char value < 00A0}%
10330 \else\ifnum\countUTFz < "800\relax
10332 \parseUTFviiiB C\UTFviiiTwoOctetsName.,%
10333 \else\ifnum\countUTFz < "10000\relax
10336 \parseUTFviiiB E\UTFviiiThreeOctetsName.{,;}%
10341 \parseUTFviiiB F\UTFviiiFourOctetsName.{!,;}%
10345 % Extract a byte from the end of the UTF-8 representation of \countUTFx.
10346 % It must be a non-initial byte in the sequence.
10347 % Change \uccode of #1 for it to be used in \parseUTFviiiB as one
10349 \gdef\parseUTFviiiA#1{%
10350 \countUTFx = \countUTFz
10351 \divide\countUTFz by 64
10352 \countUTFy = \countUTFz % Save to be the future value of \countUTFz.
10353 \multiply\countUTFz by 64
10355 % \countUTFz is now \countUTFx with the last 5 bits cleared. Subtract
10356 % in order to get the last five bits.
10357 \advance\countUTFx by -\countUTFz
10359 % Convert this to the byte in the UTF-8 sequence.
10360 \advance\countUTFx by 128
10361 \uccode `#1\countUTFx
10362 \countUTFz = \countUTFy}
10364 % Used to put a UTF-8 byte sequence into \UTFviiiTmp
10365 % #1 is the increment for \countUTFz to yield a the first byte of the UTF-8
10367 % #2 is one of the \UTFviii*OctetsName macros.
10368 % #3 is always a full stop (.)
10369 % #4 is a template for the other bytes in the sequence. The values for these
10370 % bytes is substituted in here with \uppercase using the \uccode's.
10371 \gdef\parseUTFviiiB#1#2#3#4{%
10372 \advance\countUTFz by "#10\relax
10373 \uccode `#3\countUTFz
10374 \uppercase{\gdef\UTFviiiTmp{#2#3#4}}}
10377 % For native Unicode handling (XeTeX and LuaTeX),
10378 % provide a definition macro that sets a catcode to `other' non-globally
10380 \def\DeclareUnicodeCharacterNativeOther#1#2{%
10384 % https://en.wikipedia.org/wiki/Plane_(Unicode)#Basic_M
10385 % U+0000..U+007F = https://en.wikipedia.org/wiki/Basic_Latin_(Unicode_block)
10386 % U+0080..U+00FF = https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)
10387 % U+0100..U+017F = https://en.wikipedia.org/wiki/Latin_Extended-A
10388 % U+0180..U+024F = https://en.wikipedia.org/wiki/Latin_Extended-B
10390 % Many of our renditions are less than wonderful, and all the missing
10391 % characters are available somewhere. Loading the necessary fonts
10392 % awaits user request. We can't truly support Unicode without
10393 % reimplementing everything that's been done in LaTeX for many years,
10394 % plus probably using luatex or xetex, and who knows what else.
10395 % We won't be doing that here in this simple file. But we can try to at
10396 % least make most of the characters not bomb out.
10398 \def\unicodechardefs{%
10399 \DeclareUnicodeCharacter{00A0}{\tie}%
10400 \DeclareUnicodeCharacter{00A1}{\exclamdown}%
10401 \DeclareUnicodeCharacter{00A2}{{\tcfont \char162}}% 0242=cent
10402 \DeclareUnicodeCharacter{00A3}{\pounds{}}%
10403 \DeclareUnicodeCharacter{00A4}{{\tcfont \char164}}% 0244=currency
10404 \DeclareUnicodeCharacter{00A5}{{\tcfont \char165}}% 0245=yen
10405 \DeclareUnicodeCharacter{00A6}{{\tcfont \char166}}% 0246=brokenbar
10406 \DeclareUnicodeCharacter{00A7}{\S}%
10407 \DeclareUnicodeCharacter{00A8}{\"{ }}%
10408 \DeclareUnicodeCharacter{00A9}{\copyright{}}%
10409 \DeclareUnicodeCharacter{00AA}{\ordf}%
10410 \DeclareUnicodeCharacter{00AB}{\guillemetleft{}}%
10411 \DeclareUnicodeCharacter{00AC}{\ensuremath\lnot}%
10412 \DeclareUnicodeCharacter{00AD}{\-}%
10413 \DeclareUnicodeCharacter{00AE}{\registeredsymbol{}}%
10414 \DeclareUnicodeCharacter{00AF}{\={ }}%
10416 \DeclareUnicodeCharacter{00B0}{\ringaccent{ }}%
10417 \DeclareUnicodeCharacter{00B1}{\ensuremath\pm}%
10418 \DeclareUnicodeCharacter{00B2}{$^2$}%
10419 \DeclareUnicodeCharacter{00B3}{$^3$}%
10420 \DeclareUnicodeCharacter{00B4}{\'{ }}%
10421 \DeclareUnicodeCharacter{00B5}{$\mu$}%
10422 \DeclareUnicodeCharacter{00B6}{\P}%
10423 \DeclareUnicodeCharacter{00B7}{\ensuremath\cdot}%
10424 \DeclareUnicodeCharacter{00B8}{\cedilla{ }}%
10425 \DeclareUnicodeCharacter{00B9}{$^1$}%
10426 \DeclareUnicodeCharacter{00BA}{\ordm}%
10427 \DeclareUnicodeCharacter{00BB}{\guillemetright{}}%
10428 \DeclareUnicodeCharacter{00BC}{$1\over4$}%
10429 \DeclareUnicodeCharacter{00BD}{$1\over2$}%
10430 \DeclareUnicodeCharacter{00BE}{$3\over4$}%
10431 \DeclareUnicodeCharacter{00BF}{\questiondown}%
10433 \DeclareUnicodeCharacter{00C0}{\`A}%
10434 \DeclareUnicodeCharacter{00C1}{\'A}%
10435 \DeclareUnicodeCharacter{00C2}{\^A}%
10436 \DeclareUnicodeCharacter{00C3}{\~A}%
10437 \DeclareUnicodeCharacter{00C4}{\"A}%
10438 \DeclareUnicodeCharacter{00C5}{\AA}%
10439 \DeclareUnicodeCharacter{00C6}{\AE}%
10440 \DeclareUnicodeCharacter{00C7}{\cedilla{C}}%
10441 \DeclareUnicodeCharacter{00C8}{\`E}%
10442 \DeclareUnicodeCharacter{00C9}{\'E}%
10443 \DeclareUnicodeCharacter{00CA}{\^E}%
10444 \DeclareUnicodeCharacter{00CB}{\"E}%
10445 \DeclareUnicodeCharacter{00CC}{\`I}%
10446 \DeclareUnicodeCharacter{00CD}{\'I}%
10447 \DeclareUnicodeCharacter{00CE}{\^I}%
10448 \DeclareUnicodeCharacter{00CF}{\"I}%
10450 \DeclareUnicodeCharacter{00D0}{\DH}%
10451 \DeclareUnicodeCharacter{00D1}{\~N}%
10452 \DeclareUnicodeCharacter{00D2}{\`O}%
10453 \DeclareUnicodeCharacter{00D3}{\'O}%
10454 \DeclareUnicodeCharacter{00D4}{\^O}%
10455 \DeclareUnicodeCharacter{00D5}{\~O}%
10456 \DeclareUnicodeCharacter{00D6}{\"O}%
10457 \DeclareUnicodeCharacter{00D7}{\ensuremath\times}%
10458 \DeclareUnicodeCharacter{00D8}{\O}%
10459 \DeclareUnicodeCharacter{00D9}{\`U}%
10460 \DeclareUnicodeCharacter{00DA}{\'U}%
10461 \DeclareUnicodeCharacter{00DB}{\^U}%
10462 \DeclareUnicodeCharacter{00DC}{\"U}%
10463 \DeclareUnicodeCharacter{00DD}{\'Y}%
10464 \DeclareUnicodeCharacter{00DE}{\TH}%
10465 \DeclareUnicodeCharacter{00DF}{\ss}%
10467 \DeclareUnicodeCharacter{00E0}{\`a}%
10468 \DeclareUnicodeCharacter{00E1}{\'a}%
10469 \DeclareUnicodeCharacter{00E2}{\^a}%
10470 \DeclareUnicodeCharacter{00E3}{\~a}%
10471 \DeclareUnicodeCharacter{00E4}{\"a}%
10472 \DeclareUnicodeCharacter{00E5}{\aa}%
10473 \DeclareUnicodeCharacter{00E6}{\ae}%
10474 \DeclareUnicodeCharacter{00E7}{\cedilla{c}}%
10475 \DeclareUnicodeCharacter{00E8}{\`e}%
10476 \DeclareUnicodeCharacter{00E9}{\'e}%
10477 \DeclareUnicodeCharacter{00EA}{\^e}%
10478 \DeclareUnicodeCharacter{00EB}{\"e}%
10479 \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}}%
10480 \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}}%
10481 \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}}%
10482 \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}}%
10484 \DeclareUnicodeCharacter{00F0}{\dh}%
10485 \DeclareUnicodeCharacter{00F1}{\~n}%
10486 \DeclareUnicodeCharacter{00F2}{\`o}%
10487 \DeclareUnicodeCharacter{00F3}{\'o}%
10488 \DeclareUnicodeCharacter{00F4}{\^o}%
10489 \DeclareUnicodeCharacter{00F5}{\~o}%
10490 \DeclareUnicodeCharacter{00F6}{\"o}%
10491 \DeclareUnicodeCharacter{00F7}{\ensuremath\div}%
10492 \DeclareUnicodeCharacter{00F8}{\o}%
10493 \DeclareUnicodeCharacter{00F9}{\`u}%
10494 \DeclareUnicodeCharacter{00FA}{\'u}%
10495 \DeclareUnicodeCharacter{00FB}{\^u}%
10496 \DeclareUnicodeCharacter{00FC}{\"u}%
10497 \DeclareUnicodeCharacter{00FD}{\'y}%
10498 \DeclareUnicodeCharacter{00FE}{\th}%
10499 \DeclareUnicodeCharacter{00FF}{\"y}%
10501 \DeclareUnicodeCharacter{0100}{\=A}%
10502 \DeclareUnicodeCharacter{0101}{\=a}%
10503 \DeclareUnicodeCharacter{0102}{\u{A}}%
10504 \DeclareUnicodeCharacter{0103}{\u{a}}%
10505 \DeclareUnicodeCharacter{0104}{\ogonek{A}}%
10506 \DeclareUnicodeCharacter{0105}{\ogonek{a}}%
10507 \DeclareUnicodeCharacter{0106}{\'C}%
10508 \DeclareUnicodeCharacter{0107}{\'c}%
10509 \DeclareUnicodeCharacter{0108}{\^C}%
10510 \DeclareUnicodeCharacter{0109}{\^c}%
10511 \DeclareUnicodeCharacter{010A}{\dotaccent{C}}%
10512 \DeclareUnicodeCharacter{010B}{\dotaccent{c}}%
10513 \DeclareUnicodeCharacter{010C}{\v{C}}%
10514 \DeclareUnicodeCharacter{010D}{\v{c}}%
10515 \DeclareUnicodeCharacter{010E}{\v{D}}%
10516 \DeclareUnicodeCharacter{010F}{d'}%
10518 \DeclareUnicodeCharacter{0110}{\DH}%
10519 \DeclareUnicodeCharacter{0111}{\dh}%
10520 \DeclareUnicodeCharacter{0112}{\=E}%
10521 \DeclareUnicodeCharacter{0113}{\=e}%
10522 \DeclareUnicodeCharacter{0114}{\u{E}}%
10523 \DeclareUnicodeCharacter{0115}{\u{e}}%
10524 \DeclareUnicodeCharacter{0116}{\dotaccent{E}}%
10525 \DeclareUnicodeCharacter{0117}{\dotaccent{e}}%
10526 \DeclareUnicodeCharacter{0118}{\ogonek{E}}%
10527 \DeclareUnicodeCharacter{0119}{\ogonek{e}}%
10528 \DeclareUnicodeCharacter{011A}{\v{E}}%
10529 \DeclareUnicodeCharacter{011B}{\v{e}}%
10530 \DeclareUnicodeCharacter{011C}{\^G}%
10531 \DeclareUnicodeCharacter{011D}{\^g}%
10532 \DeclareUnicodeCharacter{011E}{\u{G}}%
10533 \DeclareUnicodeCharacter{011F}{\u{g}}%
10535 \DeclareUnicodeCharacter{0120}{\dotaccent{G}}%
10536 \DeclareUnicodeCharacter{0121}{\dotaccent{g}}%
10537 \DeclareUnicodeCharacter{0122}{\cedilla{G}}%
10538 \DeclareUnicodeCharacter{0123}{\cedilla{g}}%
10539 \DeclareUnicodeCharacter{0124}{\^H}%
10540 \DeclareUnicodeCharacter{0125}{\^h}%
10541 \DeclareUnicodeCharacter{0126}{\missingcharmsg{H WITH STROKE}}%
10542 \DeclareUnicodeCharacter{0127}{\missingcharmsg{h WITH STROKE}}%
10543 \DeclareUnicodeCharacter{0128}{\~I}%
10544 \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}}%
10545 \DeclareUnicodeCharacter{012A}{\=I}%
10546 \DeclareUnicodeCharacter{012B}{\={\dotless{i}}}%
10547 \DeclareUnicodeCharacter{012C}{\u{I}}%
10548 \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}}%
10549 \DeclareUnicodeCharacter{012E}{\ogonek{I}}%
10550 \DeclareUnicodeCharacter{012F}{\ogonek{i}}%
10552 \DeclareUnicodeCharacter{0130}{\dotaccent{I}}%
10553 \DeclareUnicodeCharacter{0131}{\dotless{i}}%
10554 \DeclareUnicodeCharacter{0132}{IJ}%
10555 \DeclareUnicodeCharacter{0133}{ij}%
10556 \DeclareUnicodeCharacter{0134}{\^J}%
10557 \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}}%
10558 \DeclareUnicodeCharacter{0136}{\cedilla{K}}%
10559 \DeclareUnicodeCharacter{0137}{\cedilla{k}}%
10560 \DeclareUnicodeCharacter{0138}{\ensuremath\kappa}%
10561 \DeclareUnicodeCharacter{0139}{\'L}%
10562 \DeclareUnicodeCharacter{013A}{\'l}%
10563 \DeclareUnicodeCharacter{013B}{\cedilla{L}}%
10564 \DeclareUnicodeCharacter{013C}{\cedilla{l}}%
10565 \DeclareUnicodeCharacter{013D}{L'}% should kern
10566 \DeclareUnicodeCharacter{013E}{l'}% should kern
10567 \DeclareUnicodeCharacter{013F}{L\U{00B7}}%
10569 \DeclareUnicodeCharacter{0140}{l\U{00B7}}%
10570 \DeclareUnicodeCharacter{0141}{\L}%
10571 \DeclareUnicodeCharacter{0142}{\l}%
10572 \DeclareUnicodeCharacter{0143}{\'N}%
10573 \DeclareUnicodeCharacter{0144}{\'n}%
10574 \DeclareUnicodeCharacter{0145}{\cedilla{N}}%
10575 \DeclareUnicodeCharacter{0146}{\cedilla{n}}%
10576 \DeclareUnicodeCharacter{0147}{\v{N}}%
10577 \DeclareUnicodeCharacter{0148}{\v{n}}%
10578 \DeclareUnicodeCharacter{0149}{'n}%
10579 \DeclareUnicodeCharacter{014A}{\missingcharmsg{ENG}}%
10580 \DeclareUnicodeCharacter{014B}{\missingcharmsg{eng}}%
10581 \DeclareUnicodeCharacter{014C}{\=O}%
10582 \DeclareUnicodeCharacter{014D}{\=o}%
10583 \DeclareUnicodeCharacter{014E}{\u{O}}%
10584 \DeclareUnicodeCharacter{014F}{\u{o}}%
10586 \DeclareUnicodeCharacter{0150}{\H{O}}%
10587 \DeclareUnicodeCharacter{0151}{\H{o}}%
10588 \DeclareUnicodeCharacter{0152}{\OE}%
10589 \DeclareUnicodeCharacter{0153}{\oe}%
10590 \DeclareUnicodeCharacter{0154}{\'R}%
10591 \DeclareUnicodeCharacter{0155}{\'r}%
10592 \DeclareUnicodeCharacter{0156}{\cedilla{R}}%
10593 \DeclareUnicodeCharacter{0157}{\cedilla{r}}%
10594 \DeclareUnicodeCharacter{0158}{\v{R}}%
10595 \DeclareUnicodeCharacter{0159}{\v{r}}%
10596 \DeclareUnicodeCharacter{015A}{\'S}%
10597 \DeclareUnicodeCharacter{015B}{\'s}%
10598 \DeclareUnicodeCharacter{015C}{\^S}%
10599 \DeclareUnicodeCharacter{015D}{\^s}%
10600 \DeclareUnicodeCharacter{015E}{\cedilla{S}}%
10601 \DeclareUnicodeCharacter{015F}{\cedilla{s}}%
10603 \DeclareUnicodeCharacter{0160}{\v{S}}%
10604 \DeclareUnicodeCharacter{0161}{\v{s}}%
10605 \DeclareUnicodeCharacter{0162}{\cedilla{T}}%
10606 \DeclareUnicodeCharacter{0163}{\cedilla{t}}%
10607 \DeclareUnicodeCharacter{0164}{\v{T}}%
10608 \DeclareUnicodeCharacter{0165}{\v{t}}%
10609 \DeclareUnicodeCharacter{0166}{\missingcharmsg{H WITH STROKE}}%
10610 \DeclareUnicodeCharacter{0167}{\missingcharmsg{h WITH STROKE}}%
10611 \DeclareUnicodeCharacter{0168}{\~U}%
10612 \DeclareUnicodeCharacter{0169}{\~u}%
10613 \DeclareUnicodeCharacter{016A}{\=U}%
10614 \DeclareUnicodeCharacter{016B}{\=u}%
10615 \DeclareUnicodeCharacter{016C}{\u{U}}%
10616 \DeclareUnicodeCharacter{016D}{\u{u}}%
10617 \DeclareUnicodeCharacter{016E}{\ringaccent{U}}%
10618 \DeclareUnicodeCharacter{016F}{\ringaccent{u}}%
10620 \DeclareUnicodeCharacter{0170}{\H{U}}%
10621 \DeclareUnicodeCharacter{0171}{\H{u}}%
10622 \DeclareUnicodeCharacter{0172}{\ogonek{U}}%
10623 \DeclareUnicodeCharacter{0173}{\ogonek{u}}%
10624 \DeclareUnicodeCharacter{0174}{\^W}%
10625 \DeclareUnicodeCharacter{0175}{\^w}%
10626 \DeclareUnicodeCharacter{0176}{\^Y}%
10627 \DeclareUnicodeCharacter{0177}{\^y}%
10628 \DeclareUnicodeCharacter{0178}{\"Y}%
10629 \DeclareUnicodeCharacter{0179}{\'Z}%
10630 \DeclareUnicodeCharacter{017A}{\'z}%
10631 \DeclareUnicodeCharacter{017B}{\dotaccent{Z}}%
10632 \DeclareUnicodeCharacter{017C}{\dotaccent{z}}%
10633 \DeclareUnicodeCharacter{017D}{\v{Z}}%
10634 \DeclareUnicodeCharacter{017E}{\v{z}}%
10635 \DeclareUnicodeCharacter{017F}{\missingcharmsg{LONG S}}%
10637 \DeclareUnicodeCharacter{01C4}{D\v{Z}}%
10638 \DeclareUnicodeCharacter{01C5}{D\v{z}}%
10639 \DeclareUnicodeCharacter{01C6}{d\v{z}}%
10640 \DeclareUnicodeCharacter{01C7}{LJ}%
10641 \DeclareUnicodeCharacter{01C8}{Lj}%
10642 \DeclareUnicodeCharacter{01C9}{lj}%
10643 \DeclareUnicodeCharacter{01CA}{NJ}%
10644 \DeclareUnicodeCharacter{01CB}{Nj}%
10645 \DeclareUnicodeCharacter{01CC}{nj}%
10646 \DeclareUnicodeCharacter{01CD}{\v{A}}%
10647 \DeclareUnicodeCharacter{01CE}{\v{a}}%
10648 \DeclareUnicodeCharacter{01CF}{\v{I}}%
10650 \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}}%
10651 \DeclareUnicodeCharacter{01D1}{\v{O}}%
10652 \DeclareUnicodeCharacter{01D2}{\v{o}}%
10653 \DeclareUnicodeCharacter{01D3}{\v{U}}%
10654 \DeclareUnicodeCharacter{01D4}{\v{u}}%
10656 \DeclareUnicodeCharacter{01E2}{\={\AE}}%
10657 \DeclareUnicodeCharacter{01E3}{\={\ae}}%
10658 \DeclareUnicodeCharacter{01E6}{\v{G}}%
10659 \DeclareUnicodeCharacter{01E7}{\v{g}}%
10660 \DeclareUnicodeCharacter{01E8}{\v{K}}%
10661 \DeclareUnicodeCharacter{01E9}{\v{k}}%
10663 \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}}%
10664 \DeclareUnicodeCharacter{01F1}{DZ}%
10665 \DeclareUnicodeCharacter{01F2}{Dz}%
10666 \DeclareUnicodeCharacter{01F3}{dz}%
10667 \DeclareUnicodeCharacter{01F4}{\'G}%
10668 \DeclareUnicodeCharacter{01F5}{\'g}%
10669 \DeclareUnicodeCharacter{01F8}{\`N}%
10670 \DeclareUnicodeCharacter{01F9}{\`n}%
10671 \DeclareUnicodeCharacter{01FC}{\'{\AE}}%
10672 \DeclareUnicodeCharacter{01FD}{\'{\ae}}%
10673 \DeclareUnicodeCharacter{01FE}{\'{\O}}%
10674 \DeclareUnicodeCharacter{01FF}{\'{\o}}%
10676 \DeclareUnicodeCharacter{021E}{\v{H}}%
10677 \DeclareUnicodeCharacter{021F}{\v{h}}%
10679 \DeclareUnicodeCharacter{0226}{\dotaccent{A}}%
10680 \DeclareUnicodeCharacter{0227}{\dotaccent{a}}%
10681 \DeclareUnicodeCharacter{0228}{\cedilla{E}}%
10682 \DeclareUnicodeCharacter{0229}{\cedilla{e}}%
10683 \DeclareUnicodeCharacter{022E}{\dotaccent{O}}%
10684 \DeclareUnicodeCharacter{022F}{\dotaccent{o}}%
10686 \DeclareUnicodeCharacter{0232}{\=Y}%
10687 \DeclareUnicodeCharacter{0233}{\=y}%
10688 \DeclareUnicodeCharacter{0237}{\dotless{j}}%
10690 \DeclareUnicodeCharacter{02BC}{'}%
10692 \DeclareUnicodeCharacter{02DB}{\ogonek{ }}%
10694 % Greek letters upper case
10695 \DeclareUnicodeCharacter{0391}{{\it A}}%
10696 \DeclareUnicodeCharacter{0392}{{\it B}}%
10697 \DeclareUnicodeCharacter{0393}{\ensuremath{\mit\Gamma}}%
10698 \DeclareUnicodeCharacter{0394}{\ensuremath{\mit\Delta}}%
10699 \DeclareUnicodeCharacter{0395}{{\it E}}%
10700 \DeclareUnicodeCharacter{0396}{{\it Z}}%
10701 \DeclareUnicodeCharacter{0397}{{\it H}}%
10702 \DeclareUnicodeCharacter{0398}{\ensuremath{\mit\Theta}}%
10703 \DeclareUnicodeCharacter{0399}{{\it I}}%
10704 \DeclareUnicodeCharacter{039A}{{\it K}}%
10705 \DeclareUnicodeCharacter{039B}{\ensuremath{\mit\Lambda}}%
10706 \DeclareUnicodeCharacter{039C}{{\it M}}%
10707 \DeclareUnicodeCharacter{039D}{{\it N}}%
10708 \DeclareUnicodeCharacter{039E}{\ensuremath{\mit\Xi}}%
10709 \DeclareUnicodeCharacter{039F}{{\it O}}%
10710 \DeclareUnicodeCharacter{03A0}{\ensuremath{\mit\Pi}}%
10711 \DeclareUnicodeCharacter{03A1}{{\it P}}%
10712 %\DeclareUnicodeCharacter{03A2}{} % none - corresponds to final sigma
10713 \DeclareUnicodeCharacter{03A3}{\ensuremath{\mit\Sigma}}%
10714 \DeclareUnicodeCharacter{03A4}{{\it T}}%
10715 \DeclareUnicodeCharacter{03A5}{\ensuremath{\mit\Upsilon}}%
10716 \DeclareUnicodeCharacter{03A6}{\ensuremath{\mit\Phi}}%
10717 \DeclareUnicodeCharacter{03A7}{{\it X}}%
10718 \DeclareUnicodeCharacter{03A8}{\ensuremath{\mit\Psi}}%
10719 \DeclareUnicodeCharacter{03A9}{\ensuremath{\mit\Omega}}%
10721 % Vowels with accents
10722 \DeclareUnicodeCharacter{0390}{\ensuremath{\ddot{\acute\iota}}}%
10723 \DeclareUnicodeCharacter{03AC}{\ensuremath{\acute\alpha}}%
10724 \DeclareUnicodeCharacter{03AD}{\ensuremath{\acute\epsilon}}%
10725 \DeclareUnicodeCharacter{03AE}{\ensuremath{\acute\eta}}%
10726 \DeclareUnicodeCharacter{03AF}{\ensuremath{\acute\iota}}%
10727 \DeclareUnicodeCharacter{03B0}{\ensuremath{\acute{\ddot\upsilon}}}%
10729 % Standalone accent
10730 \DeclareUnicodeCharacter{0384}{\ensuremath{\acute{\ }}}%
10732 % Greek letters lower case
10733 \DeclareUnicodeCharacter{03B1}{\ensuremath\alpha}%
10734 \DeclareUnicodeCharacter{03B2}{\ensuremath\beta}%
10735 \DeclareUnicodeCharacter{03B3}{\ensuremath\gamma}%
10736 \DeclareUnicodeCharacter{03B4}{\ensuremath\delta}%
10737 \DeclareUnicodeCharacter{03B5}{\ensuremath\epsilon}%
10738 \DeclareUnicodeCharacter{03B6}{\ensuremath\zeta}%
10739 \DeclareUnicodeCharacter{03B7}{\ensuremath\eta}%
10740 \DeclareUnicodeCharacter{03B8}{\ensuremath\theta}%
10741 \DeclareUnicodeCharacter{03B9}{\ensuremath\iota}%
10742 \DeclareUnicodeCharacter{03BA}{\ensuremath\kappa}%
10743 \DeclareUnicodeCharacter{03BB}{\ensuremath\lambda}%
10744 \DeclareUnicodeCharacter{03BC}{\ensuremath\mu}%
10745 \DeclareUnicodeCharacter{03BD}{\ensuremath\nu}%
10746 \DeclareUnicodeCharacter{03BE}{\ensuremath\xi}%
10747 \DeclareUnicodeCharacter{03BF}{{\it o}}% omicron
10748 \DeclareUnicodeCharacter{03C0}{\ensuremath\pi}%
10749 \DeclareUnicodeCharacter{03C1}{\ensuremath\rho}%
10750 \DeclareUnicodeCharacter{03C2}{\ensuremath\varsigma}%
10751 \DeclareUnicodeCharacter{03C3}{\ensuremath\sigma}%
10752 \DeclareUnicodeCharacter{03C4}{\ensuremath\tau}%
10753 \DeclareUnicodeCharacter{03C5}{\ensuremath\upsilon}%
10754 \DeclareUnicodeCharacter{03C6}{\ensuremath\phi}%
10755 \DeclareUnicodeCharacter{03C7}{\ensuremath\chi}%
10756 \DeclareUnicodeCharacter{03C8}{\ensuremath\psi}%
10757 \DeclareUnicodeCharacter{03C9}{\ensuremath\omega}%
10759 % More Greek vowels with accents
10760 \DeclareUnicodeCharacter{03CA}{\ensuremath{\ddot\iota}}%
10761 \DeclareUnicodeCharacter{03CB}{\ensuremath{\ddot\upsilon}}%
10762 \DeclareUnicodeCharacter{03CC}{\ensuremath{\acute o}}%
10763 \DeclareUnicodeCharacter{03CD}{\ensuremath{\acute\upsilon}}%
10764 \DeclareUnicodeCharacter{03CE}{\ensuremath{\acute\omega}}%
10766 % Variant Greek letters
10767 \DeclareUnicodeCharacter{03D1}{\ensuremath\vartheta}%
10768 \DeclareUnicodeCharacter{03D6}{\ensuremath\varpi}%
10769 \DeclareUnicodeCharacter{03F1}{\ensuremath\varrho}%
10771 \DeclareUnicodeCharacter{1E02}{\dotaccent{B}}%
10772 \DeclareUnicodeCharacter{1E03}{\dotaccent{b}}%
10773 \DeclareUnicodeCharacter{1E04}{\udotaccent{B}}%
10774 \DeclareUnicodeCharacter{1E05}{\udotaccent{b}}%
10775 \DeclareUnicodeCharacter{1E06}{\ubaraccent{B}}%
10776 \DeclareUnicodeCharacter{1E07}{\ubaraccent{b}}%
10777 \DeclareUnicodeCharacter{1E0A}{\dotaccent{D}}%
10778 \DeclareUnicodeCharacter{1E0B}{\dotaccent{d}}%
10779 \DeclareUnicodeCharacter{1E0C}{\udotaccent{D}}%
10780 \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}}%
10781 \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}}%
10782 \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}}%
10784 \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}}%
10785 \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}}%
10787 \DeclareUnicodeCharacter{1E20}{\=G}%
10788 \DeclareUnicodeCharacter{1E21}{\=g}%
10789 \DeclareUnicodeCharacter{1E22}{\dotaccent{H}}%
10790 \DeclareUnicodeCharacter{1E23}{\dotaccent{h}}%
10791 \DeclareUnicodeCharacter{1E24}{\udotaccent{H}}%
10792 \DeclareUnicodeCharacter{1E25}{\udotaccent{h}}%
10793 \DeclareUnicodeCharacter{1E26}{\"H}%
10794 \DeclareUnicodeCharacter{1E27}{\"h}%
10796 \DeclareUnicodeCharacter{1E30}{\'K}%
10797 \DeclareUnicodeCharacter{1E31}{\'k}%
10798 \DeclareUnicodeCharacter{1E32}{\udotaccent{K}}%
10799 \DeclareUnicodeCharacter{1E33}{\udotaccent{k}}%
10800 \DeclareUnicodeCharacter{1E34}{\ubaraccent{K}}%
10801 \DeclareUnicodeCharacter{1E35}{\ubaraccent{k}}%
10802 \DeclareUnicodeCharacter{1E36}{\udotaccent{L}}%
10803 \DeclareUnicodeCharacter{1E37}{\udotaccent{l}}%
10804 \DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}}%
10805 \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}}%
10806 \DeclareUnicodeCharacter{1E3E}{\'M}%
10807 \DeclareUnicodeCharacter{1E3F}{\'m}%
10809 \DeclareUnicodeCharacter{1E40}{\dotaccent{M}}%
10810 \DeclareUnicodeCharacter{1E41}{\dotaccent{m}}%
10811 \DeclareUnicodeCharacter{1E42}{\udotaccent{M}}%
10812 \DeclareUnicodeCharacter{1E43}{\udotaccent{m}}%
10813 \DeclareUnicodeCharacter{1E44}{\dotaccent{N}}%
10814 \DeclareUnicodeCharacter{1E45}{\dotaccent{n}}%
10815 \DeclareUnicodeCharacter{1E46}{\udotaccent{N}}%
10816 \DeclareUnicodeCharacter{1E47}{\udotaccent{n}}%
10817 \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}}%
10818 \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}}%
10820 \DeclareUnicodeCharacter{1E54}{\'P}%
10821 \DeclareUnicodeCharacter{1E55}{\'p}%
10822 \DeclareUnicodeCharacter{1E56}{\dotaccent{P}}%
10823 \DeclareUnicodeCharacter{1E57}{\dotaccent{p}}%
10824 \DeclareUnicodeCharacter{1E58}{\dotaccent{R}}%
10825 \DeclareUnicodeCharacter{1E59}{\dotaccent{r}}%
10826 \DeclareUnicodeCharacter{1E5A}{\udotaccent{R}}%
10827 \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}}%
10828 \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}}%
10829 \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}}%
10831 \DeclareUnicodeCharacter{1E60}{\dotaccent{S}}%
10832 \DeclareUnicodeCharacter{1E61}{\dotaccent{s}}%
10833 \DeclareUnicodeCharacter{1E62}{\udotaccent{S}}%
10834 \DeclareUnicodeCharacter{1E63}{\udotaccent{s}}%
10835 \DeclareUnicodeCharacter{1E6A}{\dotaccent{T}}%
10836 \DeclareUnicodeCharacter{1E6B}{\dotaccent{t}}%
10837 \DeclareUnicodeCharacter{1E6C}{\udotaccent{T}}%
10838 \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}}%
10839 \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}}%
10840 \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}}%
10842 \DeclareUnicodeCharacter{1E7C}{\~V}%
10843 \DeclareUnicodeCharacter{1E7D}{\~v}%
10844 \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}}%
10845 \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}}%
10847 \DeclareUnicodeCharacter{1E80}{\`W}%
10848 \DeclareUnicodeCharacter{1E81}{\`w}%
10849 \DeclareUnicodeCharacter{1E82}{\'W}%
10850 \DeclareUnicodeCharacter{1E83}{\'w}%
10851 \DeclareUnicodeCharacter{1E84}{\"W}%
10852 \DeclareUnicodeCharacter{1E85}{\"w}%
10853 \DeclareUnicodeCharacter{1E86}{\dotaccent{W}}%
10854 \DeclareUnicodeCharacter{1E87}{\dotaccent{w}}%
10855 \DeclareUnicodeCharacter{1E88}{\udotaccent{W}}%
10856 \DeclareUnicodeCharacter{1E89}{\udotaccent{w}}%
10857 \DeclareUnicodeCharacter{1E8A}{\dotaccent{X}}%
10858 \DeclareUnicodeCharacter{1E8B}{\dotaccent{x}}%
10859 \DeclareUnicodeCharacter{1E8C}{\"X}%
10860 \DeclareUnicodeCharacter{1E8D}{\"x}%
10861 \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}}%
10862 \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}}%
10864 \DeclareUnicodeCharacter{1E90}{\^Z}%
10865 \DeclareUnicodeCharacter{1E91}{\^z}%
10866 \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}}%
10867 \DeclareUnicodeCharacter{1E93}{\udotaccent{z}}%
10868 \DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}}%
10869 \DeclareUnicodeCharacter{1E95}{\ubaraccent{z}}%
10870 \DeclareUnicodeCharacter{1E96}{\ubaraccent{h}}%
10871 \DeclareUnicodeCharacter{1E97}{\"t}%
10872 \DeclareUnicodeCharacter{1E98}{\ringaccent{w}}%
10873 \DeclareUnicodeCharacter{1E99}{\ringaccent{y}}%
10875 \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}}%
10876 \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}}%
10878 \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}}%
10879 \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}}%
10880 \DeclareUnicodeCharacter{1EBC}{\~E}%
10881 \DeclareUnicodeCharacter{1EBD}{\~e}%
10883 \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}}%
10884 \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}}%
10885 \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}}%
10886 \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}}%
10888 \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}}%
10889 \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}}%
10891 \DeclareUnicodeCharacter{1EF2}{\`Y}%
10892 \DeclareUnicodeCharacter{1EF3}{\`y}%
10893 \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}}%
10895 \DeclareUnicodeCharacter{1EF8}{\~Y}%
10896 \DeclareUnicodeCharacter{1EF9}{\~y}%
10899 \DeclareUnicodeCharacter{2007}{\hphantom{0}}%
10902 \DeclareUnicodeCharacter{2013}{--}%
10903 \DeclareUnicodeCharacter{2014}{---}%
10904 \DeclareUnicodeCharacter{2018}{\quoteleft{}}%
10905 \DeclareUnicodeCharacter{2019}{\quoteright{}}%
10906 \DeclareUnicodeCharacter{201A}{\quotesinglbase{}}%
10907 \DeclareUnicodeCharacter{201C}{\quotedblleft{}}%
10908 \DeclareUnicodeCharacter{201D}{\quotedblright{}}%
10909 \DeclareUnicodeCharacter{201E}{\quotedblbase{}}%
10910 \DeclareUnicodeCharacter{2020}{\ensuremath\dagger}%
10911 \DeclareUnicodeCharacter{2021}{\ensuremath\ddagger}%
10912 \DeclareUnicodeCharacter{2022}{\bullet{}}%
10913 \DeclareUnicodeCharacter{202F}{\thinspace}%
10914 \DeclareUnicodeCharacter{2026}{\dots{}}%
10915 \DeclareUnicodeCharacter{2039}{\guilsinglleft{}}%
10916 \DeclareUnicodeCharacter{203A}{\guilsinglright{}}%
10918 \DeclareUnicodeCharacter{20AC}{\euro{}}%
10920 \DeclareUnicodeCharacter{2192}{\expansion{}}%
10921 \DeclareUnicodeCharacter{21D2}{\result{}}%
10923 % Mathematical symbols
10924 \DeclareUnicodeCharacter{2200}{\ensuremath\forall}%
10925 \DeclareUnicodeCharacter{2203}{\ensuremath\exists}%
10926 \DeclareUnicodeCharacter{2208}{\ensuremath\in}%
10927 \DeclareUnicodeCharacter{2212}{\minus{}}%
10928 \DeclareUnicodeCharacter{2217}{\ast}%
10929 \DeclareUnicodeCharacter{221E}{\ensuremath\infty}%
10930 \DeclareUnicodeCharacter{2225}{\ensuremath\parallel}%
10931 \DeclareUnicodeCharacter{2227}{\ensuremath\wedge}%
10932 \DeclareUnicodeCharacter{2229}{\ensuremath\cap}%
10933 \DeclareUnicodeCharacter{2261}{\equiv{}}%
10934 \DeclareUnicodeCharacter{2264}{\ensuremath\leq}%
10935 \DeclareUnicodeCharacter{2265}{\ensuremath\geq}%
10936 \DeclareUnicodeCharacter{2282}{\ensuremath\subset}%
10937 \DeclareUnicodeCharacter{2287}{\ensuremath\supseteq}%
10939 \DeclareUnicodeCharacter{2016}{\ensuremath\Vert}%
10940 \DeclareUnicodeCharacter{2032}{\ensuremath\prime}%
10941 \DeclareUnicodeCharacter{210F}{\ensuremath\hbar}%
10942 \DeclareUnicodeCharacter{2111}{\ensuremath\Im}%
10943 \DeclareUnicodeCharacter{2113}{\ensuremath\ell}%
10944 \DeclareUnicodeCharacter{2118}{\ensuremath\wp}%
10945 \DeclareUnicodeCharacter{211C}{\ensuremath\Re}%
10946 \DeclareUnicodeCharacter{2135}{\ensuremath\aleph}%
10947 \DeclareUnicodeCharacter{2190}{\ensuremath\leftarrow}%
10948 \DeclareUnicodeCharacter{2191}{\ensuremath\uparrow}%
10949 \DeclareUnicodeCharacter{2193}{\ensuremath\downarrow}%
10950 \DeclareUnicodeCharacter{2194}{\ensuremath\leftrightarrow}%
10951 \DeclareUnicodeCharacter{2195}{\ensuremath\updownarrow}%
10952 \DeclareUnicodeCharacter{2196}{\ensuremath\nwarrow}%
10953 \DeclareUnicodeCharacter{2197}{\ensuremath\nearrow}%
10954 \DeclareUnicodeCharacter{2198}{\ensuremath\searrow}%
10955 \DeclareUnicodeCharacter{2199}{\ensuremath\swarrow}%
10956 \DeclareUnicodeCharacter{21A6}{\ensuremath\mapsto}%
10957 \DeclareUnicodeCharacter{21A9}{\ensuremath\hookleftarrow}%
10958 \DeclareUnicodeCharacter{21AA}{\ensuremath\hookrightarrow}%
10959 \DeclareUnicodeCharacter{21BC}{\ensuremath\leftharpoonup}%
10960 \DeclareUnicodeCharacter{21BD}{\ensuremath\leftharpoondown}%
10961 \DeclareUnicodeCharacter{21C0}{\ensuremath\rightharpoonup}%
10962 \DeclareUnicodeCharacter{21C1}{\ensuremath\rightharpoondown}%
10963 \DeclareUnicodeCharacter{21CC}{\ensuremath\rightleftharpoons}%
10964 \DeclareUnicodeCharacter{21D0}{\ensuremath\Leftarrow}%
10965 \DeclareUnicodeCharacter{21D1}{\ensuremath\Uparrow}%
10966 \DeclareUnicodeCharacter{21D3}{\ensuremath\Downarrow}%
10967 \DeclareUnicodeCharacter{21D4}{\ensuremath\Leftrightarrow}%
10968 \DeclareUnicodeCharacter{21D5}{\ensuremath\Updownarrow}%
10969 \DeclareUnicodeCharacter{2202}{\ensuremath\partial}%
10970 \DeclareUnicodeCharacter{2205}{\ensuremath\emptyset}%
10971 \DeclareUnicodeCharacter{2207}{\ensuremath\nabla}%
10972 \DeclareUnicodeCharacter{2209}{\ensuremath\notin}%
10973 \DeclareUnicodeCharacter{220B}{\ensuremath\owns}%
10974 \DeclareUnicodeCharacter{220F}{\ensuremath\prod}%
10975 \DeclareUnicodeCharacter{2210}{\ensuremath\coprod}%
10976 \DeclareUnicodeCharacter{2211}{\ensuremath\sum}%
10977 \DeclareUnicodeCharacter{2213}{\ensuremath\mp}%
10978 \DeclareUnicodeCharacter{2218}{\ensuremath\circ}%
10979 \DeclareUnicodeCharacter{221A}{\ensuremath\surd}%
10980 \DeclareUnicodeCharacter{221D}{\ensuremath\propto}%
10981 \DeclareUnicodeCharacter{2220}{\ensuremath\angle}%
10982 \DeclareUnicodeCharacter{2223}{\ensuremath\mid}%
10983 \DeclareUnicodeCharacter{2228}{\ensuremath\vee}%
10984 \DeclareUnicodeCharacter{222A}{\ensuremath\cup}%
10985 \DeclareUnicodeCharacter{222B}{\ensuremath\smallint}%
10986 \DeclareUnicodeCharacter{222E}{\ensuremath\oint}%
10987 \DeclareUnicodeCharacter{223C}{\ensuremath\sim}%
10988 \DeclareUnicodeCharacter{2240}{\ensuremath\wr}%
10989 \DeclareUnicodeCharacter{2243}{\ensuremath\simeq}%
10990 \DeclareUnicodeCharacter{2245}{\ensuremath\cong}%
10991 \DeclareUnicodeCharacter{2248}{\ensuremath\approx}%
10992 \DeclareUnicodeCharacter{224D}{\ensuremath\asymp}%
10993 \DeclareUnicodeCharacter{2250}{\ensuremath\doteq}%
10994 \DeclareUnicodeCharacter{2260}{\ensuremath\neq}%
10995 \DeclareUnicodeCharacter{226A}{\ensuremath\ll}%
10996 \DeclareUnicodeCharacter{226B}{\ensuremath\gg}%
10997 \DeclareUnicodeCharacter{227A}{\ensuremath\prec}%
10998 \DeclareUnicodeCharacter{227B}{\ensuremath\succ}%
10999 \DeclareUnicodeCharacter{2283}{\ensuremath\supset}%
11000 \DeclareUnicodeCharacter{2286}{\ensuremath\subseteq}%
11001 \DeclareUnicodeCharacter{228E}{\ensuremath\uplus}%
11002 \DeclareUnicodeCharacter{2291}{\ensuremath\sqsubseteq}%
11003 \DeclareUnicodeCharacter{2292}{\ensuremath\sqsupseteq}%
11004 \DeclareUnicodeCharacter{2293}{\ensuremath\sqcap}%
11005 \DeclareUnicodeCharacter{2294}{\ensuremath\sqcup}%
11006 \DeclareUnicodeCharacter{2295}{\ensuremath\oplus}%
11007 \DeclareUnicodeCharacter{2296}{\ensuremath\ominus}%
11008 \DeclareUnicodeCharacter{2297}{\ensuremath\otimes}%
11009 \DeclareUnicodeCharacter{2298}{\ensuremath\oslash}%
11010 \DeclareUnicodeCharacter{2299}{\ensuremath\odot}%
11011 \DeclareUnicodeCharacter{22A2}{\ensuremath\vdash}%
11012 \DeclareUnicodeCharacter{22A3}{\ensuremath\dashv}%
11013 \DeclareUnicodeCharacter{22A4}{\ensuremath\ptextop}%
11014 \DeclareUnicodeCharacter{22A5}{\ensuremath\bot}%
11015 \DeclareUnicodeCharacter{22A8}{\ensuremath\models}%
11016 \DeclareUnicodeCharacter{22C0}{\ensuremath\bigwedge}%
11017 \DeclareUnicodeCharacter{22C1}{\ensuremath\bigvee}%
11018 \DeclareUnicodeCharacter{22C2}{\ensuremath\bigcap}%
11019 \DeclareUnicodeCharacter{22C3}{\ensuremath\bigcup}%
11020 \DeclareUnicodeCharacter{22C4}{\ensuremath\diamond}%
11021 \DeclareUnicodeCharacter{22C5}{\ensuremath\cdot}%
11022 \DeclareUnicodeCharacter{22C6}{\ensuremath\star}%
11023 \DeclareUnicodeCharacter{22C8}{\ensuremath\bowtie}%
11024 \DeclareUnicodeCharacter{2308}{\ensuremath\lceil}%
11025 \DeclareUnicodeCharacter{2309}{\ensuremath\rceil}%
11026 \DeclareUnicodeCharacter{230A}{\ensuremath\lfloor}%
11027 \DeclareUnicodeCharacter{230B}{\ensuremath\rfloor}%
11028 \DeclareUnicodeCharacter{2322}{\ensuremath\frown}%
11029 \DeclareUnicodeCharacter{2323}{\ensuremath\smile}%
11031 \DeclareUnicodeCharacter{25B3}{\ensuremath\triangle}%
11032 \DeclareUnicodeCharacter{25B7}{\ensuremath\triangleright}%
11033 \DeclareUnicodeCharacter{25BD}{\ensuremath\bigtriangledown}%
11034 \DeclareUnicodeCharacter{25C1}{\ensuremath\triangleleft}%
11035 \DeclareUnicodeCharacter{25C7}{\ensuremath\diamond}%
11036 \DeclareUnicodeCharacter{2660}{\ensuremath\spadesuit}%
11037 \DeclareUnicodeCharacter{2661}{\ensuremath\heartsuit}%
11038 \DeclareUnicodeCharacter{2662}{\ensuremath\diamondsuit}%
11039 \DeclareUnicodeCharacter{2663}{\ensuremath\clubsuit}%
11040 \DeclareUnicodeCharacter{266D}{\ensuremath\flat}%
11041 \DeclareUnicodeCharacter{266E}{\ensuremath\natural}%
11042 \DeclareUnicodeCharacter{266F}{\ensuremath\sharp}%
11043 \DeclareUnicodeCharacter{26AA}{\ensuremath\bigcirc}%
11044 \DeclareUnicodeCharacter{27B9}{\ensuremath\rangle}%
11045 \DeclareUnicodeCharacter{27C2}{\ensuremath\perp}%
11046 \DeclareUnicodeCharacter{27E8}{\ensuremath\langle}%
11047 \DeclareUnicodeCharacter{27F5}{\ensuremath\longleftarrow}%
11048 \DeclareUnicodeCharacter{27F6}{\ensuremath\longrightarrow}%
11049 \DeclareUnicodeCharacter{27F7}{\ensuremath\longleftrightarrow}%
11050 \DeclareUnicodeCharacter{27FC}{\ensuremath\longmapsto}%
11051 \DeclareUnicodeCharacter{29F5}{\ensuremath\setminus}%
11052 \DeclareUnicodeCharacter{2A00}{\ensuremath\bigodot}%
11053 \DeclareUnicodeCharacter{2A01}{\ensuremath\bigoplus}%
11054 \DeclareUnicodeCharacter{2A02}{\ensuremath\bigotimes}%
11055 \DeclareUnicodeCharacter{2A04}{\ensuremath\biguplus}%
11056 \DeclareUnicodeCharacter{2A06}{\ensuremath\bigsqcup}%
11057 \DeclareUnicodeCharacter{2A3F}{\ensuremath\amalg}%
11058 \DeclareUnicodeCharacter{2AAF}{\ensuremath\preceq}%
11059 \DeclareUnicodeCharacter{2AB0}{\ensuremath\succeq}%
11061 \global\mathchardef\checkmark="1370% actually the square root sign
11062 \DeclareUnicodeCharacter{2713}{\ensuremath\checkmark}%
11063 }% end of \unicodechardefs
11065 % UTF-8 byte sequence (pdfTeX) definitions (replacing and @U command)
11066 % It makes the setting that replace UTF-8 byte sequence.
11067 \def\utfeightchardefs{%
11068 \let\DeclareUnicodeCharacter\DeclareUnicodeCharacterUTFviii
11072 % Whether the active definitions of non-ASCII characters expand to
11073 % non-active tokens with the same character code. This is used to
11074 % write characters literally, instead of using active definitions for
11075 % printing the correct glyphs.
11076 \newif\ifpassthroughchars
11077 \passthroughcharsfalse
11079 % For native Unicode handling (XeTeX and LuaTeX),
11080 % provide a definition macro to replace/pass-through a Unicode character
11082 \def\DeclareUnicodeCharacterNative#1#2{%
11083 \catcode"#1=\active
11084 \def\dodeclareunicodecharacternative##1##2##3{%
11086 \uccode`\~="##2\relax
11087 \uppercase{\gdef~}{%
11088 \ifpassthroughchars
11097 \uccode`\.="#1\relax
11098 \uppercase{\def\UTFNativeTmp{.}}%
11099 \expandafter\dodeclareunicodecharacternative\UTFNativeTmp{#1}{#2}%
11103 % Native Unicode handling (XeTeX and LuaTeX) character replacing definition.
11104 % It activates the setting that replaces Unicode characters.
11105 \def\nativeunicodechardefs{%
11106 \let\DeclareUnicodeCharacter\DeclareUnicodeCharacterNative
11110 % For native Unicode handling (XeTeX and LuaTeX),
11111 % make the character token expand
11112 % to the sequences given in \unicodechardefs for printing.
11113 \def\DeclareUnicodeCharacterNativeAtU#1#2{%
11115 \expandafter\globallet\csname uni:#1\endcsname \UTFAtUTmp
11118 % @U command definitions for native Unicode handling (XeTeX and LuaTeX).
11119 \def\nativeunicodechardefsatu{%
11120 \let\DeclareUnicodeCharacter\DeclareUnicodeCharacterNativeAtU
11124 % US-ASCII character definitions.
11125 \def\asciichardefs{% nothing need be done
11129 % Define all Unicode characters we know about. This makes UTF-8 the default
11130 % input encoding and allows @U to work.
11131 \iftxinativeunicodecapable
11132 \nativeunicodechardefsatu
11137 \message{formatting,}
11139 \newdimen\defaultparindent \defaultparindent = 15pt
11141 \chapheadingskip = 15pt plus 4pt minus 2pt
11142 \secheadingskip = 12pt plus 3pt minus 2pt
11143 \subsecheadingskip = 9pt plus 2pt minus 2pt
11145 % Prevent underfull vbox error messages.
11148 % Don't be very finicky about underfull hboxes, either.
11151 % Following George Bush, get rid of widows and orphans.
11152 \widowpenalty=10000
11155 % Use TeX 3.0's \emergencystretch to help line breaking, but if we're
11156 % using an old version of TeX, don't do anything. We want the amount of
11157 % stretch added to depend on the line length, hence the dependence on
11158 % \hsize. We call this whenever the paper size is set.
11160 \def\setemergencystretch{%
11161 \ifx\emergencystretch\thisisundefined
11162 % Allow us to assign to \emergencystretch anyway.
11163 \def\emergencystretch{\dimen0}%
11165 \emergencystretch = .15\hsize
11169 % Parameters in order: 1) textheight; 2) textwidth;
11170 % 3) voffset; 4) hoffset; 5) binding offset; 6) topskip;
11171 % 7) physical page height; 8) physical page width.
11173 % We also call \setleading{\textleading}, so the caller should define
11174 % \textleading. The caller should also set \parskip.
11176 \def\internalpagesizes#1#2#3#4#5#6#7#8{%
11177 \voffset = #3\relax
11178 \topskip = #6\relax
11179 \splittopskip = \topskip
11182 \advance\vsize by \topskip
11183 \outervsize = \vsize
11184 \advance\outervsize by 2\topandbottommargin
11185 \txipageheight = \vsize
11188 \outerhsize = \hsize
11189 \advance\outerhsize by 0.5in
11190 \txipagewidth = \hsize
11192 \normaloffset = #4\relax
11193 \bindingoffset = #5\relax
11196 \pdfpageheight #7\relax
11197 \pdfpagewidth #8\relax
11198 % if we don't reset these, they will remain at "1 true in" of
11199 % whatever layout pdftex was dumped with.
11200 \pdfhorigin = 1 true in
11201 \pdfvorigin = 1 true in
11203 \ifx\XeTeXrevision\thisisundefined
11204 \special{papersize=#8,#7}%
11206 \pdfpageheight #7\relax
11207 \pdfpagewidth #8\relax
11208 % XeTeX does not have \pdfhorigin and \pdfvorigin.
11212 \setleading{\textleading}
11214 \parindent = \defaultparindent
11215 \setemergencystretch
11218 % @letterpaper (the default).
11219 \def\letterpaper{{\globaldefs = 1
11220 \parskip = 3pt plus 2pt minus 1pt
11221 \textleading = 13.2pt
11223 % If page is nothing but text, make it come out even.
11224 \internalpagesizes{607.2pt}{6in}% that's 46 lines
11226 {\bindingoffset}{36pt}%
11230 % Use @smallbook to reset parameters for 7x9.25 trim size.
11231 \def\smallbook{{\globaldefs = 1
11232 \parskip = 2pt plus 1pt
11233 \textleading = 12pt
11235 \internalpagesizes{7.5in}{5in}%
11237 {\bindingoffset}{16pt}%
11240 \lispnarrowing = 0.3in
11242 \contentsrightmargin = 0pt
11243 \defbodyindent = .5cm
11246 % Use @afourpaper to print on European A4 paper.
11247 \def\afourpaper{{\globaldefs = 1
11248 \parskip = 3pt plus 2pt minus 1pt
11249 \textleading = 13.2pt
11251 % Double-side printing via postscript on Laserjet 4050
11252 % prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm.
11253 % To change the settings for a different printer or situation, adjust
11254 % \normaloffset until the front-side and back-side texts align. Then
11255 % do the same for \bindingoffset. You can set these for testing in
11256 % your texinfo source file like this:
11258 % \global\normaloffset = -6mm
11259 % \global\bindingoffset = 10mm
11261 \internalpagesizes{673.2pt}{160mm}% that's 51 lines
11262 {\voffset}{\hoffset}%
11263 {\bindingoffset}{44pt}%
11267 \contentsrightmargin = 0pt
11268 \defbodyindent = 5mm
11271 % Use @afivepaper to print on European A5 paper.
11272 % From romildo@urano.iceb.ufop.br, 2 July 2000.
11273 % He also recommends making @example and @lisp be small.
11274 \def\afivepaper{{\globaldefs = 1
11275 \parskip = 2pt plus 1pt minus 0.1pt
11276 \textleading = 12.5pt
11278 \internalpagesizes{160mm}{120mm}%
11279 {\voffset}{\hoffset}%
11280 {\bindingoffset}{8pt}%
11283 \lispnarrowing = 0.2in
11285 \contentsrightmargin = 0pt
11286 \defbodyindent = 2mm
11287 \tableindent = 12mm
11290 % A specific text layout, 24x15cm overall, intended for A4 paper.
11291 \def\afourlatex{{\globaldefs = 1
11293 \internalpagesizes{237mm}{150mm}%
11295 {\bindingoffset}{7mm}%
11298 % Must explicitly reset to 0 because we call \afourpaper.
11302 % Use @afourwide to print on A4 paper in landscape format.
11303 \def\afourwide{{\globaldefs = 1
11305 \internalpagesizes{241mm}{165mm}%
11306 {\voffset}{-2.95mm}%
11307 {\bindingoffset}{7mm}%
11312 \def\bsixpaper{{\globaldefs = 1
11314 \internalpagesizes{140mm}{100mm}%
11315 {-6.35mm}{-12.7mm}%
11316 {\bindingoffset}{14pt}%
11318 \let\SETdispenvsize=\smallword
11319 \lispnarrowing = 0.2in
11324 % @pagesizes TEXTHEIGHT[,TEXTWIDTH]
11325 % Perhaps we should allow setting the margins, \topskip, \parskip,
11326 % and/or leading, also. Or perhaps we should compute them somehow.
11328 \parseargdef\pagesizes{\pagesizesyyy #1,,\finish}
11329 \def\pagesizesyyy#1,#2,#3\finish{{%
11330 \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi
11333 \parskip = 3pt plus 2pt minus 1pt
11334 \setleading{\textleading}%
11337 \advance\dimen0 by 2.5in % default 1in margin above heading line
11338 % and 1.5in to include heading, footing and
11342 \advance\dimen2 by 2in % default to 1 inch margin on each side
11344 \internalpagesizes{#1}{\hsize}%
11345 {\voffset}{\normaloffset}%
11346 {\bindingoffset}{44pt}%
11347 {\dimen0}{\dimen2}%
11350 % Set default to letter.
11354 % Default value of \hfuzz, for suppressing warnings about overfull hboxes.
11358 \message{and turning on texinfo input format.}
11360 \def^^L{\par} % remove \outer, so ^L can appear in an @comment
11362 % DEL is a comment character, in case @c does not suffice.
11365 % Define macros to output various characters with catcode for normal text.
11366 \catcode`\"=\other \def\normaldoublequote{"}
11367 \catcode`\$=\other \def\normaldollar{$}%$ font-lock fix
11368 \catcode`\+=\other \def\normalplus{+}
11369 \catcode`\<=\other \def\normalless{<}
11370 \catcode`\>=\other \def\normalgreater{>}
11371 \catcode`\^=\other \def\normalcaret{^}
11372 \catcode`\_=\other \def\normalunderscore{_}
11373 \catcode`\|=\other \def\normalverticalbar{|}
11374 \catcode`\~=\other \def\normaltilde{~}
11376 % This macro is used to make a character print one way in \tt
11377 % (where it can probably be output as-is), and another way in other fonts,
11378 % where something hairier probably needs to be done.
11380 % #1 is what to print if we are indeed using \tt; #2 is what to print
11381 % otherwise. Since all the Computer Modern typewriter fonts have zero
11382 % interword stretch (and shrink), and it is reasonable to expect all
11383 % typewriter fonts to have this, we can check that font parameter.
11385 \def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi}
11387 % Same as above, but check for italic font. Actually this also catches
11388 % non-italic slanted fonts since it is impossible to distinguish them from
11389 % italic fonts. But since this is only used by $ and it uses \sl anyway
11390 % this is not a problem.
11391 \def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi}
11393 % Set catcodes for Texinfo file
11395 % Active characters for printing the wanted glyph.
11396 % Most of these we simply print from the \tt font, but for some, we can
11397 % use math or other variants that look better in normal text.
11399 \catcode`\"=\active
11400 \def\activedoublequote{{\tt\char34}}
11401 \let"=\activedoublequote
11402 \catcode`\~=\active \def\activetilde{{\tt\char126}} \let~ = \activetilde
11403 \chardef\hatchar=`\^
11404 \catcode`\^=\active \def\activehat{{\tt \hatchar}} \let^ = \activehat
11406 \catcode`\_=\active
11407 \def_{\ifusingtt\normalunderscore\_}
11408 \def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em }
11411 \catcode`\|=\active \def|{{\tt\char124}}
11414 \catcode`\<=\active \def\activeless{{\tt \less}}\let< = \activeless
11416 \catcode`\>=\active \def\activegtr{{\tt \gtr}}\let> = \activegtr
11417 \catcode`\+=\active \def+{{\tt \char 43}}
11418 \catcode`\$=\active \def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix
11419 \catcode`\-=\active \let-=\normaldash
11422 % used for headline/footline in the output routine, in case the page
11423 % breaks in the middle of an @tex block.
11424 \def\texinfochars{%
11425 \let< = \activeless
11427 \let~ = \activetilde
11431 \let\i = \smartitalic
11432 % in principle, all other definitions in \tex have to be undone too.
11435 % Used sometimes to turn off (effectively) the active characters even after
11437 \def\turnoffactive{%
11438 \normalturnoffactive
11444 % \backslashcurfont outputs one backslash character in current font,
11446 \global\chardef\backslashcurfont=`\\
11448 % \realbackslash is an actual character `\' with catcode other.
11449 {\catcode`\\=\other @gdef@realbackslash{\}}
11451 % In Texinfo, backslash is an active character; it prints the backslash
11452 % in fixed width font.
11453 \catcode`\\=\active % @ for escape char from now on.
11455 % Print a typewriter backslash. For math mode, we can't simply use
11456 % \backslashcurfont: the story here is that in math mode, the \char
11457 % of \backslashcurfont ends up printing the roman \ from the math symbol
11458 % font (because \char in math mode uses the \mathcode, and plain.tex
11459 % sets \mathcode`\\="026E). Hence we use an explicit \mathchar,
11460 % which is the decimal equivalent of "715c (class 7, e.g., use \fam;
11461 % ignored family value; char position "5C). We can't use " for the
11462 % usual hex value because it has already been made active.
11464 @def@ttbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi}}
11465 @let@backslashchar = @ttbackslash % @backslashchar{} is for user documents.
11467 % \otherbackslash defines an active \ to be a literal `\' character with
11469 @gdef@otherbackslash{@let\=@realbackslash}
11471 % Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
11472 % the literal character `\'.
11474 {@catcode`- = @active
11475 @gdef@normalturnoffactive{%
11476 @passthroughcharstrue
11478 @let"=@normaldoublequote
11479 @let$=@normaldollar %$ font-lock fix
11482 @let>=@normalgreater
11484 @let_=@normalunderscore
11485 @let|=@normalverticalbar
11493 % If a .fmt file is being used, characters that might appear in a file
11494 % name cannot be active until we have parsed the command line.
11495 % So turn them off again, and have @fixbackslash turn them back on.
11496 @catcode`+=@other @catcode`@_=@other
11498 % \enablebackslashhack - allow file to begin `\input texinfo'
11500 % If a .fmt file is being used, we don't want the `\input texinfo' to show up.
11501 % That is what \eatinput is for; after that, the `\' should revert to printing
11503 % If the file did not have a `\input texinfo', then it is turned off after
11504 % the first line; otherwise the first `\' in the file would cause an error.
11505 % This is used on the very last line of this file, texinfo.tex.
11506 % We also use @c to call @fixbackslash, in case ends of lines are hidden.
11509 @catcode`@^^M=13@gdef@enablebackslashhack{%
11510 @global@let\ = @eatinput%
11512 @def@c{@fixbackslash@c}%
11513 % Definition for the newline at the end of this file.
11514 @def ^^M{@let^^M@secondlinenl}%
11515 % Definition for a newline in the main Texinfo file.
11516 @gdef @secondlinenl{@fixbackslash}%
11517 % In case the first line has a whole-line command on it
11518 @let@originalparsearg@parsearg
11519 @def@parsearg{@fixbackslash@originalparsearg}
11522 {@catcode`@^=7 @catcode`@^^M=13%
11523 @gdef@eatinput input texinfo#1^^M{@fixbackslash}}
11525 % Emergency active definition of newline, in case an active newline token
11526 % appears by mistake.
11527 {@catcode`@^=7 @catcode13=13%
11528 @gdef@enableemergencynewline{%
11531 %<warning: active newline>@par%
11535 @gdef@fixbackslash{%
11536 @ifx\@eatinput @let\ = @ttbackslash @fi
11537 @catcode13=5 % regular end of line
11538 @enableemergencynewline
11540 @let@parsearg@originalparsearg
11541 % Also turn back on active characters that might appear in the input
11542 % file name, in case not using a pre-dumped format.
11544 @catcode`@_=@active
11546 % If texinfo.cnf is present on the system, read it.
11547 % Useful for site-wide @afourpaper, etc. This macro, @fixbackslash, gets
11548 % called at the beginning of every Texinfo file. Not opening texinfo.cnf
11549 % directly in this file, texinfo.tex, makes it possible to make a format
11550 % file for Texinfo.
11552 @openin 1 texinfo.cnf
11553 @ifeof 1 @else @input texinfo.cnf @fi
11558 % Say @foo, not \foo, in error messages.
11561 % These (along with & and #) are made active for url-breaking, so need
11562 % active definitions as the normal characters.
11564 @def@normalquest{?}
11565 @def@normalslash{/}
11567 % These look ok in all fonts, so just make them not special.
11568 % @hashchar{} gets its own user-level command, because of #line.
11569 @catcode`@& = @other @def@normalamp{&}
11570 @catcode`@# = @other @def@normalhash{#}
11571 @catcode`@% = @other @def@normalpercent{%}
11573 @let @hashchar = @normalhash
11575 @c Finally, make ` and ' active, so that txicodequoteundirected and
11576 @c txicodequotebacktick work right in, e.g., @w{@code{`foo'}}. If we
11577 @c don't make ` and ' active, @code will not get them as active chars.
11578 @c Do this last of all since we use ` in the previous @catcode assignments.
11579 @catcode`@'=@active
11580 @catcode`@`=@active
11583 @c Local variables:
11584 @c eval: (add-hook 'before-save-hook 'time-stamp nil t)
11585 @c time-stamp-pattern: "texinfoversion{%Y-%02m-%02d.%02H}"
11586 @c page-delimiter: "^\\\\message\\|emacs-page"
11591 @enablebackslashhack