test: protect more yacc declarations against C vs. C++ linkage.
[automake.git] / lib / texinfo.tex
blobe8c382f59672af05e9daba9fce22fad711fa9a57
1 % texinfo.tex -- TeX macros to handle Texinfo files.
3 % Load plain if necessary, i.e., if running under initex.
4 \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
6 \def\texinfoversion{2023-09-19.19}
8 % Copyright 1985, 1986, 1988, 1990-2023 Free Software Foundation, Inc.
10 % This texinfo.tex file is free software: you can redistribute it and/or
11 % modify it under the terms of the GNU General Public License as
12 % published by the Free Software Foundation, either version 3 of the
13 % License, or (at your option) any later version.
15 % This texinfo.tex file is distributed in the hope that it will be
16 % useful, but WITHOUT ANY WARRANTY; without even the implied warranty
17 % of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 % General Public License for more details.
20 % You should have received a copy of the GNU General Public License
21 % along with this program. If not, see <https://www.gnu.org/licenses/>.
23 % As a special exception, when this file is read by TeX when processing
24 % a Texinfo source document, you may use the result without
25 % restriction. This Exception is an additional permission under section 7
26 % of the GNU General Public License, version 3 ("GPLv3").
28 % Please try the latest version of texinfo.tex before submitting bug
29 % reports; you can get the latest version from:
30 % https://ftp.gnu.org/gnu/texinfo/ (the Texinfo release area), or
31 % https://ftpmirror.gnu.org/texinfo/ (same, via a mirror), or
32 % https://www.gnu.org/software/texinfo/ (the Texinfo home page)
33 % The texinfo.tex in any given distribution could well be out
34 % of date, so if that's what you're using, please check.
36 % Send bug reports to bug-texinfo@gnu.org. Please include a
37 % complete document in each bug report with which we can reproduce the
38 % problem. Patches are, of course, greatly appreciated.
40 % To process a Texinfo manual with TeX, it's most reliable to use the
41 % texi2dvi shell script that comes with the distribution. For a simple
42 % manual foo.texi, however, you can get away with this:
43 % tex foo.texi
44 % texindex foo.??
45 % tex foo.texi
46 % tex foo.texi
47 % dvips foo.dvi -o # or whatever; this makes foo.ps.
48 % The extra TeX runs get the cross-reference information correct.
49 % Sometimes one run after texindex suffices, and sometimes you need more
50 % than two; texi2dvi does it as many times as necessary.
52 % It is possible to adapt texinfo.tex for other languages, to some
53 % extent. You can get the existing language-specific files from the
54 % full Texinfo distribution.
56 % The GNU Texinfo home page is https://www.gnu.org/software/texinfo.
59 \message{Loading texinfo [version \texinfoversion]:}
61 % LaTeX's \typeout. This ensures that the messages it is used for
62 % are identical in format to the corresponding ones from latex/pdflatex.
63 \def\typeout{\immediate\write17}%
65 \chardef\other=12
67 % We never want plain's \outer definition of \+ in Texinfo.
68 % For @tex, we can use \tabalign.
69 \let\+ = \relax
71 % Save some plain tex macros whose names we will redefine.
72 \let\ptexb=\b
73 \let\ptexbullet=\bullet
74 \let\ptexc=\c
75 \let\ptexcomma=\,
76 \let\ptexdot=\.
77 \let\ptexdots=\dots
78 \let\ptexend=\end
79 \let\ptexequiv=\equiv
80 \let\ptexexclam=\!
81 \let\ptexfootnote=\footnote
82 \let\ptexgtr=>
83 \let\ptexhat=^
84 \let\ptexi=\i
85 \let\ptexindent=\indent
86 \let\ptexinsert=\insert
87 \let\ptexlbrace=\{
88 \let\ptexless=<
89 \let\ptexnewwrite\newwrite
90 \let\ptexnoindent=\noindent
91 \let\ptexplus=+
92 \let\ptexraggedright=\raggedright
93 \let\ptexrbrace=\}
94 \let\ptexslash=\/
95 \let\ptexsp=\sp
96 \let\ptexstar=\*
97 \let\ptexsup=\sup
98 \let\ptext=\t
99 \let\ptextop=\top
100 {\catcode`\'=\active \global\let\ptexquoteright'}% active in plain's math mode
102 % If this character appears in an error message or help string, it
103 % starts a new line in the output.
104 \newlinechar = `^^J
106 % Use TeX 3.0's \inputlineno to get the line number, for better error
107 % messages, but if we're using an old version of TeX, don't do anything.
109 \ifx\inputlineno\thisisundefined
110 \let\linenumber = \empty % Pre-3.0.
111 \else
112 \def\linenumber{l.\the\inputlineno:\space}
115 % Set up fixed words for English if not already set.
116 \ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi
117 \ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi
118 \ifx\putworderror\undefined \gdef\putworderror{error}\fi
119 \ifx\putwordfile\undefined \gdef\putwordfile{file}\fi
120 \ifx\putwordin\undefined \gdef\putwordin{in}\fi
121 \ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi
122 \ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi
123 \ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi
124 \ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi
125 \ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi
126 \ifx\putwordNoTitle\undefined \gdef\putwordNoTitle{No Title}\fi
127 \ifx\putwordof\undefined \gdef\putwordof{of}\fi
128 \ifx\putwordon\undefined \gdef\putwordon{on}\fi
129 \ifx\putwordpage\undefined \gdef\putwordpage{page}\fi
130 \ifx\putwordsection\undefined \gdef\putwordsection{section}\fi
131 \ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi
132 \ifx\putwordsee\undefined \gdef\putwordsee{see}\fi
133 \ifx\putwordSee\undefined \gdef\putwordSee{See}\fi
134 \ifx\putwordShortTOC\undefined \gdef\putwordShortTOC{Short Contents}\fi
135 \ifx\putwordTOC\undefined \gdef\putwordTOC{Table of Contents}\fi
137 \ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi
138 \ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi
139 \ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi
140 \ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi
141 \ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi
142 \ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi
143 \ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi
144 \ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi
145 \ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi
146 \ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi
147 \ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi
148 \ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi
150 \ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro}\fi
151 \ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi
152 \ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi
153 \ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi
154 \ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi
156 % Give the space character the catcode for a space.
157 \def\spaceisspace{\catcode`\ =10\relax}
159 % Likewise for ^^M, the end of line character.
160 \def\endlineisspace{\catcode13=10\relax}
162 \chardef\dashChar = `\-
163 \chardef\slashChar = `\/
164 \chardef\underChar = `\_
166 % Ignore a token.
168 \def\gobble#1{}
170 % The following is used inside several \edef's.
171 \def\makecsname#1{\expandafter\noexpand\csname#1\endcsname}
173 % Hyphenation fixes.
174 \hyphenation{
175 Flor-i-da Ghost-script Ghost-view Mac-OS Post-Script
176 ap-pen-dix bit-map bit-maps
177 data-base data-bases eshell fall-ing half-way long-est man-u-script
178 man-u-scripts mini-buf-fer mini-buf-fers over-view par-a-digm
179 par-a-digms rath-er rec-tan-gu-lar ro-bot-ics se-vere-ly set-up spa-ces
180 spell-ing spell-ings
181 stand-alone strong-est time-stamp time-stamps which-ever white-space
182 wide-spread wrap-around
185 % Sometimes it is convenient to have everything in the transcript file
186 % and nothing on the terminal. We don't just call \tracingall here,
187 % since that produces some useless output on the terminal. We also make
188 % some effort to order the tracing commands to reduce output in the log
189 % file; cf. trace.sty in LaTeX.
191 \def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%
192 \def\loggingall{%
193 \tracingstats2
194 \tracingpages1
195 \tracinglostchars2 % 2 gives us more in etex
196 \tracingparagraphs1
197 \tracingoutput1
198 \tracingmacros2
199 \tracingrestores1
200 \showboxbreadth\maxdimen \showboxdepth\maxdimen
201 \ifx\eTeXversion\thisisundefined\else % etex gives us more logging
202 \tracingscantokens1
203 \tracingifs1
204 \tracinggroups1
205 \tracingnesting2
206 \tracingassigns1
208 \tracingcommands3 % 3 gives us more in etex
209 \errorcontextlines16
212 % @errormsg{MSG}. Do the index-like expansions on MSG, but if things
213 % aren't perfect, it's not the end of the world, being an error message,
214 % after all.
216 \def\errormsg{\begingroup \indexnofonts \doerrormsg}
217 \def\doerrormsg#1{\errmessage{#1}}
219 % add check for \lastpenalty to plain's definitions. If the last thing
220 % we did was a \nobreak, we don't want to insert more space.
222 \def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount
223 \removelastskip\penalty-50\smallskip\fi\fi}
224 \def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount
225 \removelastskip\penalty-100\medskip\fi\fi}
226 \def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount
227 \removelastskip\penalty-200\bigskip\fi\fi}
229 %\f Output routine
232 % For a final copy, take out the rectangles
233 % that mark overfull boxes (in case you have decided
234 % that the text looks ok even though it passes the margin).
236 \def\finalout{\overfullrule=0pt }
238 % Output a mark which sets \thischapter, \thissection and \thiscolor.
239 % We dump everything together because we only have one kind of mark.
240 % This works because we only use \botmark / \topmark, not \firstmark.
242 % A mark contains a subexpression of the \ifcase ... \fi construct.
243 % \get*marks macros below extract the needed part using \ifcase.
245 % Another complication is to let the user choose whether \thischapter
246 % (\thissection) refers to the chapter (section) in effect at the top
247 % of a page, or that at the bottom of a page.
249 % \domark is called twice inside \chapmacro, to add one
250 % mark before the section break, and one after.
251 % In the second call \prevchapterdefs is the same as \currentchapterdefs,
252 % and \prevsectiondefs is the same as \currentsectiondefs.
253 % Then if the page is not broken at the mark, some of the previous
254 % section appears on the page, and we can get the name of this section
255 % from \firstmark for @everyheadingmarks top.
256 % @everyheadingmarks bottom uses \botmark.
258 % See page 260 of The TeXbook.
259 \def\domark{%
260 \toks0=\expandafter{\currentchapterdefs}%
261 \toks2=\expandafter{\currentsectiondefs}%
262 \toks4=\expandafter{\prevchapterdefs}%
263 \toks6=\expandafter{\prevsectiondefs}%
264 \toks8=\expandafter{\currentcolordefs}%
265 \mark{%
266 \the\toks0 \the\toks2 % 0: marks for @everyheadingmarks top
267 \noexpand\or \the\toks4 \the\toks6 % 1: for @everyheadingmarks bottom
268 \noexpand\else \the\toks8 % 2: color marks
272 % \gettopheadingmarks, \getbottomheadingmarks,
273 % \getcolormarks - extract needed part of mark.
275 % \topmark doesn't work for the very first chapter (after the title
276 % page or the contents), so we use \firstmark there -- this gets us
277 % the mark with the chapter defs, unless the user sneaks in, e.g.,
278 % @setcolor (or @url etc.) between @contents and the very first @chapter.
279 \def\gettopheadingmarks{%
280 \ifcase0\the\savedtopmark\fi
281 \ifx\thischapter\empty \ifcase0\firstmark\fi \fi
283 \def\getbottomheadingmarks{\ifcase1\botmark\fi}
284 \def\getcolormarks{\ifcase2\the\savedtopmark\fi}
286 % Avoid "undefined control sequence" errors.
287 \def\currentchapterdefs{}
288 \def\currentsectiondefs{}
289 \def\currentsection{}
290 \def\prevchapterdefs{}
291 \def\prevsectiondefs{}
292 \def\currentcolordefs{}
294 % Margin to add to right of even pages, to left of odd pages.
295 \newdimen\bindingoffset
296 \newdimen\normaloffset
297 \newdimen\txipagewidth \newdimen\txipageheight
299 % Main output routine.
301 \chardef\PAGE = 255
302 \newtoks\defaultoutput
303 \defaultoutput = {\savetopmark\onepageout{\pagecontents\PAGE}}
304 \output=\expandafter{\the\defaultoutput}
306 \newbox\headlinebox
307 \newbox\footlinebox
309 % When outputting the double column layout for indices, an output routine
310 % is run several times, hiding the original value of \topmark. Hence, save
311 % \topmark at the beginning.
313 \newtoks\savedtopmark
314 \newif\iftopmarksaved
315 \topmarksavedtrue
316 \def\savetopmark{%
317 \iftopmarksaved\else
318 \global\savedtopmark=\expandafter{\topmark}%
319 \global\topmarksavedtrue
323 % \onepageout takes a vbox as an argument.
324 % \shipout a vbox for a single page, adding an optional header, footer
325 % and footnote. This also causes index entries for this page to be written
326 % to the auxiliary files.
328 \def\onepageout#1{%
329 \hoffset=\normaloffset
331 \ifodd\pageno \advance\hoffset by \bindingoffset
332 \else \advance\hoffset by -\bindingoffset\fi
334 \checkchapterpage
336 % Make the heading and footing. \makeheadline and \makefootline
337 % use the contents of \headline and \footline.
338 \def\commonheadfootline{\let\hsize=\txipagewidth \texinfochars}
339 \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi
340 \global\setbox\headlinebox = \vbox{\commonheadfootline \makeheadline}%
341 \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi
342 \global\setbox\footlinebox = \vbox{\commonheadfootline \makefootline}%
345 % Set context for writing to auxiliary files like index files.
346 % Have to do this stuff outside the \shipout because we want it to
347 % take effect in \write's, yet the group defined by the \vbox ends
348 % before the \shipout runs.
350 \atdummies % don't expand commands in the output.
351 \turnoffactive
352 \shipout\vbox{%
353 % Do this early so pdf references go to the beginning of the page.
354 \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi
356 \unvbox\headlinebox
357 \pagebody{#1}%
358 \ifdim\ht\footlinebox > 0pt
359 % Only leave this space if the footline is nonempty.
360 % (We lessened \vsize for it in \oddfootingyyy.)
361 % The \baselineskip=24pt in plain's \makefootline has no effect.
362 \vskip 24pt
363 \unvbox\footlinebox
368 \global\topmarksavedfalse
369 \advancepageno
370 \ifnum\outputpenalty>-20000 \else\dosupereject\fi
373 \newinsert\margin \dimen\margin=\maxdimen
375 % Main part of page, including any footnotes
376 \def\pagebody#1{\vbox to\txipageheight{\boxmaxdepth=\maxdepth #1}}
377 {\catcode`\@ =11
378 \gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
379 % marginal hacks, juha@viisa.uucp (Juha Takala)
380 \ifvoid\margin\else % marginal info is present
381 \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi
382 \dimen@=\dp#1\relax \unvbox#1\relax
383 \ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
384 \ifr@ggedbottom \kern-\dimen@ \vfil \fi}
387 % Check if we are on the first page of a chapter. Used for printing headings.
388 \newif\ifchapterpage
389 \def\checkchapterpage{%
390 % Get the chapter that was current at the end of the last page
391 \ifcase1\the\savedtopmark\fi
392 \let\prevchaptername\thischaptername
394 \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi
395 \let\curchaptername\thischaptername
397 \ifx\curchaptername\prevchaptername
398 \chapterpagefalse
399 \else
400 \chapterpagetrue
404 % Argument parsing
406 % Parse an argument, then pass it to #1. The argument is the rest of
407 % the input line (except we remove a trailing comment). #1 should be a
408 % macro which expects an ordinary undelimited TeX argument.
409 % For example, \def\foo{\parsearg\fooxxx}.
411 \def\parsearg{\parseargusing{}}
412 \def\parseargusing#1#2{%
413 \def\argtorun{#2}%
414 \begingroup
415 \obeylines
416 \spaceisspace
418 \parseargline\empty% Insert the \empty token, see \finishparsearg below.
421 {\obeylines %
422 \gdef\parseargline#1^^M{%
423 \endgroup % End of the group started in \parsearg.
424 \argremovecomment #1\comment\ArgTerm%
428 % First remove any @comment, then any @c comment. Pass the result on to
429 % \argremovespace.
430 \def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm}
431 \def\argremovec#1\c#2\ArgTerm{\argremovespace#1$ $\ArgTerm}
432 % \argremovec might leave us with trailing space, though; e.g.,
433 % @end itemize @c foo
434 % Note that the argument cannot contain the TeX $, as its catcode is
435 % changed to \other when Texinfo source is read.
436 \def\argremovespace#1 $#2\ArgTerm{\finishparsearg#1$\ArgTerm}
438 % If a _delimited_ argument is enclosed in braces, they get stripped; so
439 % to get _exactly_ the rest of the line, we had to prevent such situation.
440 % We prepended an \empty token at the very beginning and we expand it
441 % just before passing the control to \next.
442 % (But first, we have to remove the remaining $ or two.)
443 \def\finishparsearg#1$#2\ArgTerm{\expandafter\argtorun\expandafter{#1}}
446 % \parseargdef - define a command taking an argument on the line
448 % \parseargdef\foo{...}
449 % is roughly equivalent to
450 % \def\foo{\parsearg\Xfoo}
451 % \def\Xfoo#1{...}
452 \def\parseargdef#1{%
453 \expandafter \doparseargdef \csname\string#1\endcsname #1%
455 \def\doparseargdef#1#2{%
456 \def#2{\parsearg#1}%
457 \def#1##1%
460 % Several utility definitions with active space:
462 \obeyspaces
463 \gdef\obeyedspace{ }
465 % Make each space character in the input produce a normal interword
466 % space in the output. Don't allow a line break at this space, as this
467 % is used only in environments like @example, where each line of input
468 % should produce a line of output anyway.
470 \gdef\sepspaces{\obeyspaces\let =\tie}
472 % If an index command is used in an @example environment, any spaces
473 % therein should become regular spaces in the raw index file, not the
474 % expansion of \tie (\leavevmode \penalty \@M \ ).
475 \gdef\unsepspaces{\let =\space}
479 \def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}
481 % Define the framework for environments in texinfo.tex. It's used like this:
483 % \envdef\foo{...}
484 % \def\Efoo{...}
486 % It's the responsibility of \envdef to insert \begingroup before the
487 % actual body; @end closes the group after calling \Efoo. \envdef also
488 % defines \thisenv, so the current environment is known; @end checks
489 % whether the environment name matches. The \checkenv macro can also be
490 % used to check whether the current environment is the one expected.
492 % Non-false conditionals (@iftex, @ifset) don't fit into this, so they
493 % are not treated as environments; they don't open a group. (The
494 % implementation of @end takes care not to call \endgroup in this
495 % special case.)
498 % At run-time, environments start with this:
499 \def\startenvironment#1{\begingroup\def\thisenv{#1}}
500 % initialize
501 \let\thisenv\empty
503 % ... but they get defined via ``\envdef\foo{...}'':
504 \long\def\envdef#1#2{\def#1{\startenvironment#1#2}}
505 \long\def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}}
507 % Check whether we're in the right environment:
508 \def\checkenv#1{%
509 \def\temp{#1}%
510 \ifx\thisenv\temp
511 \else
512 \badenverr
516 % Environment mismatch, #1 expected:
517 \def\badenverr{%
518 \errhelp = \EMsimple
519 \errmessage{This command can appear only \inenvironment\temp,
520 not \inenvironment\thisenv}%
522 \def\inenvironment#1{%
523 \ifx#1\empty
524 outside of any environment%
525 \else
526 in environment \expandafter\string#1%
531 % @end foo calls \checkenv and executes the definition of \Efoo.
532 \parseargdef\end{%
533 \if 1\csname iscond.#1\endcsname
534 \else
535 % The general wording of \badenverr may not be ideal.
536 \expandafter\checkenv\csname#1\endcsname
537 \csname E#1\endcsname
538 \endgroup
542 \newhelp\EMsimple{Press RETURN to continue.}
545 % Be sure we're in horizontal mode when doing a tie, since we make space
546 % equivalent to this in @example-like environments. Otherwise, a space
547 % at the beginning of a line will start with \penalty -- and
548 % since \penalty is valid in vertical mode, we'd end up putting the
549 % penalty on the vertical list instead of in the new paragraph.
550 {\catcode`@ = 11
551 % Avoid using \@M directly, because that causes trouble
552 % if the definition is written into an index file.
553 \global\let\tiepenalty = \@M
554 \gdef\tie{\leavevmode\penalty\tiepenalty\ }
557 % @: forces normal size whitespace following.
558 \def\:{\spacefactor=1000 }
560 % @* forces a line break.
561 \def\*{\unskip\hfil\break\hbox{}\ignorespaces}
563 % @/ allows a line break.
564 \let\/=\allowbreak
566 % @- allows explicit insertion of hyphenation points
567 \def\-{\discretionary{\normaldash}{}{}}%
569 % @. is an end-of-sentence period.
570 \def\.{.\spacefactor=\endofsentencespacefactor\space}
572 % @! is an end-of-sentence bang.
573 \def\!{!\spacefactor=\endofsentencespacefactor\space}
575 % @? is an end-of-sentence query.
576 \def\?{?\spacefactor=\endofsentencespacefactor\space}
578 % @w prevents a word break. Without the \leavevmode, @w at the
579 % beginning of a paragraph, when TeX is still in vertical mode, would
580 % produce a whole line of output instead of starting the paragraph.
581 \def\w#1{\leavevmode\hbox{#1}}
583 % @group ... @end group forces ... to be all on one page, by enclosing
584 % it in a TeX vbox. We use \vtop instead of \vbox to construct the box
585 % to keep its height that of a normal line. According to the rules for
586 % \topskip (p.114 of the TeXbook), the glue inserted is
587 % max (\topskip - \ht (first item), 0). If that height is large,
588 % therefore, no glue is inserted, and the space between the headline and
589 % the text is small, which looks bad.
591 % Another complication is that the group might be very large. This can
592 % cause the glue on the previous page to be unduly stretched, because it
593 % does not have much material. In this case, it's better to add an
594 % explicit \vfill so that the extra space is at the bottom. The
595 % threshold for doing this is if the group is more than \vfilllimit
596 % percent of a page (\vfilllimit can be changed inside of @tex).
598 \newbox\groupbox
599 \def\vfilllimit{0.7}
601 \envdef\group{%
602 \ifnum\catcode`\^^M=\active \else
603 \errhelp = \groupinvalidhelp
604 \errmessage{@group invalid in context where filling is enabled}%
606 \startsavinginserts
608 \setbox\groupbox = \vtop\bgroup
609 % Do @comment since we are called inside an environment such as
610 % @example, where each end-of-line in the input causes an
611 % end-of-line in the output. We don't want the end-of-line after
612 % the `@group' to put extra space in the output. Since @group
613 % should appear on a line by itself (according to the Texinfo
614 % manual), we don't worry about eating any user text.
615 \comment
618 % The \vtop produces a box with normal height and large depth; thus, TeX puts
619 % \baselineskip glue before it, and (when the next line of text is done)
620 % \lineskip glue after it. Thus, space below is not quite equal to space
621 % above. But it's pretty close.
622 \def\Egroup{%
623 % To get correct interline space between the last line of the group
624 % and the first line afterwards, we have to propagate \prevdepth.
625 \endgraf % Not \par, as it may have been set to \lisppar.
626 \global\dimen1 = \prevdepth
627 \egroup % End the \vtop.
628 \addgroupbox
629 \prevdepth = \dimen1
630 \checkinserts
633 \def\addgroupbox{
634 % \dimen0 is the vertical size of the group's box.
635 \dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox
636 % \dimen2 is how much space is left on the page (more or less).
637 \dimen2 = \txipageheight \advance\dimen2 by -\pagetotal
638 % if the group doesn't fit on the current page, and it's a big big
639 % group, force a page break.
640 \ifdim \dimen0 > \dimen2
641 \ifdim \pagetotal < \vfilllimit\txipageheight
642 \page
645 \box\groupbox
649 % TeX puts in an \escapechar (i.e., `@') at the beginning of the help
650 % message, so this ends up printing `@group can only ...'.
652 \newhelp\groupinvalidhelp{%
653 group can only be used in environments such as @example,^^J%
654 where each line of input produces a line of output.}
656 % @need space-in-mils
657 % forces a page break if there is not space-in-mils remaining.
659 \newdimen\mil \mil=0.001in
661 \parseargdef\need{%
662 % Ensure vertical mode, so we don't make a big box in the middle of a
663 % paragraph.
664 \par
666 % If the @need value is less than one line space, it's useless.
667 \dimen0 = #1\mil
668 \dimen2 = \ht\strutbox
669 \advance\dimen2 by \dp\strutbox
670 \ifdim\dimen0 > \dimen2
671 % This is similar to the 'needspace' module in LaTeX.
672 % The first penalty allows a break if the end of the page is
673 % not too far away. Following penalties and skips are discarded.
674 % Otherwise, require at least \dimen0 of vertical space.
676 % (We used to use a \vtop to reserve space, but this had spacing issues
677 % when followed by a section heading, as it was not a "discardable item".
678 % This also has the benefit of providing glue before the page break if
679 % there isn't enough space.)
680 \vskip0pt plus \dimen0
681 \penalty-100
682 \vskip0pt plus -\dimen0
683 \vskip \dimen0
684 \penalty9999
685 \vskip -\dimen0
686 \penalty0\relax % this hides the above glue from \safewhatsit and \dobreak
690 % @br forces paragraph break (and is undocumented).
692 \let\br = \par
694 % @page forces the start of a new page.
696 \def\page{\par\vfill\supereject}
698 % @exdent text....
699 % outputs text on separate line in roman font, starting at standard page margin
701 % This records the amount of indent in the innermost environment.
702 % That's how much \exdent should take out.
703 \newskip\exdentamount
705 % This defn is used inside fill environments such as @defun.
706 \parseargdef\exdent{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}
708 % This defn is used inside nofill environments such as @example.
709 \parseargdef\nofillexdent{{\advance \leftskip by -\exdentamount
710 \leftline{\hskip\leftskip{\rm#1}}}}
712 % @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current
713 % paragraph. For more general purposes, use the \margin insertion
714 % class. WHICH is `l' or `r'. Not documented, written for gawk manual.
716 \newskip\inmarginspacing \inmarginspacing=1cm
717 \def\strutdepth{\dp\strutbox}
719 \def\doinmargin#1#2{\strut\vadjust{%
720 \nobreak
721 \kern-\strutdepth
722 \vtop to \strutdepth{%
723 \baselineskip=\strutdepth
724 \vss
725 % if you have multiple lines of stuff to put here, you'll need to
726 % make the vbox yourself of the appropriate size.
727 \ifx#1l%
728 \llap{\ignorespaces #2\hskip\inmarginspacing}%
729 \else
730 \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}%
732 \null
735 \def\inleftmargin{\doinmargin l}
736 \def\inrightmargin{\doinmargin r}
738 % @inmargin{TEXT [, RIGHT-TEXT]}
739 % (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right;
740 % else use TEXT for both).
742 \def\inmargin#1{\parseinmargin #1,,\finish}
743 \def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing.
744 \setbox0 = \hbox{\ignorespaces #2}%
745 \ifdim\wd0 > 0pt
746 \def\lefttext{#1}% have both texts
747 \def\righttext{#2}%
748 \else
749 \def\lefttext{#1}% have only one text
750 \def\righttext{#1}%
753 \ifodd\pageno
754 \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin
755 \else
756 \def\temp{\inleftmargin\lefttext}%
758 \temp
761 % @include FILE -- \input text of FILE.
763 \def\include{\parseargusing\filenamecatcodes\includezzz}
764 \def\includezzz#1{%
765 \pushthisfilestack
766 \def\thisfile{#1}%
768 \makevalueexpandable % we want to expand any @value in FILE.
769 \turnoffactive % and allow special characters in the expansion
770 \indexnofonts % Allow `@@' and other weird things in file names.
771 \wlog{texinfo.tex: doing @include of #1^^J}%
772 \edef\temp{\noexpand\input #1 }%
774 % This trickery is to read FILE outside of a group, in case it makes
775 % definitions, etc.
776 \expandafter
777 }\temp
778 \popthisfilestack
780 \def\filenamecatcodes{%
781 \catcode`\\=\other
782 \catcode`~=\other
783 \catcode`^=\other
784 \catcode`_=\other
785 \catcode`|=\other
786 \catcode`<=\other
787 \catcode`>=\other
788 \catcode`+=\other
789 \catcode`-=\other
790 \catcode`\`=\other
791 \catcode`\'=\other
794 \def\pushthisfilestack{%
795 \expandafter\pushthisfilestackX\popthisfilestack\StackTerm
797 \def\pushthisfilestackX{%
798 \expandafter\pushthisfilestackY\thisfile\StackTerm
800 \def\pushthisfilestackY #1\StackTerm #2\StackTerm {%
801 \gdef\popthisfilestack{\gdef\thisfile{#1}\gdef\popthisfilestack{#2}}%
804 \def\popthisfilestack{\errthisfilestackempty}
805 \def\errthisfilestackempty{\errmessage{Internal error:
806 the stack of filenames is empty.}}
808 \def\thisfile{}
810 % @center line
811 % outputs that line, centered.
813 \parseargdef\center{%
814 \ifhmode
815 \let\centersub\centerH
816 \else
817 \let\centersub\centerV
819 \centersub{\hfil \ignorespaces#1\unskip \hfil}%
820 \let\centersub\relax % don't let the definition persist, just in case
822 \def\centerH#1{{%
823 \hfil\break
824 \advance\hsize by -\leftskip
825 \advance\hsize by -\rightskip
826 \line{#1}%
827 \break
830 \newcount\centerpenalty
831 \def\centerV#1{%
832 % The idea here is the same as in \startdefun, \cartouche, etc.: if
833 % @center is the first thing after a section heading, we need to wipe
834 % out the negative parskip inserted by \sectionheading, but still
835 % prevent a page break here.
836 \centerpenalty = \lastpenalty
837 \ifnum\centerpenalty>10000 \vskip\parskip \fi
838 \ifnum\centerpenalty>9999 \penalty\centerpenalty \fi
839 \line{\kern\leftskip #1\kern\rightskip}%
842 % @sp n outputs n lines of vertical space
844 \parseargdef\sp{\vskip #1\baselineskip}
846 % @comment ...line which is ignored...
847 % @c is the same as @comment
848 % @ignore ... @end ignore is another way to write a comment
851 \def\c{\begingroup \catcode`\^^M=\active%
852 \catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%
853 \cxxx}
854 {\catcode`\^^M=\active \gdef\cxxx#1^^M{\endgroup}}
856 \let\comment\c
858 % @paragraphindent NCHARS
859 % We'll use ems for NCHARS, close enough.
860 % NCHARS can also be the word `asis' or `none'.
861 % We cannot feasibly implement @paragraphindent asis, though.
863 \def\asisword{asis} % no translation, these are keywords
864 \def\noneword{none}
866 \parseargdef\paragraphindent{%
867 \def\temp{#1}%
868 \ifx\temp\asisword
869 \else
870 \ifx\temp\noneword
871 \defaultparindent = 0pt
872 \else
873 \defaultparindent = #1em
876 \parindent = \defaultparindent
879 % @exampleindent NCHARS
880 % We'll use ems for NCHARS like @paragraphindent.
881 % It seems @exampleindent asis isn't necessary, but
882 % I preserve it to make it similar to @paragraphindent.
883 \parseargdef\exampleindent{%
884 \def\temp{#1}%
885 \ifx\temp\asisword
886 \else
887 \ifx\temp\noneword
888 \lispnarrowing = 0pt
889 \else
890 \lispnarrowing = #1em
895 % @firstparagraphindent WORD
896 % If WORD is `none', then suppress indentation of the first paragraph
897 % after a section heading. If WORD is `insert', then do indent at such
898 % paragraphs.
900 % The paragraph indentation is suppressed or not by calling
901 % \suppressfirstparagraphindent, which the sectioning commands do.
902 % We switch the definition of this back and forth according to WORD.
903 % By default, we suppress indentation.
905 \def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent}
906 \def\insertword{insert}
908 \parseargdef\firstparagraphindent{%
909 \def\temp{#1}%
910 \ifx\temp\noneword
911 \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent
912 \else\ifx\temp\insertword
913 \let\suppressfirstparagraphindent = \relax
914 \else
915 \errhelp = \EMsimple
916 \errmessage{Unknown @firstparagraphindent option `\temp'}%
917 \fi\fi
920 % Here is how we actually suppress indentation. Redefine \everypar to
921 % \kern backwards by \parindent, and then reset itself to empty.
923 % We also make \indent itself not actually do anything until the next
924 % paragraph.
926 \gdef\dosuppressfirstparagraphindent{%
927 \gdef\indent {\restorefirstparagraphindent \indent}%
928 \gdef\noindent{\restorefirstparagraphindent \noindent}%
929 \global\everypar = {\kern -\parindent \restorefirstparagraphindent}%
932 \gdef\restorefirstparagraphindent{%
933 \global\let\indent = \ptexindent
934 \global\let\noindent = \ptexnoindent
935 \global\everypar = {}%
938 % leave vertical mode without cancelling any first paragraph indent
939 \gdef\imageindent{%
940 \toks0=\everypar
941 \everypar={}%
942 \ptexnoindent
943 \global\everypar=\toks0
947 % @refill is a no-op.
948 \let\refill=\relax
950 % @setfilename INFO-FILENAME - ignored
951 \let\setfilename=\comment
953 % @bye.
954 \outer\def\bye{\chappager\pagelabels\tracingstats=1\ptexend}
957 \message{pdf,}
958 % adobe `portable' document format
959 \newcount\tempnum
960 \newcount\lnkcount
961 \newtoks\filename
962 \newcount\filenamelength
963 \newcount\pgn
964 \newtoks\toksA
965 \newtoks\toksB
966 \newtoks\toksC
967 \newtoks\toksD
968 \newbox\boxA
969 \newbox\boxB
970 \newcount\countA
971 \newif\ifpdf
972 \newif\ifpdfmakepagedest
975 % For LuaTeX
978 \newif\iftxiuseunicodedestname
979 \txiuseunicodedestnamefalse % For pdfTeX etc.
981 \ifx\luatexversion\thisisundefined
982 \else
983 % Use Unicode destination names
984 \txiuseunicodedestnametrue
985 % Escape PDF strings with converting UTF-16 from UTF-8
986 \begingroup
987 \catcode`\%=12
988 \directlua{
989 function UTF16oct(str)
990 tex.sprint(string.char(0x5c) .. '376' .. string.char(0x5c) .. '377')
991 for c in string.utfvalues(str) do
992 if c < 0x10000 then
993 tex.sprint(
994 string.format(string.char(0x5c) .. string.char(0x25) .. '03o' ..
995 string.char(0x5c) .. string.char(0x25) .. '03o',
996 math.floor(c / 256), math.floor(c % 256)))
997 else
998 c = c - 0x10000
999 local c_hi = c / 1024 + 0xd800
1000 local c_lo = c % 1024 + 0xdc00
1001 tex.sprint(
1002 string.format(string.char(0x5c) .. string.char(0x25) .. '03o' ..
1003 string.char(0x5c) .. string.char(0x25) .. '03o' ..
1004 string.char(0x5c) .. string.char(0x25) .. '03o' ..
1005 string.char(0x5c) .. string.char(0x25) .. '03o',
1006 math.floor(c_hi / 256), math.floor(c_hi % 256),
1007 math.floor(c_lo / 256), math.floor(c_lo % 256)))
1012 \endgroup
1013 \def\pdfescapestrutfsixteen#1{\directlua{UTF16oct('\luaescapestring{#1}')}}
1014 % Escape PDF strings without converting
1015 \begingroup
1016 \directlua{
1017 function PDFescstr(str)
1018 for c in string.bytes(str) do
1019 if c <= 0x20 or c >= 0x80 or c == 0x28 or c == 0x29 or c == 0x5c then
1020 tex.sprint(-2,
1021 string.format(string.char(0x5c) .. string.char(0x25) .. '03o',
1023 else
1024 tex.sprint(-2, string.char(c))
1029 % The -2 in the arguments here gives all the input to TeX catcode 12
1030 % (other) or 10 (space), preventing undefined control sequence errors. See
1031 % https://lists.gnu.org/archive/html/bug-texinfo/2019-08/msg00031.html
1033 \endgroup
1034 \def\pdfescapestring#1{\directlua{PDFescstr('\luaescapestring{#1}')}}
1035 \ifnum\luatexversion>84
1036 % For LuaTeX >= 0.85
1037 \def\pdfdest{\pdfextension dest}
1038 \let\pdfoutput\outputmode
1039 \def\pdfliteral{\pdfextension literal}
1040 \def\pdfcatalog{\pdfextension catalog}
1041 \def\pdftexversion{\numexpr\pdffeedback version\relax}
1042 \let\pdfximage\saveimageresource
1043 \let\pdfrefximage\useimageresource
1044 \let\pdflastximage\lastsavedimageresourceindex
1045 \def\pdfendlink{\pdfextension endlink\relax}
1046 \def\pdfoutline{\pdfextension outline}
1047 \def\pdfstartlink{\pdfextension startlink}
1048 \def\pdffontattr{\pdfextension fontattr}
1049 \def\pdfobj{\pdfextension obj}
1050 \def\pdflastobj{\numexpr\pdffeedback lastobj\relax}
1051 \let\pdfpagewidth\pagewidth
1052 \let\pdfpageheight\pageheight
1053 \edef\pdfhorigin{\pdfvariable horigin}
1054 \edef\pdfvorigin{\pdfvariable vorigin}
1058 % when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1
1059 % can be set). So we test for \relax and 0 as well as being undefined.
1060 \ifx\pdfoutput\thisisundefined
1061 \else
1062 \ifx\pdfoutput\relax
1063 \else
1064 \ifcase\pdfoutput
1065 \else
1066 \pdftrue
1071 \newif\ifpdforxetex
1072 \pdforxetexfalse
1073 \ifpdf
1074 \pdforxetextrue
1076 \ifx\XeTeXrevision\thisisundefined\else
1077 \pdforxetextrue
1081 % Output page labels information.
1082 % See PDF reference v.1.7 p.594, section 8.3.1.
1083 % Page label ranges must be increasing.
1084 \ifpdf
1085 \def\pagelabels{%
1086 \def\title{0 << /P (T-) /S /D >>}%
1088 % support @contents at very end of document
1089 \ifnum\contentsendcount=\pagecount
1090 \ifnum\arabiccount<\romancount
1091 \pdfcatalog{/PageLabels << /Nums
1092 [\title
1093 \the\arabiccount << /S /D >>
1094 \the\romancount << /S /r >>
1095 ] >> }\relax
1097 % no contents in document
1098 \else\ifnum\contentsendcount=0
1099 \pdfcatalog{/PageLabels << /Nums
1100 [\title
1101 \the\arabiccount << /S /D >>
1102 ] >> }\relax
1103 \else
1104 \pdfcatalog{/PageLabels << /Nums
1105 [\title
1106 \the\romancount << /S /r >>
1107 \the\contentsendcount << /S /D >>
1108 ] >> }\relax
1109 \fi\fi
1111 \else
1112 \let\pagelabels\relax
1115 \newcount\pagecount \pagecount=0
1116 \newcount\romancount \romancount=0
1117 \newcount\arabiccount \arabiccount=0
1118 \newcount\contentsendcount \contentsendcount=0
1120 \ifpdf
1121 \let\ptxadvancepageno\advancepageno
1122 \def\advancepageno{%
1123 \ptxadvancepageno\global\advance\pagecount by 1
1128 % PDF uses PostScript string constants for the names of xref targets,
1129 % for display in the outlines, and in other places. Thus, we have to
1130 % double any backslashes. Otherwise, a name like "\node" will be
1131 % interpreted as a newline (\n), followed by o, d, e. Not good.
1133 % See http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html and
1134 % related messages. The final outcome is that it is up to the TeX user
1135 % to double the backslashes and otherwise make the string valid, so
1136 % that's what we do. pdftex 1.30.0 (ca.2005) introduced a primitive to
1137 % do this reliably, so we use it.
1139 % #1 is a control sequence in which to do the replacements,
1140 % which we \xdef.
1141 \def\txiescapepdf#1{%
1142 \ifx\pdfescapestring\thisisundefined
1143 % No primitive available; should we give a warning or log?
1144 % Many times it won't matter.
1145 \xdef#1{#1}%
1146 \else
1147 % The expandable \pdfescapestring primitive escapes parentheses,
1148 % backslashes, and other special chars.
1149 \xdef#1{\pdfescapestring{#1}}%
1152 \def\txiescapepdfutfsixteen#1{%
1153 \ifx\pdfescapestrutfsixteen\thisisundefined
1154 % No UTF-16 converting macro available.
1155 \txiescapepdf{#1}%
1156 \else
1157 \xdef#1{\pdfescapestrutfsixteen{#1}}%
1161 \newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images
1162 with PDF output, and none of those formats could be found. (.eps cannot
1163 be supported due to the design of the PDF format; use regular TeX (DVI
1164 output) for that.)}
1166 \ifpdf
1168 % Color manipulation macros using ideas from pdfcolor.tex,
1169 % except using rgb instead of cmyk; the latter is said to render as a
1170 % very dark gray on-screen and a very dark halftone in print, instead
1171 % of actual black. The dark red here is dark enough to print on paper as
1172 % nearly black, but still distinguishable for online viewing. We use
1173 % black by default, though.
1174 \def\rgbDarkRed{0.50 0.09 0.12}
1175 \def\rgbBlack{0 0 0}
1177 % rg sets the color for filling (usual text, etc.);
1178 % RG sets the color for stroking (thin rules, e.g., normal _'s).
1179 \def\pdfsetcolor#1{\pdfliteral{#1 rg #1 RG}}
1181 % Set color, and create a mark which defines \thiscolor accordingly,
1182 % so that \makeheadline knows which color to restore.
1183 \def\curcolor{0 0 0}%
1184 \def\setcolor#1{%
1185 \ifx#1\curcolor\else
1186 \xdef\currentcolordefs{\gdef\noexpand\thiscolor{#1}}%
1187 \domark
1188 \pdfsetcolor{#1}%
1189 \xdef\curcolor{#1}%
1193 \let\maincolor\rgbBlack
1194 \pdfsetcolor{\maincolor}
1195 \edef\thiscolor{\maincolor}
1196 \def\currentcolordefs{}
1198 \def\makefootline{%
1199 \baselineskip24pt
1200 \line{\pdfsetcolor{\maincolor}\the\footline}%
1203 \def\makeheadline{%
1204 \vbox to 0pt{%
1205 \vskip-22.5pt
1206 \line{%
1207 \vbox to8.5pt{}%
1208 % Extract \thiscolor definition from the marks.
1209 \getcolormarks
1210 % Typeset the headline with \maincolor, then restore the color.
1211 \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}%
1213 \vss
1215 \nointerlineskip
1219 \pdfcatalog{/PageMode /UseOutlines}
1221 % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto).
1222 \def\dopdfimage#1#2#3{%
1223 \def\pdfimagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}%
1224 \def\pdfimageheight{#3}\setbox2 = \hbox{\ignorespaces #3}%
1226 % pdftex (and the PDF format) support .pdf, .png, .jpg (among
1227 % others). Let's try in that order, PDF first since if
1228 % someone has a scalable image, presumably better to use that than a
1229 % bitmap.
1230 \let\pdfimgext=\empty
1231 \begingroup
1232 \openin 1 #1.pdf \ifeof 1
1233 \openin 1 #1.PDF \ifeof 1
1234 \openin 1 #1.png \ifeof 1
1235 \openin 1 #1.jpg \ifeof 1
1236 \openin 1 #1.jpeg \ifeof 1
1237 \openin 1 #1.JPG \ifeof 1
1238 \errhelp = \nopdfimagehelp
1239 \errmessage{Could not find image file #1 for pdf}%
1240 \else \gdef\pdfimgext{JPG}%
1242 \else \gdef\pdfimgext{jpeg}%
1244 \else \gdef\pdfimgext{jpg}%
1246 \else \gdef\pdfimgext{png}%
1248 \else \gdef\pdfimgext{PDF}%
1250 \else \gdef\pdfimgext{pdf}%
1252 \closein 1
1253 \endgroup
1255 % without \immediate, ancient pdftex seg faults when the same image is
1256 % included twice. (Version 3.14159-pre-1.0-unofficial-20010704.)
1257 \ifnum\pdftexversion < 14
1258 \immediate\pdfimage
1259 \else
1260 \immediate\pdfximage
1262 \ifdim \wd0 >0pt width \pdfimagewidth \fi
1263 \ifdim \wd2 >0pt height \pdfimageheight \fi
1264 \ifnum\pdftexversion<13
1265 #1.\pdfimgext
1266 \else
1267 {#1.\pdfimgext}%
1269 \ifnum\pdftexversion < 14 \else
1270 \pdfrefximage \pdflastximage
1271 \fi}
1273 \def\setpdfdestname#1{{%
1274 % We have to set dummies so commands such as @code, and characters
1275 % such as \, aren't expanded when present in a section title.
1276 \indexnofonts
1277 \makevalueexpandable
1278 \turnoffactive
1279 \iftxiuseunicodedestname
1280 \ifx \declaredencoding \latone
1281 % Pass through Latin-1 characters.
1282 % LuaTeX with byte wise I/O converts Latin-1 characters to Unicode.
1283 \else
1284 \ifx \declaredencoding \utfeight
1285 % Pass through Unicode characters.
1286 \else
1287 % Use ASCII approximations in destination names.
1288 \passthroughcharsfalse
1291 \else
1292 % Use ASCII approximations in destination names.
1293 \passthroughcharsfalse
1295 \def\pdfdestname{#1}%
1296 \txiescapepdf\pdfdestname
1299 \def\setpdfoutlinetext#1{{%
1300 \indexnofonts
1301 \makevalueexpandable
1302 \turnoffactive
1303 \ifx \declaredencoding \latone
1304 % The PDF format can use an extended form of Latin-1 in bookmark
1305 % strings. See Appendix D of the PDF Reference, Sixth Edition, for
1306 % the "PDFDocEncoding".
1307 \passthroughcharstrue
1308 % Pass through Latin-1 characters.
1309 % LuaTeX: Convert to Unicode
1310 % pdfTeX: Use Latin-1 as PDFDocEncoding
1311 \def\pdfoutlinetext{#1}%
1312 \else
1313 \ifx \declaredencoding \utfeight
1314 \ifx\luatexversion\thisisundefined
1315 % For pdfTeX with UTF-8.
1316 % TODO: the PDF format can use UTF-16 in bookmark strings,
1317 % but the code for this isn't done yet.
1318 % Use ASCII approximations.
1319 \passthroughcharsfalse
1320 \def\pdfoutlinetext{#1}%
1321 \else
1322 % For LuaTeX with UTF-8.
1323 % Pass through Unicode characters for title texts.
1324 \passthroughcharstrue
1325 \def\pdfoutlinetext{#1}%
1327 \else
1328 % For non-Latin-1 or non-UTF-8 encodings.
1329 % Use ASCII approximations.
1330 \passthroughcharsfalse
1331 \def\pdfoutlinetext{#1}%
1334 % LuaTeX: Convert to UTF-16
1335 % pdfTeX: Use Latin-1 as PDFDocEncoding
1336 \txiescapepdfutfsixteen\pdfoutlinetext
1339 \def\pdfmkdest#1{%
1340 \setpdfdestname{#1}%
1341 \safewhatsit{\pdfdest name{\pdfdestname} xyz}%
1344 % used to mark target names; must be expandable.
1345 \def\pdfmkpgn#1{#1}
1347 % by default, use black for everything.
1348 \def\urlcolor{\rgbBlack}
1349 \let\linkcolor\rgbBlack
1350 \def\endlink{\setcolor{\maincolor}\pdfendlink}
1352 % Adding outlines to PDF; macros for calculating structure of outlines
1353 % come from Petr Olsak
1354 \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0%
1355 \else \csname#1\endcsname \fi}
1356 \def\advancenumber#1{\tempnum=\expnumber{#1}\relax
1357 \advance\tempnum by 1
1358 \expandafter\xdef\csname#1\endcsname{\the\tempnum}}
1360 % #1 is the section text, which is what will be displayed in the
1361 % outline by the pdf viewer. #2 is the pdf expression for the number
1362 % of subentries (or empty, for subsubsections). #3 is the node text,
1363 % which might be empty if this toc entry had no corresponding node.
1364 % #4 is the page number
1366 \def\dopdfoutline#1#2#3#4{%
1367 % Generate a link to the node text if that exists; else, use the
1368 % page number. We could generate a destination for the section
1369 % text in the case where a section has no node, but it doesn't
1370 % seem worth the trouble, since most documents are normally structured.
1371 \setpdfoutlinetext{#1}
1372 \setpdfdestname{#3}
1373 \ifx\pdfdestname\empty
1374 \def\pdfdestname{#4}%
1377 \pdfoutline goto name{\pdfmkpgn{\pdfdestname}}#2{\pdfoutlinetext}%
1380 \def\pdfmakeoutlines{%
1381 \begingroup
1382 % Read toc silently, to get counts of subentries for \pdfoutline.
1383 \def\partentry##1##2##3##4{}% ignore parts in the outlines
1384 \def\numchapentry##1##2##3##4{%
1385 \def\thischapnum{##2}%
1386 \def\thissecnum{0}%
1387 \def\thissubsecnum{0}%
1389 \def\numsecentry##1##2##3##4{%
1390 \advancenumber{chap\thischapnum}%
1391 \def\thissecnum{##2}%
1392 \def\thissubsecnum{0}%
1394 \def\numsubsecentry##1##2##3##4{%
1395 \advancenumber{sec\thissecnum}%
1396 \def\thissubsecnum{##2}%
1398 \def\numsubsubsecentry##1##2##3##4{%
1399 \advancenumber{subsec\thissubsecnum}%
1401 \def\thischapnum{0}%
1402 \def\thissecnum{0}%
1403 \def\thissubsecnum{0}%
1405 % use \def rather than \let here because we redefine \chapentry et
1406 % al. a second time, below.
1407 \def\appentry{\numchapentry}%
1408 \def\appsecentry{\numsecentry}%
1409 \def\appsubsecentry{\numsubsecentry}%
1410 \def\appsubsubsecentry{\numsubsubsecentry}%
1411 \def\unnchapentry{\numchapentry}%
1412 \def\unnsecentry{\numsecentry}%
1413 \def\unnsubsecentry{\numsubsecentry}%
1414 \def\unnsubsubsecentry{\numsubsubsecentry}%
1415 \readdatafile{toc}%
1417 % Read toc second time, this time actually producing the outlines.
1418 % The `-' means take the \expnumber as the absolute number of
1419 % subentries, which we calculated on our first read of the .toc above.
1421 % We use the node names as the destinations.
1423 % Currently we prefix the section name with the section number
1424 % for chapter and appendix headings only in order to avoid too much
1425 % horizontal space being required in the PDF viewer.
1426 \def\numchapentry##1##2##3##4{%
1427 \dopdfoutline{##2 ##1}{count-\expnumber{chap##2}}{##3}{##4}}%
1428 \def\unnchapentry##1##2##3##4{%
1429 \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}%
1430 \def\numsecentry##1##2##3##4{%
1431 \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}%
1432 \def\numsubsecentry##1##2##3##4{%
1433 \dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}%
1434 \def\numsubsubsecentry##1##2##3##4{% count is always zero
1435 \dopdfoutline{##1}{}{##3}{##4}}%
1437 % PDF outlines are displayed using system fonts, instead of
1438 % document fonts. Therefore we cannot use special characters,
1439 % since the encoding is unknown. For example, the eogonek from
1440 % Latin 2 (0xea) gets translated to a | character. Info from
1441 % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100.
1443 % TODO this right, we have to translate 8-bit characters to
1444 % their "best" equivalent, based on the @documentencoding. Too
1445 % much work for too little return. Just use the ASCII equivalents
1446 % we use for the index sort strings.
1448 \indexnofonts
1449 \setupdatafile
1450 % We can have normal brace characters in the PDF outlines, unlike
1451 % Texinfo index files. So set that up.
1452 \def\{{\lbracecharliteral}%
1453 \def\}{\rbracecharliteral}%
1454 \catcode`\\=\active \otherbackslash
1455 \input \tocreadfilename
1456 \endgroup
1458 {\catcode`[=1 \catcode`]=2
1459 \catcode`{=\other \catcode`}=\other
1460 \gdef\lbracecharliteral[{]%
1461 \gdef\rbracecharliteral[}]%
1464 \def\skipspaces#1{\def\PP{#1}\def\D{|}%
1465 \ifx\PP\D\let\nextsp\relax
1466 \else\let\nextsp\skipspaces
1467 \addtokens{\filename}{\PP}%
1468 \advance\filenamelength by 1
1470 \nextsp}
1471 \def\getfilename#1{%
1472 \filenamelength=0
1473 % If we don't expand the argument now, \skipspaces will get
1474 % snagged on things like "@value{foo}".
1475 \edef\temp{#1}%
1476 \expandafter\skipspaces\temp|\relax
1478 \ifnum\pdftexversion < 14
1479 \let \startlink \pdfannotlink
1480 \else
1481 \let \startlink \pdfstartlink
1483 % make a live url in pdf output.
1484 \def\pdfurl#1{%
1485 \begingroup
1486 % it seems we really need yet another set of dummies; have not
1487 % tried to figure out what each command should do in the context
1488 % of @url. for now, just make @/ a no-op, that's the only one
1489 % people have actually reported a problem with.
1491 \normalturnoffactive
1492 \def\@{@}%
1493 \let\/=\empty
1494 \makevalueexpandable
1495 % do we want to go so far as to use \indexnofonts instead of just
1496 % special-casing \var here?
1497 \def\var##1{##1}%
1499 \leavevmode\setcolor{\urlcolor}%
1500 \startlink attr{/Border [0 0 0]}%
1501 user{/Subtype /Link /A << /S /URI /URI (#1) >>}%
1502 \endgroup}
1503 % \pdfgettoks - Surround page numbers in #1 with @pdflink. #1 may
1504 % be a simple number, or a list of numbers in the case of an index
1505 % entry.
1506 \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}}
1507 \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
1508 \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks}
1509 \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}}
1510 \def\maketoks{%
1511 \expandafter\poptoks\the\toksA|ENDTOKS|\relax
1512 \ifx\first0\adn0
1513 \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3
1514 \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6
1515 \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9
1516 \else
1517 \ifnum0=\countA\else\makelink\fi
1518 \ifx\first.\let\next=\done\else
1519 \let\next=\maketoks
1520 \addtokens{\toksB}{\the\toksD}
1521 \ifx\first,\addtokens{\toksB}{\space}\fi
1523 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
1524 \next}
1525 \def\makelink{\addtokens{\toksB}%
1526 {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0}
1527 \def\pdflink#1{\pdflinkpage{#1}{#1}}%
1528 \def\pdflinkpage#1#2{%
1529 \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}}
1530 \setcolor{\linkcolor}#2\endlink}
1531 \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
1532 \else
1533 % non-pdf mode
1534 \let\pdfmkdest = \gobble
1535 \let\pdfurl = \gobble
1536 \let\endlink = \relax
1537 \let\setcolor = \gobble
1538 \let\pdfsetcolor = \gobble
1539 \let\pdfmakeoutlines = \relax
1540 \fi % \ifx\pdfoutput
1543 % For XeTeX
1545 \ifx\XeTeXrevision\thisisundefined
1546 \else
1548 % XeTeX version check
1550 \ifnum\strcmp{\the\XeTeXversion\XeTeXrevision}{0.99996}>-1
1551 % TeX Live 2016 contains XeTeX 0.99996 and xdvipdfmx 20160307.
1552 % It can use the `dvipdfmx:config' special (from TeX Live SVN r40941).
1553 % For avoiding PDF destination name replacement, we use this special
1554 % instead of xdvipdfmx's command line option `-C 0x0010'.
1555 \special{dvipdfmx:config C 0x0010}
1556 % XeTeX 0.99995+ comes with xdvipdfmx 20160307+.
1557 % It can handle Unicode destination names for PDF.
1558 \txiuseunicodedestnametrue
1559 \else
1560 % XeTeX < 0.99996 (TeX Live < 2016) cannot use the
1561 % `dvipdfmx:config' special.
1562 % So for avoiding PDF destination name replacement,
1563 % xdvipdfmx's command line option `-C 0x0010' is necessary.
1565 % XeTeX < 0.99995 can not handle Unicode destination names for PDF
1566 % because xdvipdfmx 20150315 has a UTF-16 conversion issue.
1567 % It is fixed by xdvipdfmx 20160106 (TeX Live SVN r39753).
1568 \txiuseunicodedestnamefalse
1571 % Color support
1573 \def\rgbDarkRed{0.50 0.09 0.12}
1574 \def\rgbBlack{0 0 0}
1576 \def\pdfsetcolor#1{\special{pdf:scolor [#1]}}
1578 % Set color, and create a mark which defines \thiscolor accordingly,
1579 % so that \makeheadline knows which color to restore.
1580 \def\setcolor#1{%
1581 \xdef\currentcolordefs{\gdef\noexpand\thiscolor{#1}}%
1582 \domark
1583 \pdfsetcolor{#1}%
1586 \def\maincolor{\rgbBlack}
1587 \pdfsetcolor{\maincolor}
1588 \edef\thiscolor{\maincolor}
1589 \def\currentcolordefs{}
1591 \def\makefootline{%
1592 \baselineskip24pt
1593 \line{\pdfsetcolor{\maincolor}\the\footline}%
1596 \def\makeheadline{%
1597 \vbox to 0pt{%
1598 \vskip-22.5pt
1599 \line{%
1600 \vbox to8.5pt{}%
1601 % Extract \thiscolor definition from the marks.
1602 \getcolormarks
1603 % Typeset the headline with \maincolor, then restore the color.
1604 \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}%
1606 \vss
1608 \nointerlineskip
1611 % PDF outline support
1613 % Emulate pdfTeX primitive
1614 \def\pdfdest name#1 xyz{%
1615 \special{pdf:dest (#1) [@thispage /XYZ @xpos @ypos null]}%
1618 \def\setpdfdestname#1{{%
1619 % We have to set dummies so commands such as @code, and characters
1620 % such as \, aren't expanded when present in a section title.
1621 \indexnofonts
1622 \makevalueexpandable
1623 \turnoffactive
1624 \iftxiuseunicodedestname
1625 % Pass through Unicode characters.
1626 \else
1627 % Use ASCII approximations in destination names.
1628 \passthroughcharsfalse
1630 \def\pdfdestname{#1}%
1631 \txiescapepdf\pdfdestname
1634 \def\setpdfoutlinetext#1{{%
1635 \turnoffactive
1636 % Always use Unicode characters in title texts.
1637 \def\pdfoutlinetext{#1}%
1638 % For XeTeX, xdvipdfmx converts to UTF-16.
1639 % So we do not convert.
1640 \txiescapepdf\pdfoutlinetext
1643 \def\pdfmkdest#1{%
1644 \setpdfdestname{#1}%
1645 \safewhatsit{\pdfdest name{\pdfdestname} xyz}%
1648 % by default, use black for everything.
1649 \def\urlcolor{\rgbBlack}
1650 \def\linkcolor{\rgbBlack}
1651 \def\endlink{\setcolor{\maincolor}\pdfendlink}
1653 \def\dopdfoutline#1#2#3#4{%
1654 \setpdfoutlinetext{#1}
1655 \setpdfdestname{#3}
1656 \ifx\pdfdestname\empty
1657 \def\pdfdestname{#4}%
1660 \special{pdf:out [-] #2 << /Title (\pdfoutlinetext) /A
1661 << /S /GoTo /D (\pdfdestname) >> >> }%
1664 \def\pdfmakeoutlines{%
1665 \begingroup
1667 % For XeTeX, counts of subentries are not necessary.
1668 % Therefore, we read toc only once.
1670 % We use node names as destinations.
1672 % Currently we prefix the section name with the section number
1673 % for chapter and appendix headings only in order to avoid too much
1674 % horizontal space being required in the PDF viewer.
1675 \def\partentry##1##2##3##4{}% ignore parts in the outlines
1676 \def\numchapentry##1##2##3##4{%
1677 \dopdfoutline{##2 ##1}{1}{##3}{##4}}%
1678 \def\numsecentry##1##2##3##4{%
1679 \dopdfoutline{##1}{2}{##3}{##4}}%
1680 \def\numsubsecentry##1##2##3##4{%
1681 \dopdfoutline{##1}{3}{##3}{##4}}%
1682 \def\numsubsubsecentry##1##2##3##4{%
1683 \dopdfoutline{##1}{4}{##3}{##4}}%
1685 \let\appentry\numchapentry%
1686 \let\appsecentry\numsecentry%
1687 \let\appsubsecentry\numsubsecentry%
1688 \let\appsubsubsecentry\numsubsubsecentry%
1689 \def\unnchapentry##1##2##3##4{%
1690 \dopdfoutline{##1}{1}{##3}{##4}}%
1691 \let\unnsecentry\numsecentry%
1692 \let\unnsubsecentry\numsubsecentry%
1693 \let\unnsubsubsecentry\numsubsubsecentry%
1695 % For XeTeX, xdvipdfmx converts strings to UTF-16.
1696 % Therefore, the encoding and the language may not be considered.
1698 \indexnofonts
1699 \setupdatafile
1700 % We can have normal brace characters in the PDF outlines, unlike
1701 % Texinfo index files. So set that up.
1702 \def\{{\lbracecharliteral}%
1703 \def\}{\rbracecharliteral}%
1704 \catcode`\\=\active \otherbackslash
1705 \input \tocreadfilename
1706 \endgroup
1708 {\catcode`[=1 \catcode`]=2
1709 \catcode`{=\other \catcode`}=\other
1710 \gdef\lbracecharliteral[{]%
1711 \gdef\rbracecharliteral[}]%
1714 \special{pdf:docview << /PageMode /UseOutlines >> }
1715 % ``\special{pdf:tounicode ...}'' is not necessary
1716 % because xdvipdfmx converts strings from UTF-8 to UTF-16 without it.
1717 % However, due to a UTF-16 conversion issue of xdvipdfmx 20150315,
1718 % ``\special{pdf:dest ...}'' cannot handle non-ASCII strings.
1719 % It is fixed by xdvipdfmx 20160106 (TeX Live SVN r39753).
1721 \def\skipspaces#1{\def\PP{#1}\def\D{|}%
1722 \ifx\PP\D\let\nextsp\relax
1723 \else\let\nextsp\skipspaces
1724 \addtokens{\filename}{\PP}%
1725 \advance\filenamelength by 1
1727 \nextsp}
1728 \def\getfilename#1{%
1729 \filenamelength=0
1730 % If we don't expand the argument now, \skipspaces will get
1731 % snagged on things like "@value{foo}".
1732 \edef\temp{#1}%
1733 \expandafter\skipspaces\temp|\relax
1735 % make a live url in pdf output.
1736 \def\pdfurl#1{%
1737 \begingroup
1738 % it seems we really need yet another set of dummies; have not
1739 % tried to figure out what each command should do in the context
1740 % of @url. for now, just make @/ a no-op, that's the only one
1741 % people have actually reported a problem with.
1743 \normalturnoffactive
1744 \def\@{@}%
1745 \let\/=\empty
1746 \makevalueexpandable
1747 % do we want to go so far as to use \indexnofonts instead of just
1748 % special-casing \var here?
1749 \def\var##1{##1}%
1751 \leavevmode\setcolor{\urlcolor}%
1752 \special{pdf:bann << /Border [0 0 0]
1753 /Subtype /Link /A << /S /URI /URI (#1) >> >>}%
1754 \endgroup}
1755 \def\endlink{\setcolor{\maincolor}\special{pdf:eann}}
1756 \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}}
1757 \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
1758 \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks}
1759 \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}}
1760 \def\maketoks{%
1761 \expandafter\poptoks\the\toksA|ENDTOKS|\relax
1762 \ifx\first0\adn0
1763 \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3
1764 \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6
1765 \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9
1766 \else
1767 \ifnum0=\countA\else\makelink\fi
1768 \ifx\first.\let\next=\done\else
1769 \let\next=\maketoks
1770 \addtokens{\toksB}{\the\toksD}
1771 \ifx\first,\addtokens{\toksB}{\space}\fi
1773 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
1774 \next}
1775 \def\makelink{\addtokens{\toksB}%
1776 {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0}
1777 \def\pdflink#1{\pdflinkpage{#1}{#1}}%
1778 \def\pdflinkpage#1#2{%
1779 \special{pdf:bann << /Border [0 0 0]
1780 /Type /Annot /Subtype /Link /A << /S /GoTo /D (#1) >> >>}%
1781 \setcolor{\linkcolor}#2\endlink}
1782 \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
1785 % @image support
1787 % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto).
1788 \def\doxeteximage#1#2#3{%
1789 \def\xeteximagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}%
1790 \def\xeteximageheight{#3}\setbox2 = \hbox{\ignorespaces #3}%
1792 % XeTeX (and the PDF format) supports .pdf, .png, .jpg (among
1793 % others). Let's try in that order, PDF first since if
1794 % someone has a scalable image, presumably better to use that than a
1795 % bitmap.
1796 \let\xeteximgext=\empty
1797 \begingroup
1798 \openin 1 #1.pdf \ifeof 1
1799 \openin 1 #1.PDF \ifeof 1
1800 \openin 1 #1.png \ifeof 1
1801 \openin 1 #1.jpg \ifeof 1
1802 \openin 1 #1.jpeg \ifeof 1
1803 \openin 1 #1.JPG \ifeof 1
1804 \errmessage{Could not find image file #1 for XeTeX}%
1805 \else \gdef\xeteximgext{JPG}%
1807 \else \gdef\xeteximgext{jpeg}%
1809 \else \gdef\xeteximgext{jpg}%
1811 \else \gdef\xeteximgext{png}%
1813 \else \gdef\xeteximgext{PDF}%
1815 \else \gdef\xeteximgext{pdf}%
1817 \closein 1
1818 \endgroup
1820 % Putting an \hbox around the image can prevent an over-long line
1821 % after the image.
1822 \hbox\bgroup
1823 \def\xetexpdfext{pdf}%
1824 \ifx\xeteximgext\xetexpdfext
1825 \XeTeXpdffile "#1".\xeteximgext ""
1826 \else
1827 \def\xetexpdfext{PDF}%
1828 \ifx\xeteximgext\xetexpdfext
1829 \XeTeXpdffile "#1".\xeteximgext ""
1830 \else
1831 \XeTeXpicfile "#1".\xeteximgext ""
1834 \ifdim \wd0 >0pt width \xeteximagewidth \fi
1835 \ifdim \wd2 >0pt height \xeteximageheight \fi \relax
1836 \egroup
1842 \message{fonts,}
1844 % Set the baselineskip to #1, and the lineskip and strut size
1845 % correspondingly. There is no deep meaning behind these magic numbers
1846 % used as factors; they just match (closely enough) what Knuth defined.
1848 \def\lineskipfactor{.08333}
1849 \def\strutheightpercent{.70833}
1850 \def\strutdepthpercent {.29167}
1852 % can get a sort of poor man's double spacing by redefining this.
1853 \def\baselinefactor{1}
1855 \newdimen\textleading
1856 \def\setleading#1{%
1857 \dimen0 = #1\relax
1858 \normalbaselineskip = \baselinefactor\dimen0
1859 \normallineskip = \lineskipfactor\normalbaselineskip
1860 \normalbaselines
1861 \setbox\strutbox =\hbox{%
1862 \vrule width0pt height\strutheightpercent\baselineskip
1863 depth \strutdepthpercent \baselineskip
1867 % PDF CMaps. See also LaTeX's t1.cmap.
1869 % do nothing with this by default.
1870 \expandafter\let\csname cmapOT1\endcsname\gobble
1871 \expandafter\let\csname cmapOT1IT\endcsname\gobble
1872 \expandafter\let\csname cmapOT1TT\endcsname\gobble
1874 % if we are producing pdf, and we have \pdffontattr, then define cmaps.
1875 % (\pdffontattr was introduced many years ago, but people still run
1876 % older pdftex's; it's easy to conditionalize, so we do.)
1877 \ifpdf \ifx\pdffontattr\thisisundefined \else
1878 \begingroup
1879 \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
1880 \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
1881 %%DocumentNeededResources: ProcSet (CIDInit)
1882 %%IncludeResource: ProcSet (CIDInit)
1883 %%BeginResource: CMap (TeX-OT1-0)
1884 %%Title: (TeX-OT1-0 TeX OT1 0)
1885 %%Version: 1.000
1886 %%EndComments
1887 /CIDInit /ProcSet findresource begin
1888 12 dict begin
1889 begincmap
1890 /CIDSystemInfo
1891 << /Registry (TeX)
1892 /Ordering (OT1)
1893 /Supplement 0
1894 >> def
1895 /CMapName /TeX-OT1-0 def
1896 /CMapType 2 def
1897 1 begincodespacerange
1898 <00> <7F>
1899 endcodespacerange
1900 8 beginbfrange
1901 <00> <01> <0393>
1902 <09> <0A> <03A8>
1903 <23> <26> <0023>
1904 <28> <3B> <0028>
1905 <3F> <5B> <003F>
1906 <5D> <5E> <005D>
1907 <61> <7A> <0061>
1908 <7B> <7C> <2013>
1909 endbfrange
1910 40 beginbfchar
1911 <02> <0398>
1912 <03> <039B>
1913 <04> <039E>
1914 <05> <03A0>
1915 <06> <03A3>
1916 <07> <03D2>
1917 <08> <03A6>
1918 <0B> <00660066>
1919 <0C> <00660069>
1920 <0D> <0066006C>
1921 <0E> <006600660069>
1922 <0F> <00660066006C>
1923 <10> <0131>
1924 <11> <0237>
1925 <12> <0060>
1926 <13> <00B4>
1927 <14> <02C7>
1928 <15> <02D8>
1929 <16> <00AF>
1930 <17> <02DA>
1931 <18> <00B8>
1932 <19> <00DF>
1933 <1A> <00E6>
1934 <1B> <0153>
1935 <1C> <00F8>
1936 <1D> <00C6>
1937 <1E> <0152>
1938 <1F> <00D8>
1939 <21> <0021>
1940 <22> <201D>
1941 <27> <2019>
1942 <3C> <00A1>
1943 <3D> <003D>
1944 <3E> <00BF>
1945 <5C> <201C>
1946 <5F> <02D9>
1947 <60> <2018>
1948 <7D> <02DD>
1949 <7E> <007E>
1950 <7F> <00A8>
1951 endbfchar
1952 endcmap
1953 CMapName currentdict /CMap defineresource pop
1956 %%EndResource
1957 %%EOF
1958 }\endgroup
1959 \expandafter\edef\csname cmapOT1\endcsname#1{%
1960 \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
1963 % \cmapOT1IT
1964 \begingroup
1965 \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
1966 \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
1967 %%DocumentNeededResources: ProcSet (CIDInit)
1968 %%IncludeResource: ProcSet (CIDInit)
1969 %%BeginResource: CMap (TeX-OT1IT-0)
1970 %%Title: (TeX-OT1IT-0 TeX OT1IT 0)
1971 %%Version: 1.000
1972 %%EndComments
1973 /CIDInit /ProcSet findresource begin
1974 12 dict begin
1975 begincmap
1976 /CIDSystemInfo
1977 << /Registry (TeX)
1978 /Ordering (OT1IT)
1979 /Supplement 0
1980 >> def
1981 /CMapName /TeX-OT1IT-0 def
1982 /CMapType 2 def
1983 1 begincodespacerange
1984 <00> <7F>
1985 endcodespacerange
1986 8 beginbfrange
1987 <00> <01> <0393>
1988 <09> <0A> <03A8>
1989 <25> <26> <0025>
1990 <28> <3B> <0028>
1991 <3F> <5B> <003F>
1992 <5D> <5E> <005D>
1993 <61> <7A> <0061>
1994 <7B> <7C> <2013>
1995 endbfrange
1996 42 beginbfchar
1997 <02> <0398>
1998 <03> <039B>
1999 <04> <039E>
2000 <05> <03A0>
2001 <06> <03A3>
2002 <07> <03D2>
2003 <08> <03A6>
2004 <0B> <00660066>
2005 <0C> <00660069>
2006 <0D> <0066006C>
2007 <0E> <006600660069>
2008 <0F> <00660066006C>
2009 <10> <0131>
2010 <11> <0237>
2011 <12> <0060>
2012 <13> <00B4>
2013 <14> <02C7>
2014 <15> <02D8>
2015 <16> <00AF>
2016 <17> <02DA>
2017 <18> <00B8>
2018 <19> <00DF>
2019 <1A> <00E6>
2020 <1B> <0153>
2021 <1C> <00F8>
2022 <1D> <00C6>
2023 <1E> <0152>
2024 <1F> <00D8>
2025 <21> <0021>
2026 <22> <201D>
2027 <23> <0023>
2028 <24> <00A3>
2029 <27> <2019>
2030 <3C> <00A1>
2031 <3D> <003D>
2032 <3E> <00BF>
2033 <5C> <201C>
2034 <5F> <02D9>
2035 <60> <2018>
2036 <7D> <02DD>
2037 <7E> <007E>
2038 <7F> <00A8>
2039 endbfchar
2040 endcmap
2041 CMapName currentdict /CMap defineresource pop
2044 %%EndResource
2045 %%EOF
2046 }\endgroup
2047 \expandafter\edef\csname cmapOT1IT\endcsname#1{%
2048 \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
2051 % \cmapOT1TT
2052 \begingroup
2053 \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
2054 \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
2055 %%DocumentNeededResources: ProcSet (CIDInit)
2056 %%IncludeResource: ProcSet (CIDInit)
2057 %%BeginResource: CMap (TeX-OT1TT-0)
2058 %%Title: (TeX-OT1TT-0 TeX OT1TT 0)
2059 %%Version: 1.000
2060 %%EndComments
2061 /CIDInit /ProcSet findresource begin
2062 12 dict begin
2063 begincmap
2064 /CIDSystemInfo
2065 << /Registry (TeX)
2066 /Ordering (OT1TT)
2067 /Supplement 0
2068 >> def
2069 /CMapName /TeX-OT1TT-0 def
2070 /CMapType 2 def
2071 1 begincodespacerange
2072 <00> <7F>
2073 endcodespacerange
2074 5 beginbfrange
2075 <00> <01> <0393>
2076 <09> <0A> <03A8>
2077 <21> <26> <0021>
2078 <28> <5F> <0028>
2079 <61> <7E> <0061>
2080 endbfrange
2081 32 beginbfchar
2082 <02> <0398>
2083 <03> <039B>
2084 <04> <039E>
2085 <05> <03A0>
2086 <06> <03A3>
2087 <07> <03D2>
2088 <08> <03A6>
2089 <0B> <2191>
2090 <0C> <2193>
2091 <0D> <0027>
2092 <0E> <00A1>
2093 <0F> <00BF>
2094 <10> <0131>
2095 <11> <0237>
2096 <12> <0060>
2097 <13> <00B4>
2098 <14> <02C7>
2099 <15> <02D8>
2100 <16> <00AF>
2101 <17> <02DA>
2102 <18> <00B8>
2103 <19> <00DF>
2104 <1A> <00E6>
2105 <1B> <0153>
2106 <1C> <00F8>
2107 <1D> <00C6>
2108 <1E> <0152>
2109 <1F> <00D8>
2110 <20> <2423>
2111 <27> <2019>
2112 <60> <2018>
2113 <7F> <00A8>
2114 endbfchar
2115 endcmap
2116 CMapName currentdict /CMap defineresource pop
2119 %%EndResource
2120 %%EOF
2121 }\endgroup
2122 \expandafter\edef\csname cmapOT1TT\endcsname#1{%
2123 \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
2125 \fi\fi
2127 % This is what gets called when #5 of \setfont is empty.
2128 \let\cmap\gobble
2130 % (end of cmaps)
2133 % Set the font macro #1 to the font named \fontprefix#2.
2134 % #3 is the font's design size, #4 is a scale factor, #5 is the CMap
2135 % encoding (only OT1, OT1IT and OT1TT are allowed, or empty to omit).
2136 % Example:
2137 % #1 = \textrm
2138 % #2 = \rmshape
2139 % #3 = 10
2140 % #4 = \mainmagstep
2141 % #5 = OT1
2143 \def\setfont#1#2#3#4#5{%
2144 \font#1=\fontprefix#2#3 scaled #4
2145 \csname cmap#5\endcsname#1%
2146 \ifx#2\ttshape\hyphenchar#1=-1 \fi
2147 \ifx#2\ttbshape\hyphenchar#1=-1 \fi
2148 \ifx#2\ttslshape\hyphenchar#1=-1 \fi
2151 % Use cm as the default font prefix.
2152 % To specify the font prefix, you must define \fontprefix
2153 % before you read in texinfo.tex.
2154 \ifx\fontprefix\thisisundefined
2155 \def\fontprefix{cm}
2157 % Support font families that don't use the same naming scheme as CM.
2158 \def\rmshape{r}
2159 \def\rmbshape{bx} % where the normal face is bold
2160 \def\bfshape{b}
2161 \def\bxshape{bx}
2162 \def\ttshape{tt}
2163 \def\ttbshape{tt}
2164 \def\ttslshape{sltt}
2165 \def\itshape{ti}
2166 \def\itbshape{bxti}
2167 \def\slshape{sl}
2168 \def\slbshape{bxsl}
2169 \def\sfshape{ss}
2170 \def\sfbshape{ss}
2171 \def\scshape{csc}
2172 \def\scbshape{csc}
2174 % Definitions for a main text size of 11pt. (The default in Texinfo.)
2176 \def\definetextfontsizexi{%
2177 % Text fonts (11.2pt, magstep1).
2178 \def\textnominalsize{11pt}
2179 \edef\mainmagstep{\magstephalf}
2180 \setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
2181 \setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
2182 \setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
2183 \setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
2184 \setfont\textsl\slshape{10}{\mainmagstep}{OT1}
2185 \setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
2186 \setfont\textsc\scshape{10}{\mainmagstep}{OT1}
2187 \setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
2188 \font\texti=cmmi10 scaled \mainmagstep
2189 \font\textsy=cmsy10 scaled \mainmagstep
2190 \def\textecsize{1095}
2192 % A few fonts for @defun names and args.
2193 \setfont\defbf\bfshape{10}{\magstep1}{OT1}
2194 \setfont\deftt\ttshape{10}{\magstep1}{OT1TT}
2195 \setfont\defsl\slshape{10}{\magstep1}{OT1}
2196 \setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT}
2197 \def\df{\let\ttfont=\deftt \let\bffont = \defbf
2198 \let\ttslfont=\defttsl \let\slfont=\defsl \bf}
2200 % Fonts for indices, footnotes, small examples (9pt).
2201 \def\smallnominalsize{9pt}
2202 \setfont\smallrm\rmshape{9}{1000}{OT1}
2203 \setfont\smalltt\ttshape{9}{1000}{OT1TT}
2204 \setfont\smallbf\bfshape{10}{900}{OT1}
2205 \setfont\smallit\itshape{9}{1000}{OT1IT}
2206 \setfont\smallsl\slshape{9}{1000}{OT1}
2207 \setfont\smallsf\sfshape{9}{1000}{OT1}
2208 \setfont\smallsc\scshape{10}{900}{OT1}
2209 \setfont\smallttsl\ttslshape{10}{900}{OT1TT}
2210 \font\smalli=cmmi9
2211 \font\smallsy=cmsy9
2212 \def\smallecsize{0900}
2214 % Fonts for small examples (8pt).
2215 \def\smallernominalsize{8pt}
2216 \setfont\smallerrm\rmshape{8}{1000}{OT1}
2217 \setfont\smallertt\ttshape{8}{1000}{OT1TT}
2218 \setfont\smallerbf\bfshape{10}{800}{OT1}
2219 \setfont\smallerit\itshape{8}{1000}{OT1IT}
2220 \setfont\smallersl\slshape{8}{1000}{OT1}
2221 \setfont\smallersf\sfshape{8}{1000}{OT1}
2222 \setfont\smallersc\scshape{10}{800}{OT1}
2223 \setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
2224 \font\smalleri=cmmi8
2225 \font\smallersy=cmsy8
2226 \def\smallerecsize{0800}
2228 % Fonts for math mode superscripts (7pt).
2229 \def\sevennominalsize{7pt}
2230 \setfont\sevenrm\rmshape{7}{1000}{OT1}
2231 \setfont\seventt\ttshape{10}{700}{OT1TT}
2232 \setfont\sevenbf\bfshape{10}{700}{OT1}
2233 \setfont\sevenit\itshape{7}{1000}{OT1IT}
2234 \setfont\sevensl\slshape{10}{700}{OT1}
2235 \setfont\sevensf\sfshape{10}{700}{OT1}
2236 \setfont\sevensc\scshape{10}{700}{OT1}
2237 \setfont\seventtsl\ttslshape{10}{700}{OT1TT}
2238 \font\seveni=cmmi7
2239 \font\sevensy=cmsy7
2240 \def\sevenecsize{0700}
2242 % Fonts for title page (20.4pt):
2243 \def\titlenominalsize{20pt}
2244 \setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
2245 \setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
2246 \setfont\titlesl\slbshape{10}{\magstep4}{OT1}
2247 \setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
2248 \setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
2249 \setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
2250 \let\titlebf=\titlerm
2251 \setfont\titlesc\scbshape{10}{\magstep4}{OT1}
2252 \font\titlei=cmmi12 scaled \magstep3
2253 \font\titlesy=cmsy10 scaled \magstep4
2254 \def\titleecsize{2074}
2256 % Chapter (and unnumbered) fonts (17.28pt).
2257 \def\chapnominalsize{17pt}
2258 \setfont\chaprm\rmbshape{12}{\magstep2}{OT1}
2259 \setfont\chapit\itbshape{10}{\magstep3}{OT1IT}
2260 \setfont\chapsl\slbshape{10}{\magstep3}{OT1}
2261 \setfont\chaptt\ttbshape{12}{\magstep2}{OT1TT}
2262 \setfont\chapttsl\ttslshape{10}{\magstep3}{OT1TT}
2263 \setfont\chapsf\sfbshape{17}{1000}{OT1}
2264 \let\chapbf=\chaprm
2265 \setfont\chapsc\scbshape{10}{\magstep3}{OT1}
2266 \font\chapi=cmmi12 scaled \magstep2
2267 \font\chapsy=cmsy10 scaled \magstep3
2268 \def\chapecsize{1728}
2270 % Section fonts (14.4pt).
2271 \def\secnominalsize{14pt}
2272 \setfont\secrm\rmbshape{12}{\magstep1}{OT1}
2273 \setfont\secrmnotbold\rmshape{12}{\magstep1}{OT1}
2274 \setfont\secit\itbshape{10}{\magstep2}{OT1IT}
2275 \setfont\secsl\slbshape{10}{\magstep2}{OT1}
2276 \setfont\sectt\ttbshape{12}{\magstep1}{OT1TT}
2277 \setfont\secttsl\ttslshape{10}{\magstep2}{OT1TT}
2278 \setfont\secsf\sfbshape{12}{\magstep1}{OT1}
2279 \let\secbf\secrm
2280 \setfont\secsc\scbshape{10}{\magstep2}{OT1}
2281 \font\seci=cmmi12 scaled \magstep1
2282 \font\secsy=cmsy10 scaled \magstep2
2283 \def\sececsize{1440}
2285 % Subsection fonts (13.15pt).
2286 \def\ssecnominalsize{13pt}
2287 \setfont\ssecrm\rmbshape{12}{\magstephalf}{OT1}
2288 \setfont\ssecit\itbshape{10}{1315}{OT1IT}
2289 \setfont\ssecsl\slbshape{10}{1315}{OT1}
2290 \setfont\ssectt\ttbshape{12}{\magstephalf}{OT1TT}
2291 \setfont\ssecttsl\ttslshape{10}{1315}{OT1TT}
2292 \setfont\ssecsf\sfbshape{12}{\magstephalf}{OT1}
2293 \let\ssecbf\ssecrm
2294 \setfont\ssecsc\scbshape{10}{1315}{OT1}
2295 \font\sseci=cmmi12 scaled \magstephalf
2296 \font\ssecsy=cmsy10 scaled 1315
2297 \def\ssececsize{1200}
2299 % Reduced fonts for @acronym in text (10pt).
2300 \def\reducednominalsize{10pt}
2301 \setfont\reducedrm\rmshape{10}{1000}{OT1}
2302 \setfont\reducedtt\ttshape{10}{1000}{OT1TT}
2303 \setfont\reducedbf\bfshape{10}{1000}{OT1}
2304 \setfont\reducedit\itshape{10}{1000}{OT1IT}
2305 \setfont\reducedsl\slshape{10}{1000}{OT1}
2306 \setfont\reducedsf\sfshape{10}{1000}{OT1}
2307 \setfont\reducedsc\scshape{10}{1000}{OT1}
2308 \setfont\reducedttsl\ttslshape{10}{1000}{OT1TT}
2309 \font\reducedi=cmmi10
2310 \font\reducedsy=cmsy10
2311 \def\reducedecsize{1000}
2313 \textleading = 13.2pt % line spacing for 11pt CM
2314 \textfonts % reset the current fonts
2316 } % end of 11pt text font size definitions, \definetextfontsizexi
2319 % Definitions to make the main text be 10pt Computer Modern, with
2320 % section, chapter, etc., sizes following suit. This is for the GNU
2321 % Press printing of the Emacs 22 manual. Maybe other manuals in the
2322 % future. Used with @smallbook, which sets the leading to 12pt.
2324 \def\definetextfontsizex{%
2325 % Text fonts (10pt).
2326 \def\textnominalsize{10pt}
2327 \edef\mainmagstep{1000}
2328 \setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
2329 \setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
2330 \setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
2331 \setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
2332 \setfont\textsl\slshape{10}{\mainmagstep}{OT1}
2333 \setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
2334 \setfont\textsc\scshape{10}{\mainmagstep}{OT1}
2335 \setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
2336 \font\texti=cmmi10 scaled \mainmagstep
2337 \font\textsy=cmsy10 scaled \mainmagstep
2338 \def\textecsize{1000}
2340 % A few fonts for @defun names and args.
2341 \setfont\defbf\bfshape{10}{\magstephalf}{OT1}
2342 \setfont\deftt\ttshape{10}{\magstephalf}{OT1TT}
2343 \setfont\defsl\slshape{10}{\magstephalf}{OT1}
2344 \setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT}
2345 \def\df{\let\ttfont=\deftt \let\bffont = \defbf
2346 \let\slfont=\defsl \let\ttslfont=\defttsl \bf}
2348 % Fonts for indices, footnotes, small examples (9pt).
2349 \def\smallnominalsize{9pt}
2350 \setfont\smallrm\rmshape{9}{1000}{OT1}
2351 \setfont\smalltt\ttshape{9}{1000}{OT1TT}
2352 \setfont\smallbf\bfshape{10}{900}{OT1}
2353 \setfont\smallit\itshape{9}{1000}{OT1IT}
2354 \setfont\smallsl\slshape{9}{1000}{OT1}
2355 \setfont\smallsf\sfshape{9}{1000}{OT1}
2356 \setfont\smallsc\scshape{10}{900}{OT1}
2357 \setfont\smallttsl\ttslshape{10}{900}{OT1TT}
2358 \font\smalli=cmmi9
2359 \font\smallsy=cmsy9
2360 \def\smallecsize{0900}
2362 % Fonts for small examples (8pt).
2363 \def\smallernominalsize{8pt}
2364 \setfont\smallerrm\rmshape{8}{1000}{OT1}
2365 \setfont\smallertt\ttshape{8}{1000}{OT1TT}
2366 \setfont\smallerbf\bfshape{10}{800}{OT1}
2367 \setfont\smallerit\itshape{8}{1000}{OT1IT}
2368 \setfont\smallersl\slshape{8}{1000}{OT1}
2369 \setfont\smallersf\sfshape{8}{1000}{OT1}
2370 \setfont\smallersc\scshape{10}{800}{OT1}
2371 \setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
2372 \font\smalleri=cmmi8
2373 \font\smallersy=cmsy8
2374 \def\smallerecsize{0800}
2376 % Fonts for math mode superscripts (7pt).
2377 \def\sevennominalsize{7pt}
2378 \setfont\sevenrm\rmshape{7}{1000}{OT1}
2379 \setfont\seventt\ttshape{10}{700}{OT1TT}
2380 \setfont\sevenbf\bfshape{10}{700}{OT1}
2381 \setfont\sevenit\itshape{7}{1000}{OT1IT}
2382 \setfont\sevensl\slshape{10}{700}{OT1}
2383 \setfont\sevensf\sfshape{10}{700}{OT1}
2384 \setfont\sevensc\scshape{10}{700}{OT1}
2385 \setfont\seventtsl\ttslshape{10}{700}{OT1TT}
2386 \font\seveni=cmmi7
2387 \font\sevensy=cmsy7
2388 \def\sevenecsize{0700}
2390 % Fonts for title page (20.4pt):
2391 \def\titlenominalsize{20pt}
2392 \setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
2393 \setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
2394 \setfont\titlesl\slbshape{10}{\magstep4}{OT1}
2395 \setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
2396 \setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
2397 \setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
2398 \let\titlebf=\titlerm
2399 \setfont\titlesc\scbshape{10}{\magstep4}{OT1}
2400 \font\titlei=cmmi12 scaled \magstep3
2401 \font\titlesy=cmsy10 scaled \magstep4
2402 \def\titleecsize{2074}
2404 % Chapter fonts (14.4pt).
2405 \def\chapnominalsize{14pt}
2406 \setfont\chaprm\rmbshape{12}{\magstep1}{OT1}
2407 \setfont\chapit\itbshape{10}{\magstep2}{OT1IT}
2408 \setfont\chapsl\slbshape{10}{\magstep2}{OT1}
2409 \setfont\chaptt\ttbshape{12}{\magstep1}{OT1TT}
2410 \setfont\chapttsl\ttslshape{10}{\magstep2}{OT1TT}
2411 \setfont\chapsf\sfbshape{12}{\magstep1}{OT1}
2412 \let\chapbf\chaprm
2413 \setfont\chapsc\scbshape{10}{\magstep2}{OT1}
2414 \font\chapi=cmmi12 scaled \magstep1
2415 \font\chapsy=cmsy10 scaled \magstep2
2416 \def\chapecsize{1440}
2418 % Section fonts (12pt).
2419 \def\secnominalsize{12pt}
2420 \setfont\secrm\rmbshape{12}{1000}{OT1}
2421 \setfont\secit\itbshape{10}{\magstep1}{OT1IT}
2422 \setfont\secsl\slbshape{10}{\magstep1}{OT1}
2423 \setfont\sectt\ttbshape{12}{1000}{OT1TT}
2424 \setfont\secttsl\ttslshape{10}{\magstep1}{OT1TT}
2425 \setfont\secsf\sfbshape{12}{1000}{OT1}
2426 \let\secbf\secrm
2427 \setfont\secsc\scbshape{10}{\magstep1}{OT1}
2428 \font\seci=cmmi12
2429 \font\secsy=cmsy10 scaled \magstep1
2430 \def\sececsize{1200}
2432 % Subsection fonts (10pt).
2433 \def\ssecnominalsize{10pt}
2434 \setfont\ssecrm\rmbshape{10}{1000}{OT1}
2435 \setfont\ssecit\itbshape{10}{1000}{OT1IT}
2436 \setfont\ssecsl\slbshape{10}{1000}{OT1}
2437 \setfont\ssectt\ttbshape{10}{1000}{OT1TT}
2438 \setfont\ssecttsl\ttslshape{10}{1000}{OT1TT}
2439 \setfont\ssecsf\sfbshape{10}{1000}{OT1}
2440 \let\ssecbf\ssecrm
2441 \setfont\ssecsc\scbshape{10}{1000}{OT1}
2442 \font\sseci=cmmi10
2443 \font\ssecsy=cmsy10
2444 \def\ssececsize{1000}
2446 % Reduced fonts for @acronym in text (9pt).
2447 \def\reducednominalsize{9pt}
2448 \setfont\reducedrm\rmshape{9}{1000}{OT1}
2449 \setfont\reducedtt\ttshape{9}{1000}{OT1TT}
2450 \setfont\reducedbf\bfshape{10}{900}{OT1}
2451 \setfont\reducedit\itshape{9}{1000}{OT1IT}
2452 \setfont\reducedsl\slshape{9}{1000}{OT1}
2453 \setfont\reducedsf\sfshape{9}{1000}{OT1}
2454 \setfont\reducedsc\scshape{10}{900}{OT1}
2455 \setfont\reducedttsl\ttslshape{10}{900}{OT1TT}
2456 \font\reducedi=cmmi9
2457 \font\reducedsy=cmsy9
2458 \def\reducedecsize{0900}
2460 \divide\parskip by 2 % reduce space between paragraphs
2461 \textleading = 12pt % line spacing for 10pt CM
2462 \textfonts % reset the current fonts
2464 } % end of 10pt text font size definitions, \definetextfontsizex
2466 % Fonts for short table of contents.
2467 \setfont\shortcontrm\rmshape{12}{1000}{OT1}
2468 \setfont\shortcontbf\bfshape{10}{\magstep1}{OT1} % no cmb12
2469 \setfont\shortcontsl\slshape{12}{1000}{OT1}
2470 \setfont\shortconttt\ttshape{12}{1000}{OT1TT}
2473 % We provide the user-level command
2474 % @fonttextsize 10
2475 % (or 11) to redefine the text font size. pt is assumed.
2477 \def\xiword{11}
2478 \def\xword{10}
2479 \def\xwordpt{10pt}
2481 \parseargdef\fonttextsize{%
2482 \def\textsizearg{#1}%
2483 %\wlog{doing @fonttextsize \textsizearg}%
2485 % Set \globaldefs so that documents can use this inside @tex, since
2486 % makeinfo 4.8 does not support it, but we need it nonetheless.
2488 \begingroup \globaldefs=1
2489 \ifx\textsizearg\xword \definetextfontsizex
2490 \else \ifx\textsizearg\xiword \definetextfontsizexi
2491 \else
2492 \errhelp=\EMsimple
2493 \errmessage{@fonttextsize only supports `10' or `11', not `\textsizearg'}
2494 \fi\fi
2495 \endgroup
2499 % Change the current font style to #1, remembering it in \curfontstyle.
2500 % For now, we do not accumulate font styles: @b{@i{foo}} prints foo in
2501 % italics, not bold italics.
2503 \def\setfontstyle#1{%
2504 \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd.
2505 \csname #1font\endcsname % change the current font
2508 \def\rm{\fam=0 \setfontstyle{rm}}
2509 \def\it{\fam=\itfam \setfontstyle{it}}
2510 \def\sl{\fam=\slfam \setfontstyle{sl}}
2511 \def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf}
2512 \def\tt{\fam=\ttfam \setfontstyle{tt}}
2514 % Texinfo sort of supports the sans serif font style, which plain TeX does not.
2515 % So we set up a \sf.
2516 \newfam\sffam
2517 \def\sf{\fam=\sffam \setfontstyle{sf}}
2519 % We don't need math for this font style.
2520 \def\ttsl{\setfontstyle{ttsl}}
2523 % In order for the font changes to affect most math symbols and letters,
2524 % we have to define the \textfont of the standard families.
2525 % We don't bother to reset \scriptscriptfont; awaiting user need.
2527 \def\resetmathfonts{%
2528 \textfont0=\rmfont \textfont1=\ifont \textfont2=\syfont
2529 \textfont\itfam=\itfont \textfont\slfam=\slfont \textfont\bffam=\bffont
2530 \textfont\ttfam=\ttfont \textfont\sffam=\sffont
2532 % Fonts for superscript. Note that the 7pt fonts are used regardless
2533 % of the current font size.
2534 \scriptfont0=\sevenrm \scriptfont1=\seveni \scriptfont2=\sevensy
2535 \scriptfont\itfam=\sevenit \scriptfont\slfam=\sevensl
2536 \scriptfont\bffam=\sevenbf \scriptfont\ttfam=\seventt
2537 \scriptfont\sffam=\sevensf
2542 % \defineassignfonts{SIZE} -
2543 % Define sequence \assignfontsSIZE, which switches between font sizes
2544 % by redefining the meanings of \STYLEfont. (Just \STYLE additionally sets
2545 % the current \fam for math mode.)
2547 \def\defineassignfonts#1{%
2548 \expandafter\edef\csname assignfonts#1\endcsname{%
2549 \let\noexpand\rmfont\csname #1rm\endcsname
2550 \let\noexpand\itfont\csname #1it\endcsname
2551 \let\noexpand\slfont\csname #1sl\endcsname
2552 \let\noexpand\bffont\csname #1bf\endcsname
2553 \let\noexpand\ttfont\csname #1tt\endcsname
2554 \let\noexpand\smallcaps\csname #1sc\endcsname
2555 \let\noexpand\sffont \csname #1sf\endcsname
2556 \let\noexpand\ifont \csname #1i\endcsname
2557 \let\noexpand\syfont \csname #1sy\endcsname
2558 \let\noexpand\ttslfont\csname #1ttsl\endcsname
2562 \def\assignfonts#1{%
2563 \csname assignfonts#1\endcsname
2566 \newif\ifrmisbold
2568 % Select smaller font size with the current style. Used to change font size
2569 % in, e.g., the LaTeX logo and acronyms. If we are using bold fonts for
2570 % normal roman text, also use bold fonts for roman text in the smaller size.
2571 \def\switchtolllsize{%
2572 \expandafter\assignfonts\expandafter{\lllsize}%
2573 \ifrmisbold
2574 \let\rmfont\bffont
2576 \csname\curfontstyle\endcsname
2579 \def\switchtolsize{%
2580 \expandafter\assignfonts\expandafter{\lsize}%
2581 \ifrmisbold
2582 \let\rmfont\bffont
2584 \csname\curfontstyle\endcsname
2587 % Define the font-changing commands (all called \...fonts).
2588 % Each font-changing command also sets the names \lsize (one size lower)
2589 % and \lllsize (three sizes lower). These relative commands are used
2590 % in, e.g., the LaTeX logo and acronyms.
2592 % Note: The fonts used for \ifont are for "math italics" (\itfont is for
2593 % italics in regular text). \syfont is also used in math mode only.
2595 \def\definefontsetatsize#1#2#3#4#5{%
2596 \defineassignfonts{#1}%
2597 \expandafter\def\csname #1fonts\endcsname{%
2598 \def\curfontsize{#1}%
2599 \def\lsize{#2}\def\lllsize{#3}%
2600 \csname rmisbold#5\endcsname
2601 \csname assignfonts#1\endcsname
2602 \resetmathfonts
2603 \setleading{#4}%
2606 \definefontsetatsize{text} {reduced}{smaller}{\textleading}{false}
2607 \definefontsetatsize{title} {chap} {subsec} {27pt} {true}
2608 \definefontsetatsize{chap} {sec} {text} {19pt} {true}
2609 \definefontsetatsize{sec} {subsec} {reduced}{17pt} {true}
2610 \definefontsetatsize{ssec} {text} {small} {15pt} {true}
2611 \definefontsetatsize{reduced}{small} {smaller}{10.5pt}{false}
2612 \definefontsetatsize{small} {smaller}{smaller}{10.5pt}{false}
2613 \definefontsetatsize{smaller}{smaller}{smaller}{9.5pt} {false}
2615 \def\titlefont#1{{\titlefonts\rm #1}}
2616 \let\subsecfonts = \ssecfonts
2617 \let\subsubsecfonts = \ssecfonts
2619 % Define these just so they can be easily changed for other fonts.
2620 \def\angleleft{$\langle$}
2621 \def\angleright{$\rangle$}
2623 % Set the fonts to use with the @small... environments.
2624 \let\smallexamplefonts = \smallfonts
2626 % About \smallexamplefonts. If we use \smallfonts (9pt), @smallexample
2627 % can fit this many characters:
2628 % 8.5x11=86 smallbook=72 a4=90 a5=69
2629 % If we use \scriptfonts (8pt), then we can fit this many characters:
2630 % 8.5x11=90+ smallbook=80 a4=90+ a5=77
2631 % For me, subjectively, the few extra characters that fit aren't worth
2632 % the additional smallness of 8pt. So I'm making the default 9pt.
2634 % By the way, for comparison, here's what fits with @example (10pt):
2635 % 8.5x11=71 smallbook=60 a4=75 a5=58
2636 % --karl, 24jan03.
2638 % Set up the default fonts, so we can use them for creating boxes.
2640 \definetextfontsizexi
2643 % Check if we are currently using a typewriter font. Since all the
2644 % Computer Modern typewriter fonts have zero interword stretch (and
2645 % shrink), and it is reasonable to expect all typewriter fonts to have
2646 % this property, we can check that font parameter. #1 is what to
2647 % print if we are indeed using \tt; #2 is what to print otherwise.
2648 \def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi}
2650 % Same as above, but check for italic font. Actually this also catches
2651 % non-italic slanted fonts since it is impossible to distinguish them from
2652 % italic fonts. But since this is only used by $ and it uses \sl anyway
2653 % this is not a problem.
2654 \def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi}
2657 % Check if internal flag is clear, i.e. has not been @set.
2658 \def\ifflagclear#1#2#3{%
2659 \expandafter\ifx\csname SET#1\endcsname\relax
2660 #2\else#3\fi
2664 \catcode`\'=\active
2665 \catcode`\`=\active
2667 \gdef\setcodequotes{\let`\codequoteleft \let'\codequoteright}
2668 \gdef\setregularquotes{\let`\lq \let'\rq}
2670 \setregularquotes
2672 % output for ' in @code
2673 % in tt font hex 0D (undirected) or 27 (curly right quote)
2675 \def\codequoteright{%
2676 \ifusingtt
2677 {\ifflagclear{txicodequoteundirected}%
2678 {\ifflagclear{codequoteundirected}%
2679 {'}%
2680 {\char"0D }}%
2681 {\char"0D }}%
2682 {'}%
2685 % output for ` in @code
2686 % in tt font hex 12 (grave accent) or 60 (curly left quote)
2687 % \relax disables Spanish ligatures ?` and !` of \tt font.
2689 \def\codequoteleft{%
2690 \ifusingtt
2691 {\ifflagclear{txicodequotebacktick}%
2692 {\ifflagclear{codequotebacktick}%
2693 {\relax`}%
2694 {\char"12 }}%
2695 {\char"12 }}%
2696 {\relax`}%
2699 % Commands to set the quote options.
2701 \parseargdef\codequoteundirected{%
2702 \def\temp{#1}%
2703 \ifx\temp\onword
2704 \expandafter\let\csname SETtxicodequoteundirected\endcsname
2705 = t%
2706 \else\ifx\temp\offword
2707 \expandafter\let\csname SETtxicodequoteundirected\endcsname
2708 = \relax
2709 \else
2710 \errhelp = \EMsimple
2711 \errmessage{Unknown @codequoteundirected value `\temp', must be on|off}%
2712 \fi\fi
2715 \parseargdef\codequotebacktick{%
2716 \def\temp{#1}%
2717 \ifx\temp\onword
2718 \expandafter\let\csname SETtxicodequotebacktick\endcsname
2719 = t%
2720 \else\ifx\temp\offword
2721 \expandafter\let\csname SETtxicodequotebacktick\endcsname
2722 = \relax
2723 \else
2724 \errhelp = \EMsimple
2725 \errmessage{Unknown @codequotebacktick value `\temp', must be on|off}%
2726 \fi\fi
2729 % Turn them on by default
2730 \let\SETtxicodequoteundirected = t
2731 \let\SETtxicodequotebacktick = t
2734 % [Knuth] pp. 380,381,391, disable Spanish ligatures ?` and !` of \tt font.
2735 \def\noligaturesquoteleft{\relax\lq}
2737 % Count depth in font-changes, for error checks
2738 \newcount\fontdepth \fontdepth=0
2740 % Font commands.
2742 % #1 is the font command (\sl or \it), #2 is the text to slant.
2743 % If we are in a monospaced environment, however, 1) always use \ttsl,
2744 % and 2) do not add an italic correction.
2745 \def\dosmartslant#1#2{%
2746 \ifusingtt
2747 {{\ttsl #2}\let\next=\relax}%
2748 {\def\next{{#1#2}\smartitaliccorrection}}%
2749 \next
2751 \def\smartslanted{\dosmartslant\sl}
2752 \def\smartitalic{\dosmartslant\it}
2754 % Output an italic correction unless the following character is such as
2755 % not to need one.
2756 \def\smartitaliccorrection{\futurelet\next\smartitaliccorrectionx}
2757 \def\smartitaliccorrectionx{%
2758 \ifx\next,%
2759 \else\ifx\next-%
2760 \else\ifx\next.%
2761 \else\ifx\next\.%
2762 \else\ifx\next\comma%
2763 \else\ptexslash
2764 \fi\fi\fi\fi\fi
2765 \aftersmartic
2768 % @cite unconditionally uses \sl with \smartitaliccorrection.
2769 \def\cite#1{{\sl #1}\smartitaliccorrection}
2771 % @var unconditionally uses \sl. This gives consistency for
2772 % parameter names whether they are in @def, @table @code or a
2773 % regular paragraph.
2774 % To get ttsl font for @var when used in code context, @set txicodevaristt.
2775 % The \null is to reset \spacefactor.
2776 \def\aftersmartic{}
2777 \def\var#1{%
2778 \let\saveaftersmartic = \aftersmartic
2779 \def\aftersmartic{\null\let\aftersmartic=\saveaftersmartic}%
2781 \ifflagclear{txicodevaristt}%
2782 {\def\varnext{{{\sl #1}}\smartitaliccorrection}}%
2783 {\def\varnext{\smartslanted{#1}}}%
2784 \varnext
2787 % To be removed after next release
2788 \def\SETtxicodevaristt{}% @set txicodevaristt
2790 \let\i=\smartitalic
2791 \let\slanted=\smartslanted
2792 \let\dfn=\smartslanted
2793 \let\emph=\smartitalic
2795 % @r for roman font, used for code comment
2796 \def\r#1{{%
2797 \usenormaldash % get --, --- ligatures even if in @code
2798 \defcharsdefault % in case on def line
2799 \rm #1}}
2800 {\catcode`-=\active \gdef\usenormaldash{\let-\normaldash}}
2802 % @sc, undocumented @ii.
2803 \def\sc#1{{\smallcaps#1}} % smallcaps font
2804 \def\ii#1{{\it #1}} % italic font
2806 % @b, explicit bold. Also @strong.
2807 \def\b#1{{\bf #1}}
2808 \let\strong=\b
2810 % @sansserif, explicit sans.
2811 \def\sansserif#1{{\sf #1}}
2813 \newif\iffrenchspacing
2814 \frenchspacingfalse
2816 % Set sfcode to normal for the chars that usually have another value.
2817 % Can't use plain's \frenchspacing because it uses the `\x notation, and
2818 % sometimes \x has an active definition that messes things up.
2820 \catcode`@=11
2821 \def\plainfrenchspacing{%
2822 \iffrenchspacing\else
2823 \frenchspacingtrue
2824 \sfcode`\.=\@m \sfcode`\?=\@m \sfcode`\!=\@m
2825 \sfcode`\:=\@m \sfcode`\;=\@m \sfcode`\,=\@m
2826 \def\endofsentencespacefactor{1000}% for @. and friends
2829 \def\plainnonfrenchspacing{%
2830 \iffrenchspacing
2831 \frenchspacingfalse
2832 \sfcode`\.3000\sfcode`\?3000\sfcode`\!3000
2833 \sfcode`\:2000\sfcode`\;1500\sfcode`\,1250
2834 \def\endofsentencespacefactor{3000}% for @. and friends
2837 \catcode`@=\other
2838 \def\endofsentencespacefactor{3000}% default
2840 % @frenchspacing on|off says whether to put extra space after punctuation.
2842 \def\onword{on}
2843 \def\offword{off}
2845 \let\frenchspacingsetting\plainnonfrenchspacing % used in output routine
2846 \parseargdef\frenchspacing{%
2847 \def\temp{#1}%
2848 \ifx\temp\onword \let\frenchspacingsetting\plainfrenchspacing
2849 \else\ifx\temp\offword \let\frenchspacingsetting\plainnonfrenchspacing
2850 \else
2851 \errhelp = \EMsimple
2852 \errmessage{Unknown @frenchspacing option `\temp', must be on|off}%
2853 \fi\fi
2854 \frenchspacingsetting
2858 % @t, explicit typewriter.
2859 \def\t#1{%
2860 {\tt \defcharsdefault \plainfrenchspacing #1}%
2861 \null
2864 % @samp.
2865 \def\samp#1{{\setcodequotes\lq\tclose{#1}\rq\null}}
2867 % @indicateurl is \samp, that is, with quotes.
2868 \let\indicateurl=\samp
2870 % @code (and similar) prints in typewriter, but with spaces the same
2871 % size as normal in the surrounding text, without hyphenation, etc.
2872 % This is a subroutine for that.
2873 \def\tclose#1{%
2875 % Change normal interword space to be same as for the current font.
2876 \spaceskip = \fontdimen2\font
2878 % Switch to typewriter.
2881 % `\ ' produces the large typewriter interword space.
2882 \def\ {{\spaceskip = 0pt{} }}%
2884 \plainfrenchspacing
2887 \null % reset spacefactor to 1000
2890 % This is for LuaTeX: It is not sufficient to disable hyphenation at
2891 % explicit dashes by setting `\hyphenchar` to -1.
2892 \def\dashnobreak{%
2893 \normaldash
2894 \penalty 10000 }
2896 % We must turn on hyphenation at `-' and `_' in @code.
2897 % Otherwise, it is too hard to avoid overfull hboxes
2898 % in the Emacs manual, the Library manual, etc.
2899 % We explicitly allow hyphenation at these characters
2900 % using \discretionary.
2902 % Hyphenation at - and hyphenation within words was turned off
2903 % by default for the tt fonts using the \hyphenchar parameter of TeX.
2905 \catcode`\-=\active \catcode`\_=\active
2906 \catcode`\'=\active \catcode`\`=\active
2907 \global\let'=\rq \global\let`=\lq % default definitions
2909 \global\def\code{\begingroup
2910 \setcodequotes
2911 \catcode\dashChar=\active \catcode\underChar=\active
2912 \ifallowcodebreaks
2913 \let-\codedash
2914 \let_\codeunder
2915 \else
2916 \let-\dashnobreak
2917 \let_\realunder
2919 \codex
2922 \gdef\codedash{\futurelet\next\codedashfinish}
2923 \gdef\codedashfinish{%
2924 \normaldash % always output the dash character itself.
2926 % Now, output a discretionary to allow a line break, unless
2927 % (a) the next character is a -, or
2928 % (b) the preceding character is a -, or
2929 % (c) we are at the start of the string.
2930 % In both cases (b) and (c), \codedashnobreak should be set to \codedash.
2932 % E.g., given --posix, we do not want to allow a break after either -.
2933 % Given --foo-bar, we do want to allow a break between the - and the b.
2934 \ifx\next\codedash \else
2935 \ifx\codedashnobreak\codedash
2936 \else \discretionary{}{}{}\fi
2938 % we need the space after the = for the case when \next itself is a
2939 % space token; it would get swallowed otherwise. As in @code{- a}.
2940 \global\let\codedashnobreak= \next
2943 \def\normaldash{-}
2945 \def\codex #1{\tclose{%
2946 % Given -foo (with a single dash), we do not want to allow a break
2947 % after the -. \codedashnobreak is set to the first character in
2948 % @code.
2949 \futurelet\codedashnobreak\relax
2951 }\endgroup}
2953 \def\codeunder{%
2954 % this is all so @math{@code{var_name}+1} can work. In math mode, _
2955 % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.)
2956 % will therefore expand the active definition of _, which is us
2957 % (inside @code that is), therefore an endless loop.
2958 \ifusingtt{\ifmmode
2959 \mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_.
2960 \else\normalunderscore \fi
2961 \discretionary{}{}{}}%
2962 {\_}%
2965 % An additional complication: the above will allow breaks after, e.g.,
2966 % each of the four underscores in __typeof__. This is bad.
2967 % @allowcodebreaks provides a document-level way to turn breaking at -
2968 % and _ on and off.
2970 \newif\ifallowcodebreaks \allowcodebreakstrue
2972 \def\keywordtrue{true}
2973 \def\keywordfalse{false}
2975 \parseargdef\allowcodebreaks{%
2976 \def\txiarg{#1}%
2977 \ifx\txiarg\keywordtrue
2978 \allowcodebreakstrue
2979 \else\ifx\txiarg\keywordfalse
2980 \allowcodebreaksfalse
2981 \else
2982 \errhelp = \EMsimple
2983 \errmessage{Unknown @allowcodebreaks option `\txiarg', must be true|false}%
2984 \fi\fi
2987 % For @command, @env, @file, @option quotes seem unnecessary,
2988 % so use \code rather than \samp.
2989 \let\command=\code
2990 \let\env=\code
2991 \let\file=\code
2992 \let\option=\code
2994 % @uref (abbreviation for `urlref') aka @url takes an optional
2995 % (comma-separated) second argument specifying the text to display and
2996 % an optional third arg as text to display instead of (rather than in
2997 % addition to) the url itself. First (mandatory) arg is the url.
2999 % TeX-only option to allow changing PDF output to show only the second
3000 % arg (if given), and not the url (which is then just the link target).
3001 \newif\ifurefurlonlylink
3003 % The default \pretolerance setting stops the penalty inserted in
3004 % \urefallowbreak being a discouragement to line breaking. Set it to
3005 % a negative value for this paragraph only. Hopefully this does not
3006 % conflict with redefinitions of \par done elsewhere.
3007 \def\nopretolerance{%
3008 \pretolerance=-1
3009 \def\par{\endgraf\pretolerance=100 \let\par\endgraf}%
3012 % The main macro is \urefbreak, which allows breaking at expected
3013 % places within the url.
3014 \def\urefbreak{\nopretolerance \begingroup \urefcatcodes \dourefbreak}
3015 \let\uref=\urefbreak
3017 \def\dourefbreak#1{\urefbreakfinish #1,,,\finish}
3018 \def\urefbreakfinish#1,#2,#3,#4\finish{% doesn't work in @example
3019 \unsepspaces
3020 \pdfurl{#1}%
3021 \setbox0 = \hbox{\ignorespaces #3}%
3022 \ifdim\wd0 > 0pt
3023 \unhbox0 % third arg given, show only that
3024 \else
3025 \setbox0 = \hbox{\ignorespaces #2}% look for second arg
3026 \ifdim\wd0 > 0pt
3027 \ifpdf
3028 % For pdfTeX and LuaTeX
3029 \ifurefurlonlylink
3030 % PDF plus option to not display url, show just arg
3031 \unhbox0
3032 \else
3033 % PDF, normally display both arg and url for consistency,
3034 % visibility, if the pdf is eventually used to print, etc.
3035 \unhbox0\ (\urefcode{#1})%
3037 \else
3038 \ifx\XeTeXrevision\thisisundefined
3039 \unhbox0\ (\urefcode{#1})% DVI, always show arg and url
3040 \else
3041 % For XeTeX
3042 \ifurefurlonlylink
3043 % PDF plus option to not display url, show just arg
3044 \unhbox0
3045 \else
3046 % PDF, normally display both arg and url for consistency,
3047 % visibility, if the pdf is eventually used to print, etc.
3048 \unhbox0\ (\urefcode{#1})%
3052 \else
3053 \urefcode{#1}% only url given, so show it
3056 \endlink
3057 \endgroup}
3059 % Allow line breaks around only a few characters (only).
3060 \def\urefcatcodes{%
3061 \catcode`\&=\active \catcode`\.=\active
3062 \catcode`\#=\active \catcode`\?=\active
3063 \catcode`\/=\active
3066 \urefcatcodes
3068 \global\def\urefcode{\begingroup
3069 \setcodequotes
3070 \urefcatcodes
3071 \let&\urefcodeamp
3072 \let.\urefcodedot
3073 \let#\urefcodehash
3074 \let?\urefcodequest
3075 \let/\urefcodeslash
3076 \codex
3079 % By default, they are just regular characters.
3080 \global\def&{\normalamp}
3081 \global\def.{\normaldot}
3082 \global\def#{\normalhash}
3083 \global\def?{\normalquest}
3084 \global\def/{\normalslash}
3087 \def\urefcodeamp{\urefprebreak \&\urefpostbreak}
3088 \def\urefcodedot{\urefprebreak .\urefpostbreak}
3089 \def\urefcodehash{\urefprebreak \#\urefpostbreak}
3090 \def\urefcodequest{\urefprebreak ?\urefpostbreak}
3091 \def\urefcodeslash{\futurelet\next\urefcodeslashfinish}
3093 \catcode`\/=\active
3094 \global\def\urefcodeslashfinish{%
3095 \urefprebreak \slashChar
3096 % Allow line break only after the final / in a sequence of
3097 % slashes, to avoid line break between the slashes in http://.
3098 \ifx\next/\else \urefpostbreak \fi
3102 % By default we'll break after the special characters, but some people like to
3103 % break before the special chars, so allow that. Also allow no breaking at
3104 % all, for manual control.
3106 \parseargdef\urefbreakstyle{%
3107 \def\txiarg{#1}%
3108 \ifx\txiarg\wordnone
3109 \def\urefprebreak{\nobreak}\def\urefpostbreak{\nobreak}
3110 \else\ifx\txiarg\wordbefore
3111 \def\urefprebreak{\urefallowbreak}\def\urefpostbreak{\nobreak}
3112 \else\ifx\txiarg\wordafter
3113 \def\urefprebreak{\nobreak}\def\urefpostbreak{\urefallowbreak}
3114 \else
3115 \errhelp = \EMsimple
3116 \errmessage{Unknown @urefbreakstyle setting `\txiarg'}%
3117 \fi\fi\fi
3119 \def\wordafter{after}
3120 \def\wordbefore{before}
3121 \def\wordnone{none}
3123 % Allow a ragged right output to aid breaking long URL's. There can
3124 % be a break at the \allowbreak with no extra glue (if the existing stretch in
3125 % the line is sufficient), a break at the \penalty with extra glue added
3126 % at the end of the line, or no break at all here.
3127 % Changing the value of the penalty and/or the amount of stretch affects how
3128 % preferable one choice is over the other.
3129 \def\urefallowbreak{%
3130 \penalty0\relax
3131 \hskip 0pt plus 2 em\relax
3132 \penalty1000\relax
3133 \hskip 0pt plus -2 em\relax
3136 \urefbreakstyle after
3138 % @url synonym for @uref, since that's how everyone uses it.
3140 \let\url=\uref
3142 % rms does not like angle brackets --karl, 17may97.
3143 % So now @email is just like @uref, unless we are pdf.
3145 %\def\email#1{\angleleft{\tt #1}\angleright}
3146 \ifpdforxetex
3147 \def\email#1{\doemail#1,,\finish}
3148 \def\doemail#1,#2,#3\finish{\begingroup
3149 \unsepspaces
3150 \pdfurl{mailto:#1}%
3151 \setbox0 = \hbox{\ignorespaces #2}%
3152 \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi
3153 \endlink
3154 \endgroup}
3155 \else
3156 \let\email=\uref
3159 % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
3160 % `example' (@kbd uses ttsl only inside of @example and friends),
3161 % or `code' (@kbd uses normal tty font always).
3162 \parseargdef\kbdinputstyle{%
3163 \def\txiarg{#1}%
3164 \ifx\txiarg\worddistinct
3165 \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
3166 \else\ifx\txiarg\wordexample
3167 \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
3168 \else\ifx\txiarg\wordcode
3169 \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
3170 \else
3171 \errhelp = \EMsimple
3172 \errmessage{Unknown @kbdinputstyle setting `\txiarg'}%
3173 \fi\fi\fi
3175 \def\worddistinct{distinct}
3176 \def\wordexample{example}
3177 \def\wordcode{code}
3179 % Default is `distinct'.
3180 \kbdinputstyle distinct
3182 \def\kbd#1{%
3183 \tclose{\kbdfont\setcodequotes#1}%
3186 % definition of @key that produces a lozenge. Doesn't adjust to text size.
3187 %\setfont\keyrm\rmshape{8}{1000}{OT1}
3188 %\font\keysy=cmsy9
3189 %\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{%
3190 % \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
3191 % \vbox{\hrule\kern-0.4pt
3192 % \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
3193 % \kern-0.4pt\hrule}%
3194 % \kern-.06em\raise0.4pt\hbox{\angleright}}}}
3196 % definition of @key with no lozenge.
3198 \def\key#1{{\setregularquotes \tt #1}\null}
3200 % @clicksequence{File @click{} Open ...}
3201 \def\clicksequence#1{\begingroup #1\endgroup}
3203 % @clickstyle @arrow (by default)
3204 \parseargdef\clickstyle{\def\click{#1}}
3205 \def\click{\arrow}
3207 % Typeset a dimension, e.g., `in' or `pt'. The only reason for the
3208 % argument is to make the input look right: @dmn{pt} instead of @dmn{}pt.
3210 \def\dmn#1{\thinspace #1}
3212 % @acronym for "FBI", "NATO", and the like.
3213 % We print this one point size smaller, since it's intended for
3214 % all-uppercase.
3216 \def\acronym#1{\doacronym #1,,\finish}
3217 \def\doacronym#1,#2,#3\finish{%
3218 {\switchtolsize #1}%
3219 \def\temp{#2}%
3220 \ifx\temp\empty \else
3221 \space ({\unsepspaces \ignorespaces \temp \unskip})%
3223 \null % reset \spacefactor=1000
3226 % @abbr for "Comput. J." and the like.
3227 % No font change, but don't do end-of-sentence spacing.
3229 \def\abbr#1{\doabbr #1,,\finish}
3230 \def\doabbr#1,#2,#3\finish{%
3231 {\plainfrenchspacing #1}%
3232 \def\temp{#2}%
3233 \ifx\temp\empty \else
3234 \space ({\unsepspaces \ignorespaces \temp \unskip})%
3236 \null % reset \spacefactor=1000
3239 % @asis just yields its argument. Used with @table, for example.
3241 \def\asis#1{#1}
3243 % @math outputs its argument in math mode.
3245 % One complication: _ usually means subscripts, but it could also mean
3246 % an actual _ character, as in @math{@var{some_variable} + 1}. So make
3247 % _ active, and distinguish by seeing if the current family is \slfam,
3248 % which is what @var uses.
3250 \catcode`\_ = \active
3251 \gdef\mathunderscore{%
3252 \catcode`\_=\active
3253 \def_{\ifnum\fam=\slfam \_\else\sb\fi}%
3256 % Another complication: we want \\ (and @\) to output a math (or tt) \.
3257 % FYI, plain.tex uses \\ as a temporary control sequence (for no
3258 % particular reason), but this is not advertised and we don't care.
3260 % The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.
3261 \def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi}
3263 \def\math{%
3264 \ifmmode\else % only go into math if not in math mode already
3265 \tex
3266 \mathunderscore
3267 \let\\ = \mathbackslash
3268 \mathactive
3269 % make the texinfo accent commands work in math mode
3270 \let\"=\ddot
3271 \let\'=\acute
3272 \let\==\bar
3273 \let\^=\hat
3274 \let\`=\grave
3275 \let\u=\breve
3276 \let\v=\check
3277 \let\~=\tilde
3278 \let\dotaccent=\dot
3279 % have to provide another name for sup operator
3280 \let\mathopsup=\sup
3281 $\expandafter\finishmath\fi
3283 \def\finishmath#1{#1$\endgroup} % Close the group opened by \tex.
3285 % Some active characters (such as <) are spaced differently in math.
3286 % We have to reset their definitions in case the @math was an argument
3287 % to a command which sets the catcodes (such as @item or @section).
3290 \catcode`^ = \active
3291 \catcode`< = \active
3292 \catcode`> = \active
3293 \catcode`+ = \active
3294 \catcode`' = \active
3295 \gdef\mathactive{%
3296 \let^ = \ptexhat
3297 \let< = \ptexless
3298 \let> = \ptexgtr
3299 \let+ = \ptexplus
3300 \let' = \ptexquoteright
3304 % for @sub and @sup, if in math mode, just do a normal sub/superscript.
3305 % If in text, use math to place as sub/superscript, but switch
3306 % into text mode, with smaller fonts. This is a different font than the
3307 % one used for real math sub/superscripts (8pt vs. 7pt), but let's not
3308 % fix it (significant additions to font machinery) until someone notices.
3310 \def\sub{\ifmmode \expandafter\sb \else \expandafter\finishsub\fi}
3311 \def\finishsub#1{$\sb{\hbox{\switchtolllsize #1}}$}%
3313 \def\sup{\ifmmode \expandafter\ptexsp \else \expandafter\finishsup\fi}
3314 \def\finishsup#1{$\ptexsp{\hbox{\switchtolllsize #1}}$}%
3316 % provide this command from LaTeX as it is very common
3317 \def\frac#1#2{{{#1}\over{#2}}}
3319 % @displaymath.
3320 % \globaldefs is needed to recognize the end lines in \tex and
3321 % \end tex. Set \thisenv as @end displaymath is seen before @end tex.
3322 {\obeylines
3323 \globaldefs=1
3324 \envdef\displaymath{%
3325 \tex%
3326 \def\thisenv{\displaymath}%
3327 \begingroup\let\end\displaymathend%
3331 \def\displaymathend{$$\endgroup\end}%
3333 \def\Edisplaymath{%
3334 \def\thisenv{\tex}%
3335 \end tex
3339 % @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}.
3340 % Ignore unless FMTNAME == tex; then it is like @iftex and @tex,
3341 % except specified as a normal braced arg, so no newlines to worry about.
3343 \def\outfmtnametex{tex}
3345 \long\def\inlinefmt#1{\doinlinefmt #1,\finish}
3346 \long\def\doinlinefmt#1,#2,\finish{%
3347 \def\inlinefmtname{#1}%
3348 \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\fi
3351 % @inlinefmtifelse{FMTNAME,THEN-TEXT,ELSE-TEXT} expands THEN-TEXT if
3352 % FMTNAME is tex, else ELSE-TEXT.
3353 \long\def\inlinefmtifelse#1{\doinlinefmtifelse #1,,,\finish}
3354 \long\def\doinlinefmtifelse#1,#2,#3,#4,\finish{%
3355 \def\inlinefmtname{#1}%
3356 \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\else \ignorespaces #3\fi
3359 % For raw, must switch into @tex before parsing the argument, to avoid
3360 % setting catcodes prematurely. Doing it this way means that, for
3361 % example, @inlineraw{html, foo{bar} gets a parse error instead of being
3362 % ignored. But this isn't important because if people want a literal
3363 % *right* brace they would have to use a command anyway, so they may as
3364 % well use a command to get a left brace too. We could re-use the
3365 % delimiter character idea from \verb, but it seems like overkill.
3367 \long\def\inlineraw{\tex \doinlineraw}
3368 \long\def\doinlineraw#1{\doinlinerawtwo #1,\finish}
3369 \def\doinlinerawtwo#1,#2,\finish{%
3370 \def\inlinerawname{#1}%
3371 \ifx\inlinerawname\outfmtnametex \ignorespaces #2\fi
3372 \endgroup % close group opened by \tex.
3375 % @inlineifset{VAR, TEXT} expands TEXT if VAR is @set.
3377 \long\def\inlineifset#1{\doinlineifset #1,\finish}
3378 \long\def\doinlineifset#1,#2,\finish{%
3379 \def\inlinevarname{#1}%
3380 \expandafter\ifx\csname SET\inlinevarname\endcsname\relax
3381 \else\ignorespaces#2\fi
3384 % @inlineifclear{VAR, TEXT} expands TEXT if VAR is not @set.
3386 \long\def\inlineifclear#1{\doinlineifclear #1,\finish}
3387 \long\def\doinlineifclear#1,#2,\finish{%
3388 \def\inlinevarname{#1}%
3389 \expandafter\ifx\csname SET\inlinevarname\endcsname\relax \ignorespaces#2\fi
3393 \message{glyphs,}
3394 % and logos.
3396 % @@ prints an @, as does @atchar{}.
3397 \def\@{\char64 }
3398 \let\atchar=\@
3400 % @{ @} @lbracechar{} @rbracechar{} all generate brace characters.
3401 \def\lbracechar{{\ifusingtt{\char123}{\ensuremath\lbrace}}}
3402 \def\rbracechar{{\ifusingtt{\char125}{\ensuremath\rbrace}}}
3403 \let\{=\lbracechar
3404 \let\}=\rbracechar
3406 % @comma{} to avoid , parsing problems.
3407 \let\comma = ,
3409 % Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
3410 % Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H.
3411 \let\, = \ptexc
3412 \let\dotaccent = \ptexdot
3413 \def\ringaccent#1{{\accent23 #1}}
3414 \let\tieaccent = \ptext
3415 \let\ubaraccent = \ptexb
3416 \let\udotaccent = \d
3418 % Other special characters: @questiondown @exclamdown @ordf @ordm
3419 % Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
3420 \def\questiondown{?`}
3421 \def\exclamdown{!`}
3422 \def\ordf{\leavevmode\raise1ex\hbox{\switchtolllsize \underbar{a}}}
3423 \def\ordm{\leavevmode\raise1ex\hbox{\switchtolllsize \underbar{o}}}
3425 % Dotless i and dotless j, used for accents.
3426 \def\imacro{i}
3427 \def\jmacro{j}
3428 \def\dotless#1{%
3429 \def\temp{#1}%
3430 \ifx\temp\imacro \ifmmode\imath \else\ptexi \fi
3431 \else\ifx\temp\jmacro \ifmmode\jmath \else\j \fi
3432 \else \errmessage{@dotless can be used only with i or j}%
3433 \fi\fi
3436 % The \TeX{} logo, as in plain, but resetting the spacing so that a
3437 % period following counts as ending a sentence. (Idea found in latex.)
3439 \edef\TeX{\TeX \spacefactor=1000 }
3441 % @LaTeX{} logo. Not quite the same results as the definition in
3442 % latex.ltx, since we use a different font for the raised A; it's most
3443 % convenient for us to use an explicitly smaller font, rather than using
3444 % the \scriptstyle font (since we don't reset \scriptstyle and
3445 % \scriptscriptstyle).
3447 \def\LaTeX{%
3448 L\kern-.36em
3449 {\setbox0=\hbox{T}%
3450 \vbox to \ht0{\hbox{%
3451 \ifx\textnominalsize\xwordpt
3452 % for 10pt running text, lllsize (8pt) is too small for the A in LaTeX.
3453 % Revert to plain's \scriptsize, which is 7pt.
3454 \count255=\the\fam $\fam\count255 \scriptstyle A$%
3455 \else
3456 \ifx\curfontsize\smallword
3457 % For footnotes and indices
3458 \count255=\the\fam $\fam\count255 \scriptstyle A$%
3459 \else
3460 % For 11pt, we can use our lllsize.
3461 \switchtolllsize A%
3465 \vss
3467 \kern-.15em
3468 \TeX
3470 \def\smallword{small}
3472 % Some math mode symbols. Define \ensuremath to switch into math mode
3473 % unless we are already there. Expansion tricks may not be needed here,
3474 % but safer, and can't hurt.
3475 \def\ensuremath{\ifmmode \expandafter\asis \else\expandafter\ensuredmath \fi}
3476 \def\ensuredmath#1{$\relax#1$}
3478 \def\bullet{\ensuremath\ptexbullet}
3479 \def\geq{\ensuremath\ge}
3480 \def\leq{\ensuremath\le}
3481 \def\minus{\ensuremath-}
3483 % @dots{} outputs an ellipsis using the current font.
3484 % We do .5em per period so that it has the same spacing in the cm
3485 % typewriter fonts as three actual period characters; on the other hand,
3486 % in other typewriter fonts three periods are wider than 1.5em. So do
3487 % whichever is larger.
3489 \def\dots{%
3490 \leavevmode
3491 \setbox0=\hbox{...}% get width of three periods
3492 \ifdim\wd0 > 1.5em
3493 \dimen0 = \wd0
3494 \else
3495 \dimen0 = 1.5em
3497 \hbox to \dimen0{%
3498 \hskip 0pt plus.25fil
3499 .\hskip 0pt plus1fil
3500 .\hskip 0pt plus1fil
3501 .\hskip 0pt plus.5fil
3505 % @enddots{} is an end-of-sentence ellipsis.
3507 \def\enddots{%
3508 \dots
3509 \spacefactor=\endofsentencespacefactor
3512 % @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
3514 % Since these characters are used in examples, they should be an even number of
3515 % \tt widths. Each \tt character is 1en, so two makes it 1em.
3517 \def\point{$\star$}
3518 \def\arrow{\leavevmode\raise.05ex\hbox to 1em{\hfil$\rightarrow$\hfil}}
3519 \def\result{\leavevmode\raise.05ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}
3520 \def\expansion{\leavevmode\hbox to 1em{\hfil$\mapsto$\hfil}}
3521 \def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}}
3522 \def\equiv{\leavevmode\hbox to 1em{\hfil$\ptexequiv$\hfil}}
3524 % The @error{} command.
3525 % Adapted from the TeXbook's \boxit.
3527 \newbox\errorbox
3529 {\ttfont \global\dimen0 = 3em}% Width of the box.
3530 \dimen2 = .55pt % Thickness of rules
3531 % The text. (`r' is open on the right, `e' somewhat less so on the left.)
3532 \setbox0 = \hbox{\kern-.75pt \reducedsf \putworderror\kern-1.5pt}
3534 \setbox\errorbox=\hbox to \dimen0{\hfil
3535 \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
3536 \advance\hsize by -2\dimen2 % Rules.
3537 \vbox{%
3538 \hrule height\dimen2
3539 \hbox{\vrule width\dimen2 \kern3pt % Space to left of text.
3540 \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below.
3541 \kern3pt\vrule width\dimen2}% Space to right.
3542 \hrule height\dimen2}
3543 \hfil}
3545 \def\error{\leavevmode\lower.7ex\copy\errorbox}
3547 % @pounds{} is a sterling sign, which Knuth put in the CM italic font.
3549 \def\pounds{{\ifusingtt{\ecfont\char"BF}{\it\$}}}
3551 % @euro{} comes from a separate font, depending on the current style.
3552 % We use the free feym* fonts from the eurosym package by Henrik
3553 % Theiling, which support regular, slanted, bold and bold slanted (and
3554 % "outlined" (blackboard board, sort of) versions, which we don't need).
3555 % It is available from http://www.ctan.org/tex-archive/fonts/eurosym.
3557 % Although only regular is the truly official Euro symbol, we ignore
3558 % that. The Euro is designed to be slightly taller than the regular
3559 % font height.
3561 % feymr - regular
3562 % feymo - slanted
3563 % feybr - bold
3564 % feybo - bold slanted
3566 % There is no good (free) typewriter version, to my knowledge.
3567 % A feymr10 euro is ~7.3pt wide, while a normal cmtt10 char is ~5.25pt wide.
3568 % Hmm.
3570 % Also doesn't work in math. Do we need to do math with euro symbols?
3571 % Hope not.
3574 \def\euro{{\eurofont e}}
3575 \def\eurofont{%
3576 % We set the font at each command, rather than predefining it in
3577 % \textfonts and the other font-switching commands, so that
3578 % installations which never need the symbol don't have to have the
3579 % font installed.
3581 % There is only one designed size (nominal 10pt), so we always scale
3582 % that to the current nominal size.
3584 % By the way, simply using "at 1em" works for cmr10 and the like, but
3585 % does not work for cmbx10 and other extended/shrunken fonts.
3587 \def\eurosize{\csname\curfontsize nominalsize\endcsname}%
3589 \ifx\curfontstyle\bfstylename
3590 % bold:
3591 \font\thiseurofont = \ifusingit{feybo10}{feybr10} at \eurosize
3592 \else
3593 % regular:
3594 \font\thiseurofont = \ifusingit{feymo10}{feymr10} at \eurosize
3596 \thiseurofont
3599 % Glyphs from the EC fonts. We don't use \let for the aliases, because
3600 % sometimes we redefine the original macro, and the alias should reflect
3601 % the redefinition.
3603 % Use LaTeX names for the Icelandic letters.
3604 \def\DH{{\ecfont \char"D0}} % Eth
3605 \def\dh{{\ecfont \char"F0}} % eth
3606 \def\TH{{\ecfont \char"DE}} % Thorn
3607 \def\th{{\ecfont \char"FE}} % thorn
3609 \def\guillemetleft{{\ecfont \char"13}}
3610 \def\guillemotleft{\guillemetleft}
3611 \def\guillemetright{{\ecfont \char"14}}
3612 \def\guillemotright{\guillemetright}
3613 \def\guilsinglleft{{\ecfont \char"0E}}
3614 \def\guilsinglright{{\ecfont \char"0F}}
3615 \def\quotedblbase{{\ecfont \char"12}}
3616 \def\quotesinglbase{{\ecfont \char"0D}}
3618 \def\L{{\ecfont \char"8A}} % L with stroke
3619 \def\l{{\ecfont \char"AA}} % l with stroke
3621 % This positioning is not perfect (see the ogonek LaTeX package), but
3622 % we have the precomposed glyphs for the most common cases. We put the
3623 % tests to use those glyphs in the single \ogonek macro so we have fewer
3624 % dummy definitions to worry about for index entries, etc.
3626 % ogonek is also used with other letters in Lithuanian (IOU), but using
3627 % the precomposed glyphs for those is not so easy since they aren't in
3628 % the same EC font.
3629 \def\ogonek#1{{%
3630 \def\temp{#1}%
3631 \ifx\temp\macrocharA\Aogonek
3632 \else\ifx\temp\macrochara\aogonek
3633 \else\ifx\temp\macrocharE\Eogonek
3634 \else\ifx\temp\macrochare\eogonek
3635 \else
3636 \ecfont \setbox0=\hbox{#1}%
3637 \ifdim\ht0=1ex\accent"0C #1%
3638 \else\ooalign{\unhbox0\crcr\hidewidth\char"0C \hidewidth}%
3640 \fi\fi\fi\fi
3643 \def\Aogonek{{\ecfont \char"81}}\def\macrocharA{A}
3644 \def\aogonek{{\ecfont \char"A1}}\def\macrochara{a}
3645 \def\Eogonek{{\ecfont \char"86}}\def\macrocharE{E}
3646 \def\eogonek{{\ecfont \char"A6}}\def\macrochare{e}
3648 % Use the European Computer Modern fonts (cm-super in outline format)
3649 % for non-CM glyphs. That is ec* for regular text and tc* for the text
3650 % companion symbols (LaTeX TS1 encoding). Both are part of the ec
3651 % package and follow the same conventions.
3653 \def\ecfont{\etcfont{e}}
3654 \def\tcfont{\etcfont{t}}
3656 \def\etcfont#1{%
3657 % We can't distinguish serif/sans and italic/slanted, but this
3658 % is used for crude hacks anyway (like adding French and German
3659 % quotes to documents typeset with CM, where we lose kerning), so
3660 % hopefully nobody will notice/care.
3661 \edef\ecsize{\csname\curfontsize ecsize\endcsname}%
3662 \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}%
3663 \ifusingtt
3664 % typewriter:
3665 {\font\thisecfont = #1ctt\ecsize \space at \nominalsize}%
3666 % else
3667 {\ifx\curfontstyle\bfstylename
3668 % bold:
3669 \font\thisecfont = #1cb\ifusingit{i}{x}\ecsize \space at \nominalsize
3670 \else
3671 % regular:
3672 \font\thisecfont = #1c\ifusingit{ti}{rm}\ecsize \space at \nominalsize
3673 \fi}%
3674 \thisecfont
3677 % @registeredsymbol - R in a circle. The font for the R should really
3678 % be smaller yet, but lllsize is the best we can do for now.
3679 % Adapted from the plain.tex definition of \copyright.
3681 \def\registeredsymbol{%
3682 $^{{\ooalign{\hfil\raise.07ex\hbox{\switchtolllsize R}%
3683 \hfil\crcr\Orb}}%
3687 % @textdegree - the normal degrees sign.
3689 \def\textdegree{%
3690 \ifmmode ^\circ
3691 \else {\tcfont \char 176}%
3692 \fi}
3694 % Laurent Siebenmann reports \Orb undefined with:
3695 % Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38
3696 % so we'll define it if necessary.
3698 \ifx\Orb\thisisundefined
3699 \def\Orb{\mathhexbox20D}
3702 % Quotes.
3703 \chardef\quoteleft=`\`
3704 \chardef\quoteright=`\'
3706 % only change font for tt for correct kerning and to avoid using
3707 % \ecfont unless necessary.
3708 \def\quotedblleft{%
3709 \ifusingtt{{\ecfont\char"10}}{{\char"5C}}%
3712 \def\quotedblright{%
3713 \ifusingtt{{\ecfont\char"11}}{{\char`\"}}%
3717 \message{page headings,}
3719 \newskip\titlepagetopglue \titlepagetopglue = 1.5in
3720 \newskip\titlepagebottomglue \titlepagebottomglue = 2pc
3722 % First the title page. Must do @settitle before @titlepage.
3723 \newif\ifseenauthor
3724 \newif\iffinishedtitlepage
3726 % @setcontentsaftertitlepage used to do an implicit @contents or
3727 % @shortcontents after @end titlepage, but it is now obsolete.
3728 \def\setcontentsaftertitlepage{%
3729 \errmessage{@setcontentsaftertitlepage has been removed as a Texinfo
3730 command; move your @contents command if you want the contents
3731 after the title page.}}%
3732 \def\setshortcontentsaftertitlepage{%
3733 \errmessage{@setshortcontentsaftertitlepage has been removed as a Texinfo
3734 command; move your @shortcontents and @contents commands if you
3735 want the contents after the title page.}}%
3737 \parseargdef\shorttitlepage{%
3738 {\headingsoff \begingroup \hbox{}\vskip 1.5in \chaprm \centerline{#1}%
3739 \endgroup\page\hbox{}\page}\pageone}
3741 \envdef\titlepage{%
3742 % Open one extra group, as we want to close it in the middle of \Etitlepage.
3743 \begingroup
3744 \parindent=0pt \textfonts
3745 \headingsoff
3746 % Leave some space at the very top of the page.
3747 \vglue\titlepagetopglue
3748 % No rule at page bottom unless we print one at the top with @title.
3749 \finishedtitlepagetrue
3751 % Most title ``pages'' are actually two pages long, with space
3752 % at the top of the second. We don't want the ragged left on the second.
3753 \let\oldpage = \page
3754 \def\page{%
3755 \iffinishedtitlepage\else
3756 \finishtitlepage
3758 \let\page = \oldpage
3759 \page
3760 \null
3764 \def\Etitlepage{%
3765 \iffinishedtitlepage\else
3766 \finishtitlepage
3768 % It is important to do the page break before ending the group,
3769 % because the headline and footline are only empty inside the group.
3770 % If we use the new definition of \page, we always get a blank page
3771 % after the title page, which we certainly don't want.
3772 \oldpage
3773 \pageone
3774 \endgroup
3778 \def\finishtitlepage{%
3779 \vskip4pt \hrule height 2pt width \hsize
3780 \vskip\titlepagebottomglue
3781 \finishedtitlepagetrue
3784 % Settings used for typesetting titles: no hyphenation, no indentation,
3785 % don't worry much about spacing, ragged right. This should be used
3786 % inside a \vbox, and fonts need to be set appropriately first. \par should
3787 % be specified before the end of the \vbox, since a vbox is a group.
3789 \def\raggedtitlesettings{%
3791 \hyphenpenalty=10000
3792 \parindent=0pt
3793 \tolerance=5000
3794 \ptexraggedright
3797 % Macros to be used within @titlepage:
3799 \let\subtitlerm=\rmfont
3800 \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}
3802 \parseargdef\title{%
3803 \checkenv\titlepage
3804 \vbox{\titlefonts \raggedtitlesettings #1\par}%
3805 % print a rule at the page bottom also.
3806 \finishedtitlepagefalse
3807 \vskip4pt \hrule height 4pt width \hsize \vskip4pt
3810 \parseargdef\subtitle{%
3811 \checkenv\titlepage
3812 {\subtitlefont \rightline{#1}}%
3815 % @author should come last, but may come many times.
3816 % It can also be used inside @quotation.
3818 \parseargdef\author{%
3819 \def\temp{\quotation}%
3820 \ifx\thisenv\temp
3821 \def\quotationauthor{#1}% printed in \Equotation.
3822 \else
3823 \checkenv\titlepage
3824 \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi
3825 {\secfonts\rm \leftline{#1}}%
3830 % Set up page headings and footings.
3832 \let\thispage=\folio
3834 \newtoks\evenheadline % headline on even pages
3835 \newtoks\oddheadline % headline on odd pages
3836 \newtoks\evenchapheadline% headline on even pages with a new chapter
3837 \newtoks\oddchapheadline % headline on odd pages with a new chapter
3838 \newtoks\evenfootline % footline on even pages
3839 \newtoks\oddfootline % footline on odd pages
3841 % Now make \makeheadline and \makefootline in Plain TeX use those variables
3842 \headline={{\textfonts\rm\frenchspacingsetting
3843 \ifchapterpage
3844 \ifodd\pageno\the\oddchapheadline\else\the\evenchapheadline\fi
3845 \else
3846 \ifodd\pageno\the\oddheadline\else\the\evenheadline\fi
3847 \fi}}
3849 \footline={{\textfonts\rm\frenchspacingsetting
3850 \ifodd\pageno \the\oddfootline \else \the\evenfootline \fi}%
3851 \HEADINGShook}
3852 \let\HEADINGShook=\relax
3854 % Commands to set those variables.
3855 % For example, this is what @headings on does
3856 % @evenheading @thistitle|@thispage|@thischapter
3857 % @oddheading @thischapter|@thispage|@thistitle
3858 % @evenfooting @thisfile||
3859 % @oddfooting ||@thisfile
3862 \def\evenheading{\parsearg\evenheadingxxx}
3863 \def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish}
3864 \def\evenheadingyyy #1\|#2\|#3\|#4\finish{%
3865 \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}
3866 \global\evenchapheadline=\evenheadline}
3868 \def\oddheading{\parsearg\oddheadingxxx}
3869 \def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish}
3870 \def\oddheadingyyy #1\|#2\|#3\|#4\finish{%
3871 \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}%
3872 \global\oddchapheadline=\oddheadline}
3874 \parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}%
3876 \def\evenfooting{\parsearg\evenfootingxxx}
3877 \def\evenfootingxxx #1{\evenfootingyyy #1\|\|\|\|\finish}
3878 \def\evenfootingyyy #1\|#2\|#3\|#4\finish{%
3879 \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
3881 \def\oddfooting{\parsearg\oddfootingxxx}
3882 \def\oddfootingxxx #1{\oddfootingyyy #1\|\|\|\|\finish}
3883 \def\oddfootingyyy #1\|#2\|#3\|#4\finish{%
3884 \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}%
3886 % Leave some space for the footline. Hopefully ok to assume
3887 % @evenfooting will not be used by itself.
3888 \global\advance\txipageheight by -12pt
3889 \global\advance\vsize by -12pt
3892 \parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}}
3894 % @evenheadingmarks top \thischapter <- chapter at the top of a page
3895 % @evenheadingmarks bottom \thischapter <- chapter at the bottom of a page
3897 % The same set of arguments for:
3899 % @oddheadingmarks
3900 % @evenfootingmarks
3901 % @oddfootingmarks
3902 % @everyheadingmarks
3903 % @everyfootingmarks
3905 % These define \getoddheadingmarks, \getevenheadingmarks,
3906 % \getoddfootingmarks, and \getevenfootingmarks, each to one of
3907 % \gettopheadingmarks, \getbottomheadingmarks.
3909 \def\evenheadingmarks{\headingmarks{even}{heading}}
3910 \def\oddheadingmarks{\headingmarks{odd}{heading}}
3911 \def\evenfootingmarks{\headingmarks{even}{footing}}
3912 \def\oddfootingmarks{\headingmarks{odd}{footing}}
3913 \parseargdef\everyheadingmarks{\headingmarks{even}{heading}{#1}
3914 \headingmarks{odd}{heading}{#1} }
3915 \parseargdef\everyfootingmarks{\headingmarks{even}{footing}{#1}
3916 \headingmarks{odd}{footing}{#1} }
3917 % #1 = even/odd, #2 = heading/footing, #3 = top/bottom.
3918 \def\headingmarks#1#2#3 {%
3919 \expandafter\let\expandafter\temp \csname get#3headingmarks\endcsname
3920 \global\expandafter\let\csname get#1#2marks\endcsname \temp
3923 \everyheadingmarks bottom
3924 \everyfootingmarks bottom
3926 % @headings double turns headings on for double-sided printing.
3927 % @headings single turns headings on for single-sided printing.
3928 % @headings off turns them off.
3929 % @headings on same as @headings double, retained for compatibility.
3930 % @headings after turns on double-sided headings after this page.
3931 % @headings doubleafter turns on double-sided headings after this page.
3932 % @headings singleafter turns on single-sided headings after this page.
3933 % By default, they are off at the start of a document,
3934 % and turned `on' after @end titlepage.
3936 \parseargdef\headings{\csname HEADINGS#1\endcsname}
3938 \def\headingsoff{% non-global headings elimination
3939 \evenheadline={\hfil}\evenfootline={\hfil}\evenchapheadline={\hfil}%
3940 \oddheadline={\hfil}\oddfootline={\hfil}\oddchapheadline={\hfil}%
3943 \def\HEADINGSoff{{\globaldefs=1 \headingsoff}} % global setting
3945 % Set the page number to 1.
3946 \def\pageone{
3947 \global\pageno=1
3948 \global\arabiccount = \pagecount
3951 \let\contentsalignmacro = \chappager
3953 % \def\HEADINGSon{\HEADINGSdouble} % defined by \CHAPPAGon
3955 % For double-sided printing, put current file name in lower left corner,
3956 % chapter name on inside top of right hand pages, document
3957 % title on inside top of left hand pages, and page numbers on outside top
3958 % edge of all pages.
3959 \def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdouble}
3960 \let\HEADINGSdoubleafter=\HEADINGSafter
3961 \def\HEADINGSdouble{%
3962 \global\evenfootline={\hfil}
3963 \global\oddfootline={\hfil}
3964 \global\evenheadline={\line{\folio\hfil\thistitle}}
3965 \global\oddheadline={\line{\thischapter\hfil\folio}}
3966 \global\evenchapheadline={\line{\folio\hfil\thistitle}}
3967 \global\oddchapheadline={\line{\hfil\folio}}
3968 \global\let\contentsalignmacro = \chapoddpage
3971 % For single-sided printing, chapter title goes across top left of page,
3972 % page number on top right.
3973 \def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsingle}
3974 \def\HEADINGSsingle{%
3975 \global\evenfootline={\hfil}
3976 \global\oddfootline={\hfil}
3977 \global\evenheadline={\line{\thischapter\hfil\folio}}
3978 \global\oddheadline={\line{\thischapter\hfil\folio}}
3979 \global\evenchapheadline={\line{\hfil\folio}}
3980 \global\oddchapheadline={\line{\hfil\folio}}
3981 \global\let\contentsalignmacro = \chappager
3984 % for @setchapternewpage off
3985 \def\HEADINGSsinglechapoff{%
3986 \global\evenfootline={\hfil}
3987 \global\oddfootline={\hfil}
3988 \global\evenheadline={\line{\thischapter\hfil\folio}}
3989 \global\oddheadline={\line{\thischapter\hfil\folio}}
3990 \global\evenchapheadline=\evenheadline
3991 \global\oddchapheadline=\oddheadline
3992 \global\let\contentsalignmacro = \chappager
3995 % Subroutines used in generating headings
3996 % This produces Day Month Year style of output.
3997 % Only define if not already defined, in case a txi-??.tex file has set
3998 % up a different format (e.g., txi-cs.tex does this).
3999 \ifx\today\thisisundefined
4000 \def\today{%
4001 \number\day\space
4002 \ifcase\month
4003 \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr
4004 \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug
4005 \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec
4007 \space\number\year}
4010 % @settitle line... specifies the title of the document, for headings.
4011 % It generates no output of its own.
4012 \def\thistitle{\putwordNoTitle}
4013 \def\settitle{\parsearg{\gdef\thistitle}}
4016 \message{tables,}
4017 % Tables -- @table, @ftable, @vtable, @item(x).
4019 % default indentation of table text
4020 \newdimen\tableindent \tableindent=.8in
4021 % default indentation of @itemize and @enumerate text
4022 \newdimen\itemindent \itemindent=.3in
4023 % margin between end of table item and start of table text.
4024 \newdimen\itemmargin \itemmargin=.1in
4026 % used internally for \itemindent minus \itemmargin
4027 \newdimen\itemmax
4029 % Note @table, @ftable, and @vtable define @item, @itemx, etc., with
4030 % these defs.
4031 % They also define \itemindex
4032 % to index the item name in whatever manner is desired (perhaps none).
4034 \newif\ifitemxneedsnegativevskip
4036 \def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi}
4038 \def\internalBitem{\smallbreak \parsearg\itemzzz}
4039 \def\internalBitemx{\itemxpar \parsearg\itemzzz}
4041 \def\itemzzz #1{\begingroup %
4042 \advance\hsize by -\rightskip
4043 \advance\hsize by -\tableindent
4044 \setbox0=\hbox{\itemindicate{#1}}%
4045 \itemindex{#1}%
4046 \nobreak % This prevents a break before @itemx.
4048 % If the item text does not fit in the space we have, put it on a line
4049 % by itself, and do not allow a page break either before or after that
4050 % line. We do not start a paragraph here because then if the next
4051 % command is, e.g., @kindex, the whatsit would get put into the
4052 % horizontal list on a line by itself, resulting in extra blank space.
4053 \ifdim \wd0>\itemmax
4055 % Make this a paragraph so we get the \parskip glue and wrapping,
4056 % but leave it ragged-right.
4057 \begingroup
4058 \advance\leftskip by-\tableindent
4059 \advance\hsize by\tableindent
4060 \advance\rightskip by0pt plus1fil\relax
4061 \leavevmode\unhbox0\par
4062 \endgroup
4064 % We're going to be starting a paragraph, but we don't want the
4065 % \parskip glue -- logically it's part of the @item we just started.
4066 \nobreak \vskip-\parskip
4068 % Stop a page break at the \parskip glue coming up. However, if
4069 % what follows is an environment such as @example, there will be no
4070 % \parskip glue; then the negative vskip we just inserted would
4071 % cause the example and the item to crash together. So we use this
4072 % bizarre value of 10001 as a signal to \aboveenvbreak to insert
4073 % \parskip glue after all. Section titles are handled this way also.
4075 \penalty 10001
4076 \endgroup
4077 \itemxneedsnegativevskipfalse
4078 \else
4079 % The item text fits into the space. Start a paragraph, so that the
4080 % following text (if any) will end up on the same line.
4081 \noindent
4082 % Do this with kerns and \unhbox so that if there is a footnote in
4083 % the item text, it can migrate to the main vertical list and
4084 % eventually be printed.
4085 \nobreak\kern-\tableindent
4086 \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0
4087 \unhbox0
4088 \nobreak\kern\dimen0
4089 \endgroup
4090 \itemxneedsnegativevskiptrue
4094 \def\item{\errmessage{@item while not in a list environment}}
4095 \def\itemx{\errmessage{@itemx while not in a list environment}}
4097 % @table, @ftable, @vtable.
4098 \envdef\table{%
4099 \let\itemindex\gobble
4100 \tablecheck{table}%
4102 \envdef\ftable{%
4103 \def\itemindex ##1{\doind {fn}{\code{##1}}}%
4104 \tablecheck{ftable}%
4106 \envdef\vtable{%
4107 \def\itemindex ##1{\doind {vr}{\code{##1}}}%
4108 \tablecheck{vtable}%
4110 \def\tablecheck#1{%
4111 \ifnum \the\catcode`\^^M=\active
4112 \endgroup
4113 \errmessage{This command won't work in this context; perhaps the problem is
4114 that we are \inenvironment\thisenv}%
4115 \def\next{\doignore{#1}}%
4116 \else
4117 \let\next\tablex
4119 \next
4121 \def\tablex#1{%
4122 \def\itemindicate{#1}%
4123 \parsearg\tabley
4125 \def\tabley#1{%
4127 \makevalueexpandable
4128 \edef\temp{\noexpand\tablez #1\space\space\space}%
4129 \expandafter
4130 }\temp \endtablez
4132 \def\tablez #1 #2 #3 #4\endtablez{%
4133 \aboveenvbreak
4134 \ifnum 0#1>0 \advance \leftskip by #1\mil \fi
4135 \ifnum 0#2>0 \tableindent=#2\mil \fi
4136 \ifnum 0#3>0 \advance \rightskip by #3\mil \fi
4137 \itemmax=\tableindent
4138 \advance \itemmax by -\itemmargin
4139 \advance \leftskip by \tableindent
4140 \exdentamount=\tableindent
4141 \parindent = 0pt
4142 \parskip = \smallskipamount
4143 \ifdim \parskip=0pt \parskip=2pt \fi
4144 \let\item = \internalBitem
4145 \let\itemx = \internalBitemx
4147 \def\Etable{\endgraf\afterenvbreak}
4148 \let\Eftable\Etable
4149 \let\Evtable\Etable
4150 \let\Eitemize\Etable
4151 \let\Eenumerate\Etable
4153 % This is the counter used by @enumerate, which is really @itemize
4155 \newcount \itemno
4157 \envdef\itemize{\parsearg\doitemize}
4159 \def\doitemize#1{%
4160 \aboveenvbreak
4161 \itemmax=\itemindent
4162 \advance\itemmax by -\itemmargin
4163 \advance\leftskip by \itemindent
4164 \exdentamount=\itemindent
4165 \parindent=0pt
4166 \parskip=\smallskipamount
4167 \ifdim\parskip=0pt \parskip=2pt \fi
4169 % Try typesetting the item mark so that if the document erroneously says
4170 % something like @itemize @samp (intending @table), there's an error
4171 % right away at the @itemize. It's not the best error message in the
4172 % world, but it's better than leaving it to the @item. This means if
4173 % the user wants an empty mark, they have to say @w{} not just @w.
4174 \def\itemcontents{#1}%
4175 \setbox0 = \hbox{\itemcontents}%
4177 % @itemize with no arg is equivalent to @itemize @bullet.
4178 \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi
4180 \let\item=\itemizeitem
4183 % Definition of @item while inside @itemize and @enumerate.
4185 \def\itemizeitem{%
4186 \advance\itemno by 1 % for enumerations
4187 {\let\par=\endgraf \smallbreak}% reasonable place to break
4189 % If the document has an @itemize directly after a section title, a
4190 % \nobreak will be last on the list, and \sectionheading will have
4191 % done a \vskip-\parskip. In that case, we don't want to zero
4192 % parskip, or the item text will crash with the heading. On the
4193 % other hand, when there is normal text preceding the item (as there
4194 % usually is), we do want to zero parskip, or there would be too much
4195 % space. In that case, we won't have a \nobreak before. At least
4196 % that's the theory.
4197 \ifnum\lastpenalty<10000 \parskip=0in \fi
4198 \noindent
4199 \hbox to 0pt{\hss \itemcontents \kern\itemmargin}%
4201 \ifinner\else
4202 \vadjust{\penalty 1200}% not good to break after first line of item.
4204 % We can be in inner vertical mode in a footnote, although an
4205 % @itemize looks awful there.
4207 \flushcr
4210 % \splitoff TOKENS\endmark defines \first to be the first token in
4211 % TOKENS, and \rest to be the remainder.
4213 \def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
4215 % Allow an optional argument of an uppercase letter, lowercase letter,
4216 % or number, to specify the first label in the enumerated list. No
4217 % argument is the same as `1'.
4219 \envparseargdef\enumerate{\enumeratey #1 \endenumeratey}
4220 \def\enumeratey #1 #2\endenumeratey{%
4221 % If we were given no argument, pretend we were given `1'.
4222 \def\thearg{#1}%
4223 \ifx\thearg\empty \def\thearg{1}\fi
4225 % Detect if the argument is a single token. If so, it might be a
4226 % letter. Otherwise, the only valid thing it can be is a number.
4227 % (We will always have one token, because of the test we just made.
4228 % This is a good thing, since \splitoff doesn't work given nothing at
4229 % all -- the first parameter is undelimited.)
4230 \expandafter\splitoff\thearg\endmark
4231 \ifx\rest\empty
4232 % Only one token in the argument. It could still be anything.
4233 % A ``lowercase letter'' is one whose \lccode is nonzero.
4234 % An ``uppercase letter'' is one whose \lccode is both nonzero, and
4235 % not equal to itself.
4236 % Otherwise, we assume it's a number.
4238 % We need the \relax at the end of the \ifnum lines to stop TeX from
4239 % continuing to look for a <number>.
4241 \ifnum\lccode\expandafter`\thearg=0\relax
4242 \numericenumerate % a number (we hope)
4243 \else
4244 % It's a letter.
4245 \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax
4246 \lowercaseenumerate % lowercase letter
4247 \else
4248 \uppercaseenumerate % uppercase letter
4251 \else
4252 % Multiple tokens in the argument. We hope it's a number.
4253 \numericenumerate
4257 % An @enumerate whose labels are integers. The starting integer is
4258 % given in \thearg.
4260 \def\numericenumerate{%
4261 \itemno = \thearg
4262 \startenumeration{\the\itemno}%
4265 % The starting (lowercase) letter is in \thearg.
4266 \def\lowercaseenumerate{%
4267 \itemno = \expandafter`\thearg
4268 \startenumeration{%
4269 % Be sure we're not beyond the end of the alphabet.
4270 \ifnum\itemno=0
4271 \errmessage{No more lowercase letters in @enumerate; get a bigger
4272 alphabet}%
4274 \char\lccode\itemno
4278 % The starting (uppercase) letter is in \thearg.
4279 \def\uppercaseenumerate{%
4280 \itemno = \expandafter`\thearg
4281 \startenumeration{%
4282 % Be sure we're not beyond the end of the alphabet.
4283 \ifnum\itemno=0
4284 \errmessage{No more uppercase letters in @enumerate; get a bigger
4285 alphabet}
4287 \char\uccode\itemno
4291 % Call \doitemize, adding a period to the first argument and supplying the
4292 % common last two arguments. Also subtract one from the initial value in
4293 % \itemno, since @item increments \itemno.
4295 \def\startenumeration#1{%
4296 \advance\itemno by -1
4297 \doitemize{#1.}\flushcr
4301 % @multitable macros
4303 % Macros used to set up halign preamble:
4305 \let\endsetuptable\relax
4306 \def\xendsetuptable{\endsetuptable}
4307 \let\columnfractions\relax
4308 \def\xcolumnfractions{\columnfractions}
4309 \newif\ifsetpercent
4311 % #1 is the @columnfraction, usually a decimal number like .5, but might
4312 % be just 1. We just use it, whatever it is.
4314 \def\pickupwholefraction#1 {%
4315 \global\advance\colcount by 1
4316 \expandafter\xdef\csname col\the\colcount\endcsname{#1\hsize}%
4317 \setuptable
4320 \newcount\colcount
4321 \def\setuptable#1{%
4322 \def\firstarg{#1}%
4323 \ifx\firstarg\xendsetuptable
4324 \let\go = \relax
4325 \else
4326 \ifx\firstarg\xcolumnfractions
4327 \global\setpercenttrue
4328 \else
4329 \ifsetpercent
4330 \let\go\pickupwholefraction
4331 \else
4332 \global\advance\colcount by 1
4333 \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a
4334 % separator; typically that is always in the input, anyway.
4335 \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
4338 \ifx\go\pickupwholefraction
4339 % Put the argument back for the \pickupwholefraction call, so
4340 % we'll always have a period there to be parsed.
4341 \def\go{\pickupwholefraction#1}%
4342 \else
4343 \let\go = \setuptable
4344 \fi%
4349 % @headitem starts a heading row, which we typeset in bold. Assignments
4350 % have to be global since we are inside the implicit group of an
4351 % alignment entry. \everycr below resets \everytab so we don't have to
4352 % undo it ourselves.
4353 \def\headitemfont{\b}% for people to use in the template row; not changeable
4354 \def\headitem{%
4355 \crcr % must appear first
4356 \gdef\headitemcrhook{\nobreak}% attempt to avoid page break after headings
4357 \global\everytab={\bf}% can't use \headitemfont since the parsing differs
4358 \the\everytab % for the first item
4361 % default for tables with no headings.
4362 \let\headitemcrhook=\relax
4364 \def\tab{\checkenv\multitable &\the\everytab}%
4366 \newtoks\everytab % insert after every tab.
4368 \envdef\multitable{%
4369 \vskip\parskip
4370 \startsavinginserts
4372 % @item within a multitable starts a normal row.
4373 % We use \def instead of \let so that if one of the multitable entries
4374 % contains an @itemize, we don't choke on the \item (seen as \crcr aka
4375 % \endtemplate) expanding \doitemize.
4376 \def\item{\crcr}%
4378 \tolerance=9500
4379 \hbadness=9500
4380 \parskip=0pt
4381 \parindent=6pt
4382 \overfullrule=0pt
4383 \global\colcount=0
4385 \everycr = {%
4386 \noalign{%
4387 \global\everytab={}% Reset from possible headitem.
4388 \global\colcount=0 % Reset the column counter.
4390 % Check for saved footnotes, etc.:
4391 \checkinserts
4393 % Perhaps a \nobreak, then reset:
4394 \headitemcrhook
4395 \global\let\headitemcrhook=\relax
4399 \parsearg\domultitable
4401 \def\domultitable#1{%
4402 % To parse everything between @multitable and @item:
4403 \setuptable#1 \endsetuptable
4405 % This preamble sets up a generic column definition, which will
4406 % be used as many times as user calls for columns.
4407 % \vtop will set a single line and will also let text wrap and
4408 % continue for many paragraphs if desired.
4409 \halign\bgroup &%
4410 \global\advance\colcount by 1
4411 \strut
4412 \vtop{%
4413 \advance\hsize by -1\leftskip
4414 % Find the correct column width
4415 \hsize=\expandafter\csname col\the\colcount\endcsname
4417 \advance\rightskip by -1\rightskip % Zero leaving only any stretch
4418 \ifnum\colcount=1
4419 \advance\hsize by\leftskip % Add indent of surrounding text
4420 \else
4421 % In order to keep entries from bumping into each other.
4422 \leftskip=12pt
4423 \ifsetpercent \else
4424 % If a template has been used
4425 \advance\hsize by \leftskip
4428 \noindent\ignorespaces##\unskip\strut
4429 }\cr
4431 \def\Emultitable{%
4432 \crcr
4433 \egroup % end the \halign
4434 \global\setpercentfalse
4438 \message{conditionals,}
4440 % @iftex, @ifnotdocbook, @ifnothtml, @ifnotinfo, @ifnotlatex, @ifnotplaintext,
4441 % @ifnotxml always succeed. They currently do nothing; we don't
4442 % attempt to check whether the conditionals are properly nested. But we
4443 % have to remember that they are conditionals, so that @end doesn't
4444 % attempt to close an environment group.
4446 \def\makecond#1{%
4447 \expandafter\let\csname #1\endcsname = \relax
4448 \expandafter\let\csname iscond.#1\endcsname = 1
4450 \makecond{iftex}
4451 \makecond{ifnotdocbook}
4452 \makecond{ifnothtml}
4453 \makecond{ifnotinfo}
4454 \makecond{ifnotlatex}
4455 \makecond{ifnotplaintext}
4456 \makecond{ifnotxml}
4458 % Ignore @ignore, @ifhtml, @ifinfo, and the like.
4460 \def\direntry{\doignore{direntry}}
4461 \def\documentdescription{\doignore{documentdescription}}
4462 \def\docbook{\doignore{docbook}}
4463 \def\html{\doignore{html}}
4464 \def\ifdocbook{\doignore{ifdocbook}}
4465 \def\ifhtml{\doignore{ifhtml}}
4466 \def\ifinfo{\doignore{ifinfo}}
4467 \def\iflatex{\doignore{iflatex}}
4468 \def\ifnottex{\doignore{ifnottex}}
4469 \def\ifplaintext{\doignore{ifplaintext}}
4470 \def\ifxml{\doignore{ifxml}}
4471 \def\ignore{\doignore{ignore}}
4472 \def\latex{\doignore{latex}}
4473 \def\menu{\doignore{menu}}
4474 \def\xml{\doignore{xml}}
4476 % Ignore text until a line `@end #1', keeping track of nested conditionals.
4478 % A count to remember the depth of nesting.
4479 \newcount\doignorecount
4481 \def\doignore#1{\begingroup
4482 % Scan in ``verbatim'' mode:
4483 \obeylines
4484 \catcode`\@ = \other
4485 \catcode`\{ = \other
4486 \catcode`\} = \other
4488 % Make sure that spaces turn into tokens that match what \doignoretext wants.
4489 \spaceisspace
4491 % Count number of #1's that we've seen.
4492 \doignorecount = 0
4494 % Swallow text until we reach the matching `@end #1'.
4495 \dodoignore{#1}%
4498 { \catcode`_=11 % We want to use \_STOP_ which cannot appear in texinfo source.
4499 \obeylines %
4501 \gdef\dodoignore#1{%
4502 % #1 contains the command name as a string, e.g., `ifinfo'.
4504 % Define a command to find the next `@end #1'.
4505 \long\def\doignoretext##1^^M@end #1{%
4506 \doignoretextyyy##1^^M@#1\_STOP_}%
4508 % And this command to find another #1 command, at the beginning of a
4509 % line. (Otherwise, we would consider a line `@c @ifset', for
4510 % example, to count as an @ifset for nesting.)
4511 \long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}%
4513 % And now expand that command.
4514 \doignoretext ^^M%
4518 \def\doignoreyyy#1{%
4519 \def\temp{#1}%
4520 \ifx\temp\empty % Nothing found.
4521 \let\next\doignoretextzzz
4522 \else % Found a nested condition, ...
4523 \advance\doignorecount by 1
4524 \let\next\doignoretextyyy % ..., look for another.
4525 % If we're here, #1 ends with ^^M\ifinfo (for example).
4527 \next #1% the token \_STOP_ is present just after this macro.
4530 % We have to swallow the remaining "\_STOP_".
4532 \def\doignoretextzzz#1{%
4533 \ifnum\doignorecount = 0 % We have just found the outermost @end.
4534 \let\next\enddoignore
4535 \else % Still inside a nested condition.
4536 \advance\doignorecount by -1
4537 \let\next\doignoretext % Look for the next @end.
4539 \next
4542 % Finish off ignored text.
4543 { \obeylines%
4544 % Ignore anything after the last `@end #1'; this matters in verbatim
4545 % environments, where otherwise the newline after an ignored conditional
4546 % would result in a blank line in the output.
4547 \gdef\enddoignore#1^^M{\endgroup\ignorespaces}%
4551 % @set VAR sets the variable VAR to an empty value.
4552 % @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
4554 % Since we want to separate VAR from REST-OF-LINE (which might be
4555 % empty), we can't just use \parsearg; we have to insert a space of our
4556 % own to delimit the rest of the line, and then take it out again if we
4557 % didn't need it.
4558 % We rely on the fact that \parsearg sets \catcode`\ =10.
4560 \parseargdef\set{\setyyy#1 \endsetyyy}
4561 \def\setyyy#1 #2\endsetyyy{%
4563 \makevalueexpandable
4564 \def\temp{#2}%
4565 \edef\next{\gdef\makecsname{SET#1}}%
4566 \ifx\temp\empty
4567 \next{}%
4568 \else
4569 \setzzz#2\endsetzzz
4573 % Remove the trailing space \setxxx inserted.
4574 \def\setzzz#1 \endsetzzz{\next{#1}}
4576 % @clear VAR clears (i.e., unsets) the variable VAR.
4578 \parseargdef\clear{%
4580 \makevalueexpandable
4581 \global\expandafter\let\csname SET#1\endcsname=\relax
4585 % @value{foo} gets the text saved in variable foo.
4586 \def\value{\begingroup\makevalueexpandable\valuexxx}
4587 \def\valuexxx#1{\expandablevalue{#1}\endgroup}
4589 \catcode`\-=\active \catcode`\_=\active
4591 \gdef\makevalueexpandable{%
4592 \let\value = \expandablevalue
4593 % We don't want these characters active, ...
4594 \catcode`\-=\other \catcode`\_=\other
4595 % ..., but we might end up with active ones in the argument if
4596 % we're called from @code, as @code{@value{foo-bar_}}, though.
4597 % So \let them to their normal equivalents.
4598 \let-\normaldash \let_\normalunderscore
4602 \def\expandablevalue#1{%
4603 \expandafter\ifx\csname SET#1\endcsname\relax
4604 {[No value for ``#1'']}%
4605 \message{Variable `#1', used in @value, is not set.}%
4606 \else
4607 \csname SET#1\endcsname
4611 % Like \expandablevalue, but completely expandable (the \message in the
4612 % definition above operates at the execution level of TeX). Used when
4613 % writing to auxiliary files, due to the expansion that \write does.
4614 % If flag is undefined, pass through an unexpanded @value command: maybe it
4615 % will be set by the time it is read back in.
4617 % NB flag names containing - or _ may not work here.
4618 \def\dummyvalue#1{%
4619 \expandafter\ifx\csname SET#1\endcsname\relax
4620 \string\value{#1}%
4621 \else
4622 \csname SET#1\endcsname
4626 % Used for @value's in index entries to form the sort key: expand the @value
4627 % if possible, otherwise sort late.
4628 \def\indexnofontsvalue#1{%
4629 \expandafter\ifx\csname SET#1\endcsname\relax
4630 ZZZZZZZ%
4631 \else
4632 \csname SET#1\endcsname
4636 % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
4637 % with @set.
4639 % To get the special treatment we need for `@end ifset,' we call
4640 % \makecond and then redefine.
4642 \makecond{ifset}
4643 \def\ifset{\parsearg{\doifset{\let\next=\ifsetfail}}}
4644 \def\doifset#1#2{%
4646 \makevalueexpandable
4647 \let\next=\empty
4648 \expandafter\ifx\csname SET#2\endcsname\relax
4649 #1% If not set, redefine \next.
4651 \expandafter
4652 }\next
4654 \def\ifsetfail{\doignore{ifset}}
4656 % @ifclear VAR ... @end executes the `...' iff VAR has never been
4657 % defined with @set, or has been undefined with @clear.
4659 % The `\else' inside the `\doifset' parameter is a trick to reuse the
4660 % above code: if the variable is not set, do nothing, if it is set,
4661 % then redefine \next to \ifclearfail.
4663 \makecond{ifclear}
4664 \def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}}
4665 \def\ifclearfail{\doignore{ifclear}}
4667 % @ifcommandisdefined CMD ... @end executes the `...' if CMD (written
4668 % without the @) is in fact defined. We can only feasibly check at the
4669 % TeX level, so something like `mathcode' is going to considered
4670 % defined even though it is not a Texinfo command.
4672 \makecond{ifcommanddefined}
4673 \def\ifcommanddefined{\parsearg{\doifcmddefined{\let\next=\ifcmddefinedfail}}}
4675 \def\doifcmddefined#1#2{{%
4676 \makevalueexpandable
4677 \let\next=\empty
4678 \expandafter\ifx\csname #2\endcsname\relax
4679 #1% If not defined, \let\next as above.
4681 \expandafter
4682 }\next
4684 \def\ifcmddefinedfail{\doignore{ifcommanddefined}}
4686 % @ifcommandnotdefined CMD ... handled similar to @ifclear above.
4687 \makecond{ifcommandnotdefined}
4688 \def\ifcommandnotdefined{%
4689 \parsearg{\doifcmddefined{\else \let\next=\ifcmdnotdefinedfail}}}
4690 \def\ifcmdnotdefinedfail{\doignore{ifcommandnotdefined}}
4692 % Set the `txicommandconditionals' variable, so documents have a way to
4693 % test if the @ifcommand...defined conditionals are available.
4694 \set txicommandconditionals
4696 % @dircategory CATEGORY -- specify a category of the dir file
4697 % which this file should belong to. Ignore this in TeX.
4698 \let\dircategory=\comment
4700 % @defininfoenclose.
4701 \let\definfoenclose=\comment
4704 \message{indexing,}
4705 % Index generation facilities
4707 % Define \newwrite to be identical to plain tex's \newwrite
4708 % except not \outer, so it can be used within macros and \if's.
4709 \edef\newwrite{\makecsname{ptexnewwrite}}
4711 % \newindex {IX} defines an index named IX.
4712 % It automatically defines \IXindex such that
4713 % \IXindex ...rest of line... puts an entry in the index IX.
4714 % It also defines \IXindfile to be the number of the output channel for
4715 % the file that accumulates this index. The file's extension is IX.
4717 \def\newindex#1{%
4718 \expandafter\chardef\csname#1indfile\endcsname=0
4719 \expandafter\xdef\csname#1index\endcsname{% % Define @#1index
4720 \noexpand\doindex{#1}}
4723 % @defindex foo == \newindex{foo}
4725 \def\defindex{\parsearg\newindex}
4727 % Define @defcodeindex, like @defindex except put all entries in @code.
4729 \def\defcodeindex{\parsearg\newcodeindex}
4731 \def\newcodeindex#1{%
4732 \expandafter\chardef\csname#1indfile\endcsname=0
4733 \expandafter\xdef\csname#1index\endcsname{%
4734 \noexpand\docodeindex{#1}}%
4737 % The default indices:
4738 \newindex{cp}% concepts,
4739 \newcodeindex{fn}% functions,
4740 \newcodeindex{vr}% variables,
4741 \newcodeindex{tp}% types,
4742 \newcodeindex{ky}% keys
4743 \newcodeindex{pg}% and programs.
4746 % @synindex foo bar makes index foo feed into index bar.
4747 % Do this instead of @defindex foo if you don't want it as a separate index.
4749 % @syncodeindex foo bar similar, but put all entries made for index foo
4750 % inside @code.
4752 \def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}}
4753 \def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}}
4755 % #1 is \doindex or \docodeindex, #2 the index getting redefined (foo),
4756 % #3 the target index (bar).
4757 \def\dosynindex#1#2#3{%
4758 \requireopenindexfile{#3}%
4759 % redefine \fooindfile:
4760 \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname
4761 \expandafter\let\csname#2indfile\endcsname=\temp
4762 % redefine \fooindex:
4763 \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}%
4766 % Define \doindex, the driver for all index macros.
4767 % Argument #1 is generated by the calling \fooindex macro,
4768 % and it is the two-letter name of the index.
4770 \def\doindex#1{\edef\indexname{#1}\parsearg\doindexxxx}
4771 \def\doindexxxx #1{\doind{\indexname}{#1}}
4773 % like the previous two, but they put @code around the argument.
4774 \def\docodeindex#1{\edef\indexname{#1}\parsearg\docodeindexxxx}
4775 \def\docodeindexxxx #1{\docind{\indexname}{#1}}
4778 % \definedummyword defines \#1 as \string\#1\space, thus effectively
4779 % preventing its expansion. This is used only for control words,
4780 % not control letters, because the \space would be incorrect for
4781 % control characters, but is needed to separate the control word
4782 % from whatever follows.
4784 % These can be used both for control words that take an argument and
4785 % those that do not. If it is followed by {arg} in the input, then
4786 % that will dutifully get written to the index (or wherever).
4788 % For control letters, we have \definedummyletter, which omits the
4789 % space.
4791 \def\definedummyword #1{\def#1{\string#1\space}}%
4792 \def\definedummyletter#1{\def#1{\string#1}}%
4794 % Used for the aux, toc and index files to prevent expansion of Texinfo
4795 % commands. Most of the commands are controlled through the
4796 % \ifdummies conditional.
4798 \def\atdummies{%
4799 \dummiestrue
4801 \definedummyletter\@%
4802 \definedummyletter\ %
4803 \definedummyletter\{%
4804 \definedummyletter\}%
4805 \definedummyletter\&%
4807 \definedummyletter\_%
4808 \definedummyletter\-%
4810 \definedummyword\subentry
4812 % We want to disable all macros so that they are not expanded by \write.
4813 \let\commondummyword\definedummyword
4814 \macrolist
4815 \let\value\dummyvalue
4817 \turnoffactive
4820 \newif\ifdummies
4821 \newif\ifindexnofonts
4823 \def\commondummyletter#1{%
4824 \expandafter\let\csname\string#1:impl\endcsname#1%
4825 \edef#1{%
4826 \noexpand\ifindexnofonts
4827 % empty expansion
4828 \noexpand\else
4829 \noexpand\ifdummies\string#1%
4830 \noexpand\else
4831 \noexpand\jumptwofi % dispose of the \fi
4832 \expandafter\noexpand\csname\string#1:impl\endcsname
4833 \noexpand\fi
4834 \noexpand\fi}%
4837 \def\commondummyaccent#1{%
4838 \expandafter\let\csname\string#1:impl\endcsname#1%
4839 \edef#1{%
4840 \noexpand\ifindexnofonts
4841 \noexpand\expandafter % dispose of \else ... \fi
4842 \noexpand\asis
4843 \noexpand\else
4844 \noexpand\ifdummies\string#1%
4845 \noexpand\else
4846 \noexpand\jumptwofi % dispose of the \fi
4847 \expandafter\noexpand\csname\string#1:impl\endcsname
4848 \noexpand\fi
4849 \noexpand\fi}%
4852 % Like \commondummyaccent but add a \space at the end of the dummy expansion
4853 % #2 is the expansion used for \indexnofonts. #2 is always followed by
4854 % \asis to remove a pair of following braces.
4855 \def\commondummyword#1#2{%
4856 \expandafter\let\csname\string#1:impl\endcsname#1%
4857 \expandafter\def\csname\string#1:ixnf\endcsname{#2\asis}%
4858 \edef#1{%
4859 \noexpand\ifindexnofonts
4860 \noexpand\expandafter % dispose of \else ... \fi
4861 \expandafter\noexpand\csname\string#1:ixnf\endcsname
4862 \noexpand\else
4863 \noexpand\ifdummies\string#1\space
4864 \noexpand\else
4865 \noexpand\jumptwofi % dispose of the \fi \fi
4866 \expandafter\noexpand\csname\string#1:impl\endcsname
4867 \noexpand\fi
4868 \noexpand\fi}%
4870 \def\jumptwofi#1\fi\fi{\fi\fi#1}
4872 % For \atdummies and \indexnofonts. \atdummies sets
4873 % \dummiestrue and \indexnofonts sets \indexnofontstrue.
4874 \def\definedummies{
4875 % @-sign is always an escape character when reading auxiliary files
4876 \escapechar = `\@
4878 \commondummyletter\!%
4879 \commondummyaccent\"%
4880 \commondummyaccent\'%
4881 \commondummyletter\*%
4882 \commondummyaccent\,%
4883 \commondummyletter\.%
4884 \commondummyletter\/%
4885 \commondummyletter\:%
4886 \commondummyaccent\=%
4887 \commondummyletter\?%
4888 \commondummyaccent\^%
4889 \commondummyaccent\`%
4890 \commondummyaccent\~%
4892 % Control letters and accents.
4893 \commondummyword\u {}%
4894 \commondummyword\v {}%
4895 \commondummyword\H {}%
4896 \commondummyword\dotaccent {}%
4897 \commondummyword\ogonek {}%
4898 \commondummyword\ringaccent {}%
4899 \commondummyword\tieaccent {}%
4900 \commondummyword\ubaraccent {}%
4901 \commondummyword\udotaccent {}%
4902 \commondummyword\dotless {}%
4904 % Texinfo font commands.
4905 \commondummyword\b {}%
4906 \commondummyword\i {}%
4907 \commondummyword\r {}%
4908 \commondummyword\sansserif {}%
4909 \commondummyword\sc {}%
4910 \commondummyword\slanted {}%
4911 \commondummyword\t {}%
4913 % Commands that take arguments.
4914 \commondummyword\abbr {}%
4915 \commondummyword\acronym {}%
4916 \commondummyword\anchor {}%
4917 \commondummyword\cite {}%
4918 \commondummyword\code {}%
4919 \commondummyword\command {}%
4920 \commondummyword\dfn {}%
4921 \commondummyword\dmn {}%
4922 \commondummyword\email {}%
4923 \commondummyword\emph {}%
4924 \commondummyword\env {}%
4925 \commondummyword\file {}%
4926 \commondummyword\image {}%
4927 \commondummyword\indicateurl{}%
4928 \commondummyword\inforef {}%
4929 \commondummyword\kbd {}%
4930 \commondummyword\key {}%
4931 \commondummyword\link {}%
4932 \commondummyword\math {}%
4933 \commondummyword\option {}%
4934 \commondummyword\pxref {}%
4935 \commondummyword\ref {}%
4936 \commondummyword\samp {}%
4937 \commondummyword\strong {}%
4938 \commondummyword\tie {}%
4939 \commondummyword\U {}%
4940 \commondummyword\uref {}%
4941 \commondummyword\url {}%
4942 \commondummyword\var {}%
4943 \commondummyword\verb {}%
4944 \commondummyword\w {}%
4945 \commondummyword\xref {}%
4947 \commondummyword\AA {AA}%
4948 \commondummyword\AE {AE}%
4949 \commondummyword\DH {DZZ}%
4950 \commondummyword\L {L}%
4951 \commondummyword\O {O}%
4952 \commondummyword\OE {OE}%
4953 \commondummyword\TH {TH}%
4954 \commondummyword\aa {aa}%
4955 \commondummyword\ae {ae}%
4956 \commondummyword\dh {dzz}%
4957 \commondummyword\exclamdown {!}%
4958 \commondummyword\l {l}%
4959 \commondummyword\o {o}%
4960 \commondummyword\oe {oe}%
4961 \commondummyword\ordf {a}%
4962 \commondummyword\ordm {o}%
4963 \commondummyword\questiondown {?}%
4964 \commondummyword\ss {ss}%
4965 \commondummyword\th {th}%
4967 \commondummyword\LaTeX {LaTeX}%
4968 \commondummyword\TeX {TeX}%
4970 % Assorted special characters.
4971 \commondummyword\ampchar {\normalamp}%
4972 \commondummyword\atchar {\@}%
4973 \commondummyword\arrow {->}%
4974 \commondummyword\backslashchar {\realbackslash}%
4975 \commondummyword\bullet {bullet}%
4976 \commondummyword\comma {,}%
4977 \commondummyword\copyright {copyright}%
4978 \commondummyword\dots {...}%
4979 \commondummyword\enddots {...}%
4980 \commondummyword\entrybreak {}%
4981 \commondummyword\equiv {===}%
4982 \commondummyword\error {error}%
4983 \commondummyword\euro {euro}%
4984 \commondummyword\expansion {==>}%
4985 \commondummyword\geq {>=}%
4986 \commondummyword\guillemetleft {<<}%
4987 \commondummyword\guillemetright {>>}%
4988 \commondummyword\guilsinglleft {<}%
4989 \commondummyword\guilsinglright {>}%
4990 \commondummyword\lbracechar {\{}%
4991 \commondummyword\leq {<=}%
4992 \commondummyword\mathopsup {sup}%
4993 \commondummyword\minus {-}%
4994 \commondummyword\pounds {pounds}%
4995 \commondummyword\point {.}%
4996 \commondummyword\print {-|}%
4997 \commondummyword\quotedblbase {"}%
4998 \commondummyword\quotedblleft {"}%
4999 \commondummyword\quotedblright {"}%
5000 \commondummyword\quoteleft {`}%
5001 \commondummyword\quoteright {'}%
5002 \commondummyword\quotesinglbase {,}%
5003 \commondummyword\rbracechar {\}}%
5004 \commondummyword\registeredsymbol {R}%
5005 \commondummyword\result {=>}%
5006 \commondummyword\sub {}%
5007 \commondummyword\sup {}%
5008 \commondummyword\textdegree {o}%
5011 \let\indexlbrace\relax
5012 \let\indexrbrace\relax
5013 \let\indexatchar\relax
5014 \let\indexbackslash\relax
5016 {\catcode`\@=0
5017 \catcode`\\=13
5018 @gdef@backslashdisappear{@def\{}}
5022 \catcode`\<=13
5023 \catcode`\-=13
5024 \catcode`\`=13
5025 \gdef\indexnonalnumdisappear{%
5026 \ifflagclear{txiindexlquoteignore}{}{%
5027 % @set txiindexlquoteignore makes us ignore left quotes in the sort term.
5028 % (Introduced for FSFS 2nd ed.)
5029 \let`=\empty
5032 \ifflagclear{txiindexbackslashignore}{}{%
5033 \backslashdisappear
5035 \ifflagclear{txiindexhyphenignore}{}{%
5036 \def-{}%
5038 \ifflagclear{txiindexlessthanignore}{}{%
5039 \def<{}%
5041 \ifflagclear{txiindexatsignignore}{}{%
5042 \def\@{}%
5046 \gdef\indexnonalnumreappear{%
5047 \let-\normaldash
5048 \let<\normalless
5053 % \indexnofonts is used when outputting the strings to sort the index
5054 % by, and when constructing control sequence names. It eliminates all
5055 % control sequences and just writes whatever the best ASCII sort string
5056 % would be for a given command (usually its argument).
5058 \def\indexnofonts{%
5059 \indexnofontstrue
5061 \def\ { }%
5062 \def\@{@}%
5063 \def\_{\normalunderscore}%
5064 \def\-{}% @- shouldn't affect sorting
5066 \uccode`\1=`\{ \uppercase{\def\{{1}}%
5067 \uccode`\1=`\} \uppercase{\def\}{1}}%
5068 \let\lbracechar\{%
5069 \let\rbracechar\}%
5072 % We need to get rid of all macros, leaving only the arguments (if present).
5073 % Of course this is not nearly correct, but it is the best we can do for now.
5075 % Since macro invocations are followed by braces, we can just redefine them
5076 % to take a single TeX argument. The case of a macro invocation that
5077 % goes to end-of-line is not handled.
5079 \def\commondummyword##1{\let##1\asis}%
5080 \macrolist
5081 \let\value\indexnofontsvalue
5087 % #1 is the index name, #2 is the entry text.
5088 \def\doind#1#2{%
5089 \iflinks
5092 \requireopenindexfile{#1}%
5093 \edef\writeto{\csname#1indfile\endcsname}%
5095 \def\indextext{#2}%
5096 \safewhatsit\doindwrite
5101 % Same as \doind, but for code indices
5102 \def\docind#1#2{%
5103 \iflinks
5106 \requireopenindexfile{#1}%
5107 \edef\writeto{\csname#1indfile\endcsname}%
5109 \def\indextext{#2}%
5110 \safewhatsit\docindwrite
5115 % Check if an index file has been opened, and if not, open it.
5116 \def\requireopenindexfile#1{%
5117 \ifnum\csname #1indfile\endcsname=0
5118 \expandafter\newwrite \csname#1indfile\endcsname
5119 \edef\suffix{#1}%
5120 % A .fls suffix would conflict with the file extension for the output
5121 % of -recorder, so use .f1s instead.
5122 \ifx\suffix\indexisfl\def\suffix{f1}\fi
5123 % Open the file
5124 \immediate\openout\csname#1indfile\endcsname \jobname.\suffix
5125 % Using \immediate above here prevents an object entering into the current
5126 % box, which could confound checks such as those in \safewhatsit for
5127 % preceding skips.
5128 \typeout{Writing index file \jobname.\suffix}%
5129 \fi}
5130 \def\indexisfl{fl}
5132 % Definition for writing index entry sort key.
5134 \catcode`\-=13
5135 \gdef\indexwritesortas{%
5136 \begingroup
5137 \indexnonalnumreappear
5138 \indexwritesortasxxx}
5139 \gdef\indexwritesortasxxx#1{%
5140 \xdef\indexsortkey{#1}\endgroup}
5143 \def\indexwriteseealso#1{
5144 \gdef\pagenumbertext{\string\seealso{#1}}%
5146 \def\indexwriteseeentry#1{
5147 \gdef\pagenumbertext{\string\seeentry{#1}}%
5150 % The default definitions
5151 \def\sortas#1{}%
5152 \def\seealso#1{\i{\putwordSeeAlso}\ #1}% for sorted index file only
5153 \def\putwordSeeAlso{See also}
5154 \def\seeentry#1{\i{\putwordSee}\ #1}% for sorted index file only
5157 % Given index entry text like "aaa @subentry bbb @sortas{ZZZ}":
5158 % * Set \bracedtext to "{aaa}{bbb}"
5159 % * Set \fullindexsortkey to "aaa @subentry ZZZ"
5160 % * If @seealso occurs, set \pagenumbertext
5162 \def\splitindexentry#1{%
5163 \gdef\fullindexsortkey{}%
5164 \xdef\bracedtext{}%
5165 \def\sep{}%
5166 \def\seealso##1{}%
5167 \def\seeentry##1{}%
5168 \expandafter\doindexsegment#1\subentry\finish\subentry
5171 % append the results from the next segment
5172 \def\doindexsegment#1\subentry{%
5173 \def\segment{#1}%
5174 \ifx\segment\isfinish
5175 \else
5177 % Fully expand the segment, throwing away any @sortas directives, and
5178 % trim spaces.
5179 \edef\trimmed{\segment}%
5180 \edef\trimmed{\expandafter\eatspaces\expandafter{\trimmed}}%
5181 \ifincodeindex
5182 \edef\trimmed{\noexpand\code{\trimmed}}%
5185 \xdef\bracedtext{\bracedtext{\trimmed}}%
5187 % Get the string to sort by. Process the segment with all
5188 % font commands turned off.
5189 \bgroup
5190 \let\sortas\indexwritesortas
5191 \let\seealso\indexwriteseealso
5192 \let\seeentry\indexwriteseeentry
5193 \indexnofonts
5194 % The braces around the commands are recognized by texindex.
5195 \def\lbracechar{{\string\indexlbrace}}%
5196 \def\rbracechar{{\string\indexrbrace}}%
5197 \let\{=\lbracechar
5198 \let\}=\rbracechar
5199 \def\@{{\string\indexatchar}}%
5200 \def\atchar##1{\@}%
5201 \def\backslashchar{{\string\indexbackslash}}%
5202 \uccode`\~=`\\ \uppercase{\let~\backslashchar}%
5204 \let\indexsortkey\empty
5205 \global\let\pagenumbertext\empty
5206 % Execute the segment and throw away the typeset output. This executes
5207 % any @sortas or @seealso commands in this segment.
5208 \setbox\dummybox = \hbox{\segment}%
5209 \ifx\indexsortkey\empty{%
5210 \indexnonalnumdisappear
5211 \xdef\trimmed{\segment}%
5212 \xdef\trimmed{\expandafter\eatspaces\expandafter{\trimmed}}%
5213 \xdef\indexsortkey{\trimmed}%
5214 \ifx\indexsortkey\empty
5215 \message{Empty index sort key near line \the\inputlineno}%
5216 \xdef\indexsortkey{ }%
5218 }\fi
5220 % Append to \fullindexsortkey.
5221 \edef\tmp{\gdef\noexpand\fullindexsortkey{%
5222 \fullindexsortkey\sep\indexsortkey}}%
5223 \tmp
5224 \egroup
5225 \def\sep{\subentry}%
5227 \expandafter\doindexsegment
5230 \def\isfinish{\finish}%
5231 \newbox\dummybox % used above
5233 \let\subentry\relax
5235 % Use \ instead of @ in index files. To support old texi2dvi and texindex.
5236 % This works without changing the escape character used in the toc or aux
5237 % files because the index entries are fully expanded here, and \string uses
5238 % the current value of \escapechar.
5239 \def\escapeisbackslash{\escapechar=`\\}
5241 % Use \ in index files by default. texi2dvi didn't support @ as the escape
5242 % character (as it checked for "\entry" in the files, and not "@entry"). When
5243 % the new version of texi2dvi has had a chance to become more prevalent, then
5244 % the escape character can change back to @ again. This should be an easy
5245 % change to make now because both @ and \ are only used as escape characters in
5246 % index files, never standing for themselves.
5248 \set txiindexescapeisbackslash
5250 % Write the entry in \indextext to the index file.
5253 \newif\ifincodeindex
5254 \def\doindwrite{\incodeindexfalse\doindwritex}
5255 \def\docindwrite{\incodeindextrue\doindwritex}
5257 \def\doindwritex{%
5258 \maybemarginindex
5260 \atdummies
5262 \ifflagclear{txiindexescapeisbackslash}{}{\escapeisbackslash}%
5264 % For texindex which always views { and } as separators.
5265 \def\{{\lbracechar{}}%
5266 \def\}{\rbracechar{}}%
5267 \uccode`\~=`\\ \uppercase{\def~{\backslashchar{}}}%
5269 % Split the entry into primary entry and any subentries, and get the index
5270 % sort key.
5271 \splitindexentry\indextext
5273 % Set up the complete index entry, with both the sort key and
5274 % the original text, including any font commands. We write
5275 % three arguments to \entry to the .?? file (four in the
5276 % subentry case), texindex reduces to two when writing the .??s
5277 % sorted result.
5279 \edef\temp{%
5280 \write\writeto{%
5281 \string\entry{\fullindexsortkey}%
5282 {\ifx\pagenumbertext\empty\noexpand\folio\else\pagenumbertext\fi}%
5283 \bracedtext}%
5285 \temp
5288 % Put the index entry in the margin if desired (undocumented).
5289 \def\maybemarginindex{%
5290 \ifx\SETmarginindex\relax\else
5291 \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \relax\indextext}}%
5294 \let\SETmarginindex=\relax
5297 % Take care of unwanted page breaks/skips around a whatsit:
5299 % If a skip is the last thing on the list now, preserve it
5300 % by backing up by \lastskip, doing the \write, then inserting
5301 % the skip again. Otherwise, the whatsit generated by the
5302 % \write or \pdfdest will make \lastskip zero. The result is that
5303 % sequences like this:
5304 % @end defun
5305 % @tindex whatever
5306 % @defun ...
5307 % will have extra space inserted, because the \medbreak in the
5308 % start of the @defun won't see the skip inserted by the @end of
5309 % the previous defun.
5311 % But don't do any of this if we're not in vertical mode. We
5312 % don't want to do a \vskip and prematurely end a paragraph.
5314 % Avoid page breaks due to these extra skips, too.
5316 % But wait, there is a catch there:
5317 % We'll have to check whether \lastskip is zero skip. \ifdim is not
5318 % sufficient for this purpose, as it ignores stretch and shrink parts
5319 % of the skip. The only way seems to be to check the textual
5320 % representation of the skip.
5322 % The following is almost like \def\zeroskipmacro{0.0pt} except that
5323 % the ``p'' and ``t'' characters have catcode \other, not 11 (letter).
5325 \edef\zeroskipmacro{\expandafter\the\csname z@skip\endcsname}
5327 \newskip\whatsitskip
5328 \newcount\whatsitpenalty
5330 % ..., ready, GO:
5332 \def\safewhatsit#1{\ifhmode
5334 \else
5335 % \lastskip and \lastpenalty cannot both be nonzero simultaneously.
5336 \whatsitskip = \lastskip
5337 \edef\lastskipmacro{\the\lastskip}%
5338 \whatsitpenalty = \lastpenalty
5340 % If \lastskip is nonzero, that means the last item was a
5341 % skip. And since a skip is discardable, that means this
5342 % -\whatsitskip glue we're inserting is preceded by a
5343 % non-discardable item, therefore it is not a potential
5344 % breakpoint, therefore no \nobreak needed.
5345 \ifx\lastskipmacro\zeroskipmacro
5346 \else
5347 \vskip-\whatsitskip
5352 \ifx\lastskipmacro\zeroskipmacro
5353 % If \lastskip was zero, perhaps the last item was a penalty, and
5354 % perhaps it was >=10000, e.g., a \nobreak. In that case, we want
5355 % to re-insert the same penalty (values >10000 are used for various
5356 % signals); since we just inserted a non-discardable item, any
5357 % following glue (such as a \parskip) would be a breakpoint. For example:
5358 % @deffn deffn-whatever
5359 % @vindex index-whatever
5360 % Description.
5361 % would allow a break between the index-whatever whatsit
5362 % and the "Description." paragraph.
5363 \ifnum\whatsitpenalty>9999 \penalty\whatsitpenalty \fi
5364 \else
5365 % On the other hand, if we had a nonzero \lastskip,
5366 % this make-up glue would be preceded by a non-discardable item
5367 % (the whatsit from the \write), so we must insert a \nobreak.
5368 \nobreak\vskip\whatsitskip
5370 \fi}
5372 % The index entry written in the file actually looks like
5373 % \entry {sortstring}{page}{topic}
5374 % or
5375 % \entry {sortstring}{page}{topic}{subtopic}
5376 % The texindex program reads in these files and writes files
5377 % containing these kinds of lines:
5378 % \initial {c}
5379 % before the first topic whose initial is c
5380 % \entry {topic}{pagelist}
5381 % for a topic that is used without subtopics
5382 % \primary {topic}
5383 % \entry {topic}{}
5384 % for the beginning of a topic that is used with subtopics
5385 % \secondary {subtopic}{pagelist}
5386 % for each subtopic.
5387 % \secondary {subtopic}{}
5388 % for a subtopic with sub-subtopics
5389 % \tertiary {subtopic}{subsubtopic}{pagelist}
5390 % for each sub-subtopic.
5392 % Define the user-accessible indexing commands
5393 % @findex, @vindex, @kindex, @cindex.
5395 \def\findex {\fnindex}
5396 \def\kindex {\kyindex}
5397 \def\cindex {\cpindex}
5398 \def\vindex {\vrindex}
5399 \def\tindex {\tpindex}
5400 \def\pindex {\pgindex}
5402 % Define the macros used in formatting output of the sorted index material.
5404 % @printindex causes a particular index (the ??s file) to get printed.
5405 % It does not print any chapter heading (usually an @unnumbered).
5407 \parseargdef\printindex{\begingroup
5408 \dobreak \chapheadingskip{10000}%
5410 \smallfonts \rm
5411 \tolerance = 9500
5412 \plainfrenchspacing
5413 \everypar = {}% don't want the \kern\-parindent from indentation suppression.
5415 % See comment in \requireopenindexfile.
5416 \def\indexname{#1}\ifx\indexname\indexisfl\def\indexname{f1}\fi
5418 % See if the index file exists and is nonempty.
5419 \openin 1 \jobname.\indexname s
5420 \ifeof 1
5421 % \enddoublecolumns gets confused if there is no text in the index,
5422 % and it loses the chapter title and the aux file entries for the
5423 % index. The easiest way to prevent this problem is to make sure
5424 % there is some text.
5425 \putwordIndexNonexistent
5426 \typeout{No file \jobname.\indexname s.}%
5427 \else
5428 % If the index file exists but is empty, then \openin leaves \ifeof
5429 % false. We have to make TeX try to read something from the file, so
5430 % it can discover if there is anything in it.
5431 \read 1 to \thisline
5432 \ifeof 1
5433 \putwordIndexIsEmpty
5434 \else
5435 \expandafter\printindexzz\thisline\relax\relax\finish%
5438 \closein 1
5439 \endgroup}
5441 % If the index file starts with a backslash, forgo reading the index
5442 % file altogether. If somebody upgrades texinfo.tex they may still have
5443 % old index files using \ as the escape character. Reading this would
5444 % at best lead to typesetting garbage, at worst a TeX syntax error.
5445 \def\printindexzz#1#2\finish{%
5446 \ifflagclear{txiindexescapeisbackslash}{%
5447 \uccode`\~=`\\ \uppercase{\if\noexpand~}\noexpand#1
5448 \ifflagclear{txiskipindexfileswithbackslash}{%
5449 \errmessage{%
5450 ERROR: A sorted index file in an obsolete format was skipped.
5451 To fix this problem, please upgrade your version of 'texi2dvi'
5452 or 'texi2pdf' to that at <https://ftp.gnu.org/gnu/texinfo>.
5453 If you are using an old version of 'texindex' (part of the Texinfo
5454 distribution), you may also need to upgrade to a newer version (at least 6.0).
5455 You may be able to typeset the index if you run
5456 'texindex \jobname.\indexname' yourself.
5457 You could also try setting the 'txiindexescapeisbackslash' flag by
5458 running a command like
5459 'texi2dvi -t "@set txiindexescapeisbackslash" \jobname.texi'. If you do
5460 this, Texinfo will try to use index files in the old format.
5461 If you continue to have problems, deleting the index files and starting again
5462 might help (with 'rm \jobname.?? \jobname.??s')%
5465 (Skipped sorted index file in obsolete format)
5467 \else
5468 \begindoublecolumns
5469 \input \jobname.\indexname s
5470 \enddoublecolumns
5473 \begindoublecolumns
5474 \catcode`\\=0\relax
5476 % Make @ an escape character to give macros a chance to work. This
5477 % should work because we (hopefully) don't otherwise use @ in index files.
5478 %\catcode`\@=12\relax
5479 \catcode`\@=0\relax
5480 \input \jobname.\indexname s
5481 \enddoublecolumns
5485 % These macros are used by the sorted index file itself.
5486 % Change them to control the appearance of the index.
5488 {\catcode`\/=13 \catcode`\-=13 \catcode`\^=13 \catcode`\~=13 \catcode`\_=13
5489 \catcode`\|=13 \catcode`\<=13 \catcode`\>=13 \catcode`\+=13 \catcode`\"=13
5490 \catcode`\$=3
5491 \gdef\initialglyphs{%
5492 % special control sequences used in the index sort key
5493 \let\indexlbrace\{%
5494 \let\indexrbrace\}%
5495 \let\indexatchar\@%
5496 \def\indexbackslash{\math{\backslash}}%
5498 % Some changes for non-alphabetic characters. Using the glyphs from the
5499 % math fonts looks more consistent than the typewriter font used elsewhere
5500 % for these characters.
5501 \uccode`\~=`\\ \uppercase{\def~{\math{\backslash}}}
5503 % In case @\ is used for backslash
5504 \uppercase{\let\\=~}
5505 % Can't get bold backslash so don't use bold forward slash
5506 \catcode`\/=13
5507 \def/{{\secrmnotbold \normalslash}}%
5508 \def-{{\normaldash\normaldash}}% en dash `--'
5509 \def^{{\chapbf \normalcaret}}%
5510 \def~{{\chapbf \normaltilde}}%
5511 \def\_{%
5512 \leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em }%
5513 \def|{$\vert$}%
5514 \def<{$\less$}%
5515 \def>{$\gtr$}%
5516 \def+{$\normalplus$}%
5519 \def\initial{%
5520 \bgroup
5521 \initialglyphs
5522 \initialx
5525 \def\initialx#1{%
5526 % Remove any glue we may have, we'll be inserting our own.
5527 \removelastskip
5529 % We like breaks before the index initials, so insert a bonus.
5530 % The glue before the bonus allows a little bit of space at the
5531 % bottom of a column to reduce an increase in inter-line spacing.
5532 \nobreak
5533 \vskip 0pt plus 5\baselineskip
5534 \penalty -300
5535 \vskip 0pt plus -5\baselineskip
5537 % Typeset the initial. Making this add up to a whole number of
5538 % baselineskips increases the chance of the dots lining up from column
5539 % to column. It still won't often be perfect, because of the stretch
5540 % we need before each entry, but it's better.
5542 % No shrink because it confuses \balancecolumns.
5543 \vskip 1.67\baselineskip plus 1\baselineskip
5544 \leftline{\secfonts \kern-0.05em \secbf #1}%
5545 % \secfonts is inside the argument of \leftline so that the change of
5546 % \baselineskip will not affect any glue inserted before the vbox that
5547 % \leftline creates.
5548 % Do our best not to break after the initial.
5549 \nobreak
5550 \vskip .33\baselineskip plus .1\baselineskip
5551 \egroup % \initialglyphs
5554 \newdimen\entryrightmargin
5555 \entryrightmargin=0pt
5557 % amount to indent subsequent lines in an entry when it spans more than
5558 % one line.
5559 \newdimen\entrycontskip
5560 \entrycontskip=1em
5562 % for PDF output, whether to make the text of the entry a link to the page
5563 % number. set for @contents and @shortcontents where there is only one
5564 % page number.
5565 \newif\iflinkentrytext
5567 % \entry typesets a paragraph consisting of the text (#1), dot leaders, and
5568 % then page number (#2) flushed to the right margin. It is used for index
5569 % and table of contents entries. The paragraph is indented by \leftskip.
5571 \def\entry{%
5572 \begingroup
5574 % Start a new paragraph if necessary, so our assignments below can't
5575 % affect previous text.
5576 \par
5578 % No extra space above this paragraph.
5579 \parskip = 0in
5581 % When reading the text of entry, convert explicit line breaks
5582 % from @* into spaces. The user might give these in long section
5583 % titles, for instance.
5584 \def\*{\unskip\space\ignorespaces}%
5585 \def\entrybreak{\hfil\break}% An undocumented command
5587 % Swallow the left brace of the text (first parameter):
5588 \afterassignment\doentry
5589 \let\temp =
5591 \def\entrybreak{\unskip\space\ignorespaces}%
5592 \def\doentry{%
5593 % Save the text of the entry in \boxA
5594 \global\setbox\boxA=\hbox\bgroup
5595 \bgroup % Instead of the swallowed brace.
5596 \noindent
5597 \aftergroup\finishentry
5598 % And now comes the text of the entry.
5599 % Not absorbing as a macro argument reduces the chance of problems
5600 % with catcodes occurring.
5602 {\catcode`\@=11
5603 % #1 is the page number
5604 \gdef\finishentry#1{%
5605 \egroup % end \boxA
5606 \dimen@ = \wd\boxA % Length of text of entry
5607 % add any leaders and page number to \boxA.
5608 \global\setbox\boxA=\hbox\bgroup
5609 \ifpdforxetex
5610 \iflinkentrytext
5611 \pdflinkpage{#1}{\unhbox\boxA}%
5612 \else
5613 \unhbox\boxA
5615 \else
5616 \unhbox\boxA
5619 % Get the width of the page numbers, and only use
5620 % leaders if they are present.
5621 \global\setbox\boxB = \hbox{#1}%
5622 \ifdim\wd\boxB = 0pt
5623 \null\nobreak\hfill\ %
5624 \else
5626 \null\nobreak\indexdotfill % Have leaders before the page number.
5628 \ifpdforxetex
5629 \pdfgettoks#1.%
5630 \hskip\skip\thinshrinkable\the\toksA
5631 \else
5632 \hskip\skip\thinshrinkable #1%
5635 \egroup % end \boxA
5637 % now output
5638 \ifdim\wd\boxB = 0pt
5639 \noindent\unhbox\boxA\par
5640 \nobreak
5641 \else\bgroup
5642 % We want the text of the entries to be aligned to the left, and the
5643 % page numbers to be aligned to the right.
5645 \parindent = 0pt
5646 \advance\leftskip by 0pt plus 1fil
5647 \advance\leftskip by 0pt plus -1fill
5648 \rightskip = 0pt plus -1fil
5649 \advance\rightskip by 0pt plus 1fill
5650 % Cause last line, which could consist of page numbers on their own
5651 % if the list of page numbers is long, to be aligned to the right.
5652 \parfillskip=0pt plus -1fill
5654 \advance\rightskip by \entryrightmargin
5656 \dimen@ii = \hsize
5657 \advance\dimen@ii by -1\leftskip
5658 \advance\dimen@ii by -1\entryrightmargin
5659 \ifdim\wd\boxA > \dimen@ii % If the entry doesn't fit in one line
5660 \ifdim\dimen@ > 0.8\dimen@ii % due to long index text
5661 \advance\leftskip by 0pt plus 1fill % ragged right
5663 % Indent all lines but the first one.
5664 \advance\leftskip by \entrycontskip
5665 \advance\parindent by -\entrycontskip
5666 \fi\fi
5667 \indent % start paragraph
5668 \unhbox\boxA
5670 % Do not prefer a separate line ending with a hyphen to fewer lines.
5671 \finalhyphendemerits = 0
5673 % Word spacing - no stretch
5674 \spaceskip=\fontdimen2\font minus \fontdimen4\font
5676 \linepenalty=1000 % Discourage line breaks.
5677 \hyphenpenalty=5000 % Discourage hyphenation.
5679 \par % format the paragraph
5680 \egroup % The \vbox
5682 \endgroup
5685 \newskip\thinshrinkable
5686 \skip\thinshrinkable=.15em minus .15em
5688 % Like plain.tex's \dotfill, except uses up at least 0.5 em.
5689 % The filll stretch here overpowers both the fil and fill stretch to push
5690 % the page number to the right.
5691 \def\indexdotfill{\cleaders
5692 \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 0.5em plus 1filll}
5694 \def\primary #1{\line{#1\hfil}}
5696 \def\secondary{\indententry{0.5cm}}
5697 \def\tertiary{\indententry{1cm}}
5699 \def\indententry#1#2#3{%
5700 \bgroup
5701 \leftskip=#1
5702 \entry{#2}{#3}%
5703 \egroup
5706 % Define two-column mode, which we use to typeset indexes.
5707 % Adapted from the TeXbook, page 416, which is to say,
5708 % the manmac.tex format used to print the TeXbook itself.
5709 \catcode`\@=11 % private names
5711 \newbox\partialpage
5712 \newdimen\doublecolumnhsize
5714 \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
5715 % If not much space left on page, start a new page.
5716 \ifdim\pagetotal>0.8\vsize\vfill\eject\fi
5718 % Grab any single-column material above us.
5719 \output = {%
5720 \savetopmark
5722 \global\setbox\partialpage = \vbox{%
5723 % Unvbox the main output page.
5724 \unvbox\PAGE
5725 \kern-\topskip \kern\baselineskip
5728 \eject % run that output routine to set \partialpage
5730 % Use the double-column output routine for subsequent pages.
5731 \output = {\doublecolumnout}%
5733 % Change the page size parameters. We could do this once outside this
5734 % routine, in each of @smallbook, @afourpaper, and the default 8.5x11
5735 % format, but then we repeat the same computation. Repeating a couple
5736 % of assignments once per index is clearly meaningless for the
5737 % execution time, so we may as well do it in one place.
5739 % First we halve the line length, less a little for the gutter between
5740 % the columns. We compute the gutter based on the line length, so it
5741 % changes automatically with the paper format. The magic constant
5742 % below is chosen so that the gutter has the same value (well, +-<1pt)
5743 % as it did when we hard-coded it.
5745 % We put the result in a separate register, \doublecolumnhsize, so we
5746 % can restore it in \pagesofar, after \hsize itself has (potentially)
5747 % been clobbered.
5749 \doublecolumnhsize = \hsize
5750 \advance\doublecolumnhsize by -.04154\hsize
5751 \divide\doublecolumnhsize by 2
5752 \hsize = \doublecolumnhsize
5754 % Get the available space for the double columns -- the normal
5755 % (undoubled) page height minus any material left over from the
5756 % previous page.
5757 \advance\vsize by -\ht\partialpage
5758 \vsize = 2\vsize
5760 % For the benefit of balancing columns
5761 \advance\baselineskip by 0pt plus 0.5pt
5764 % The double-column output routine for all double-column pages except
5765 % the last, which is done by \balancecolumns.
5767 \def\doublecolumnout{%
5769 \savetopmark
5770 \splittopskip=\topskip \splitmaxdepth=\maxdepth
5771 \dimen@ = \vsize
5772 \divide\dimen@ by 2
5774 % box0 will be the left-hand column, box2 the right.
5775 \setbox0=\vsplit\PAGE to\dimen@ \setbox2=\vsplit\PAGE to\dimen@
5776 \global\advance\vsize by 2\ht\partialpage
5777 \onepageout\pagesofar % empty except for the first time we are called
5778 \unvbox\PAGE
5779 \penalty\outputpenalty
5782 % Re-output the contents of the output page -- any previous material,
5783 % followed by the two boxes we just split, in box0 and box2.
5784 \def\pagesofar{%
5785 \unvbox\partialpage
5787 \hsize = \doublecolumnhsize
5788 \wd0=\hsize \wd2=\hsize
5789 \hbox to\txipagewidth{\box0\hfil\box2}%
5793 % Finished with double columns.
5794 \def\enddoublecolumns{%
5795 % The following penalty ensures that the page builder is exercised
5796 % _before_ we change the output routine. This is necessary in the
5797 % following situation:
5799 % The last section of the index consists only of a single entry.
5800 % Before this section, \pagetotal is less than \pagegoal, so no
5801 % break occurs before the last section starts. However, the last
5802 % section, consisting of \initial and the single \entry, does not
5803 % fit on the page and has to be broken off. Without the following
5804 % penalty the page builder will not be exercised until \eject
5805 % below, and by that time we'll already have changed the output
5806 % routine to the \balancecolumns version, so the next-to-last
5807 % double-column page will be processed with \balancecolumns, which
5808 % is wrong: The two columns will go to the main vertical list, with
5809 % the broken-off section in the recent contributions. As soon as
5810 % the output routine finishes, TeX starts reconsidering the page
5811 % break. The two columns and the broken-off section both fit on the
5812 % page, because the two columns now take up only half of the page
5813 % goal. When TeX sees \eject from below which follows the final
5814 % section, it invokes the new output routine that we've set after
5815 % \balancecolumns below; \onepageout will try to fit the two columns
5816 % and the final section into the vbox of \txipageheight (see
5817 % \pagebody), causing an overfull box.
5819 % Note that glue won't work here, because glue does not exercise the
5820 % page builder, unlike penalties (see The TeXbook, pp. 280-281).
5821 \penalty0
5823 \output = {%
5824 % Split the last of the double-column material.
5825 \savetopmark
5826 \balancecolumns
5828 \eject % call the \output just set
5829 \ifdim\pagetotal=0pt
5830 % Having called \balancecolumns once, we do not
5831 % want to call it again. Therefore, reset \output to its normal
5832 % definition right away.
5833 \global\output=\expandafter{\the\defaultoutput}
5835 \endgroup % started in \begindoublecolumns
5836 % Leave the double-column material on the current page, no automatic
5837 % page break.
5838 \box\balancedcolumns
5840 % \pagegoal was set to the doubled \vsize above, since we restarted
5841 % the current page. We're now back to normal single-column
5842 % typesetting, so reset \pagegoal to the normal \vsize.
5843 \global\vsize = \txipageheight %
5844 \pagegoal = \txipageheight %
5845 \else
5846 % We had some left-over material. This might happen when \doublecolumnout
5847 % is called in \balancecolumns. Try again.
5848 \expandafter\enddoublecolumns
5851 \newbox\balancedcolumns
5852 \setbox\balancedcolumns=\vbox{shouldnt see this}%
5854 % Only called for the last of the double column material. \doublecolumnout
5855 % does the others.
5856 \def\balancecolumns{%
5857 \setbox0 = \vbox{\unvbox\PAGE}% like \box255 but more efficient, see p.120.
5858 \dimen@ = \ht0
5859 \ifdim\dimen@<7\baselineskip
5860 % Don't split a short final column in two.
5861 \setbox2=\vbox{}%
5862 \global\setbox\balancedcolumns=\vbox{\pagesofar}%
5863 \else
5864 % double the leading vertical space
5865 \advance\dimen@ by \topskip
5866 \advance\dimen@ by-\baselineskip
5867 \divide\dimen@ by 2 % target to split to
5868 \dimen@ii = \dimen@
5869 \splittopskip = \topskip
5870 % Loop until left column is at least as high as the right column.
5872 \vbadness = 10000
5873 \loop
5874 \global\setbox3 = \copy0
5875 \global\setbox1 = \vsplit3 to \dimen@
5876 \ifdim\ht1<\ht3
5877 \global\advance\dimen@ by 1pt
5878 \repeat
5880 % Now the left column is in box 1, and the right column in box 3.
5882 % Check whether the left column has come out higher than the page itself.
5883 % (Note that we have doubled \vsize for the double columns, so
5884 % the actual height of the page is 0.5\vsize).
5885 \ifdim2\ht1>\vsize
5886 % It appears that we have been called upon to balance too much material.
5887 % Output some of it with \doublecolumnout, leaving the rest on the page.
5888 \setbox\PAGE=\box0
5889 \doublecolumnout
5890 \else
5891 % Compare the heights of the two columns.
5892 \ifdim4\ht1>5\ht3
5893 % Column heights are too different, so don't make their bottoms
5894 % flush with each other.
5895 \setbox2=\vbox to \ht1 {\unvbox3\vfill}%
5896 \setbox0=\vbox to \ht1 {\unvbox1\vfill}%
5897 \else
5898 % Make column bottoms flush with each other.
5899 \setbox2=\vbox to\ht1{\unvbox3\unskip}%
5900 \setbox0=\vbox to\ht1{\unvbox1\unskip}%
5902 \global\setbox\balancedcolumns=\vbox{\pagesofar}%
5907 \catcode`\@ = \other
5910 \message{sectioning,}
5911 % Chapters, sections, etc.
5913 % Let's start with @part.
5914 \parseargdef\part{\partzzz{#1}}
5915 \def\partzzz#1{%
5916 \chapoddpage
5917 \null
5918 \vskip.3\vsize % move it down on the page a bit
5919 \begingroup
5920 \noindent \titlefonts\rm #1\par % the text
5921 \let\lastnode=\empty % no node to associate with
5922 \writetocentry{part}{#1}{}% but put it in the toc
5923 \headingsoff % no headline or footline on the part page
5924 % This outputs a mark at the end of the page that clears \thischapter
5925 % and \thissection, as is done in \startcontents.
5926 \let\pchapsepmacro\relax
5927 \chapmacro{}{Yomitfromtoc}{}%
5928 \chapoddpage
5929 \endgroup
5932 % \unnumberedno is an oxymoron. But we count the unnumbered
5933 % sections so that we can refer to them unambiguously in the pdf
5934 % outlines by their "section number". We avoid collisions with chapter
5935 % numbers by starting them at 10000. (If a document ever has 10000
5936 % chapters, we're in trouble anyway, I'm sure.)
5937 \newcount\unnumberedno \unnumberedno = 10000
5938 \newcount\chapno
5939 \newcount\secno \secno=0
5940 \newcount\subsecno \subsecno=0
5941 \newcount\subsubsecno \subsubsecno=0
5943 % This counter is funny since it counts through charcodes of letters A, B, ...
5944 \newcount\appendixno \appendixno = `\@
5946 % \def\appendixletter{\char\the\appendixno}
5947 % We do the following ugly conditional instead of the above simple
5948 % construct for the sake of pdftex, which needs the actual
5949 % letter in the expansion, not just typeset.
5951 \def\appendixletter{%
5952 \ifnum\appendixno=`A A%
5953 \else\ifnum\appendixno=`B B%
5954 \else\ifnum\appendixno=`C C%
5955 \else\ifnum\appendixno=`D D%
5956 \else\ifnum\appendixno=`E E%
5957 \else\ifnum\appendixno=`F F%
5958 \else\ifnum\appendixno=`G G%
5959 \else\ifnum\appendixno=`H H%
5960 \else\ifnum\appendixno=`I I%
5961 \else\ifnum\appendixno=`J J%
5962 \else\ifnum\appendixno=`K K%
5963 \else\ifnum\appendixno=`L L%
5964 \else\ifnum\appendixno=`M M%
5965 \else\ifnum\appendixno=`N N%
5966 \else\ifnum\appendixno=`O O%
5967 \else\ifnum\appendixno=`P P%
5968 \else\ifnum\appendixno=`Q Q%
5969 \else\ifnum\appendixno=`R R%
5970 \else\ifnum\appendixno=`S S%
5971 \else\ifnum\appendixno=`T T%
5972 \else\ifnum\appendixno=`U U%
5973 \else\ifnum\appendixno=`V V%
5974 \else\ifnum\appendixno=`W W%
5975 \else\ifnum\appendixno=`X X%
5976 \else\ifnum\appendixno=`Y Y%
5977 \else\ifnum\appendixno=`Z Z%
5978 % The \the is necessary, despite appearances, because \appendixletter is
5979 % expanded while writing the .toc file. \char\appendixno is not
5980 % expandable, thus it is written literally, thus all appendixes come out
5981 % with the same letter (or @) in the toc without it.
5982 \else\char\the\appendixno
5983 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
5984 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
5986 % Each @chapter defines these (using marks) as the number+name, number
5987 % and name of the chapter. Page headings and footings can use
5988 % these. @section does likewise.
5989 \def\thischapter{}
5990 \def\thischapternum{}
5991 \def\thischaptername{}
5992 \def\thissection{}
5993 \def\thissectionnum{}
5994 \def\thissectionname{}
5996 \newcount\absseclevel % used to calculate proper heading level
5997 \newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count
5999 % @raisesections: treat @section as chapter, @subsection as section, etc.
6000 \def\raisesections{\global\advance\secbase by -1}
6002 % @lowersections: treat @chapter as section, @section as subsection, etc.
6003 \def\lowersections{\global\advance\secbase by 1}
6005 % we only have subsub.
6006 \chardef\maxseclevel = 3
6008 % A numbered section within an unnumbered changes to unnumbered too.
6009 % To achieve this, remember the "biggest" unnum. sec. we are currently in:
6010 \chardef\unnlevel = \maxseclevel
6012 % Trace whether the current chapter is an appendix or not:
6013 % \chapheadtype is "N" or "A", unnumbered chapters are ignored.
6014 \def\chapheadtype{N}
6016 % Choose a heading macro
6017 % #1 is heading type
6018 % #2 is heading level
6019 % #3 is text for heading
6020 \def\genhead#1#2#3{%
6021 % Compute the abs. sec. level:
6022 \absseclevel=#2
6023 \advance\absseclevel by \secbase
6024 % Make sure \absseclevel doesn't fall outside the range:
6025 \ifnum \absseclevel < 0
6026 \absseclevel = 0
6027 \else
6028 \ifnum \absseclevel > 3
6029 \absseclevel = 3
6032 % The heading type:
6033 \def\headtype{#1}%
6034 \if \headtype U%
6035 \ifnum \absseclevel < \unnlevel
6036 \chardef\unnlevel = \absseclevel
6038 \else
6039 % Check for appendix sections:
6040 \ifnum \absseclevel = 0
6041 \edef\chapheadtype{\headtype}%
6042 \else
6043 \if \headtype A\if \chapheadtype N%
6044 \errmessage{@appendix... within a non-appendix chapter}%
6045 \fi\fi
6047 % Check for numbered within unnumbered:
6048 \ifnum \absseclevel > \unnlevel
6049 \def\headtype{U}%
6050 \else
6051 \chardef\unnlevel = 3
6054 % Now print the heading:
6055 \if \headtype U%
6056 \ifcase\absseclevel
6057 \unnumberedzzz{#3}%
6058 \or \unnumberedseczzz{#3}%
6059 \or \unnumberedsubseczzz{#3}%
6060 \or \unnumberedsubsubseczzz{#3}%
6062 \else
6063 \if \headtype A%
6064 \ifcase\absseclevel
6065 \appendixzzz{#3}%
6066 \or \appendixsectionzzz{#3}%
6067 \or \appendixsubseczzz{#3}%
6068 \or \appendixsubsubseczzz{#3}%
6070 \else
6071 \ifcase\absseclevel
6072 \chapterzzz{#3}%
6073 \or \seczzz{#3}%
6074 \or \numberedsubseczzz{#3}%
6075 \or \numberedsubsubseczzz{#3}%
6079 \suppressfirstparagraphindent
6082 % an interface:
6083 \def\numhead{\genhead N}
6084 \def\apphead{\genhead A}
6085 \def\unnmhead{\genhead U}
6087 % @chapter, @appendix, @unnumbered. Increment top-level counter, reset
6088 % all lower-level sectioning counters to zero.
6090 % Also set \chaplevelprefix, which we prepend to @float sequence numbers
6091 % (e.g., figures), q.v. By default (before any chapter), that is empty.
6092 \let\chaplevelprefix = \empty
6094 \outer\parseargdef\chapter{\numhead0{#1}} % normally numhead0 calls chapterzzz
6095 \def\chapterzzz#1{%
6096 % section resetting is \global in case the chapter is in a group, such
6097 % as an @include file.
6098 \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
6099 \global\advance\chapno by 1
6101 % Used for \float.
6102 \gdef\chaplevelprefix{\the\chapno.}%
6103 \resetallfloatnos
6105 % \putwordChapter can contain complex things in translations.
6106 \toks0=\expandafter{\putwordChapter}%
6107 \message{\the\toks0 \space \the\chapno}%
6109 % Write the actual heading.
6110 \chapmacro{#1}{Ynumbered}{\the\chapno}%
6112 % So @section and the like are numbered underneath this chapter.
6113 \global\let\section = \numberedsec
6114 \global\let\subsection = \numberedsubsec
6115 \global\let\subsubsection = \numberedsubsubsec
6118 \outer\parseargdef\appendix{\apphead0{#1}} % normally calls appendixzzz
6120 \def\appendixzzz#1{%
6121 \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
6122 \global\advance\appendixno by 1
6123 \gdef\chaplevelprefix{\appendixletter.}%
6124 \resetallfloatnos
6126 % \putwordAppendix can contain complex things in translations.
6127 \toks0=\expandafter{\putwordAppendix}%
6128 \message{\the\toks0 \space \appendixletter}%
6130 \chapmacro{#1}{Yappendix}{\appendixletter}%
6132 \global\let\section = \appendixsec
6133 \global\let\subsection = \appendixsubsec
6134 \global\let\subsubsection = \appendixsubsubsec
6137 % normally unnmhead0 calls unnumberedzzz:
6138 \outer\parseargdef\unnumbered{\unnmhead0{#1}}
6139 \def\unnumberedzzz#1{%
6140 \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
6141 \global\advance\unnumberedno by 1
6143 % Since an unnumbered has no number, no prefix for figures.
6144 \global\let\chaplevelprefix = \empty
6145 \resetallfloatnos
6147 % This used to be simply \message{#1}, but TeX fully expands the
6148 % argument to \message. Therefore, if #1 contained @-commands, TeX
6149 % expanded them. For example, in `@unnumbered The @cite{Book}', TeX
6150 % expanded @cite (which turns out to cause errors because \cite is meant
6151 % to be executed, not expanded).
6153 % Anyway, we don't want the fully-expanded definition of @cite to appear
6154 % as a result of the \message, we just want `@cite' itself. We use
6155 % \the<toks register> to achieve this: TeX expands \the<toks> only once,
6156 % simply yielding the contents of <toks register>. (We also do this for
6157 % the toc entries.)
6158 \toks0 = {#1}%
6159 \message{(\the\toks0)}%
6161 \chapmacro{#1}{Ynothing}{\the\unnumberedno}%
6163 \global\let\section = \unnumberedsec
6164 \global\let\subsection = \unnumberedsubsec
6165 \global\let\subsubsection = \unnumberedsubsubsec
6168 % @centerchap is like @unnumbered, but the heading is centered.
6169 \outer\parseargdef\centerchap{%
6170 \let\centerparametersmaybe = \centerparameters
6171 \unnmhead0{#1}%
6172 \let\centerparametersmaybe = \relax
6175 % @top is like @unnumbered.
6176 \let\top\unnumbered
6178 % Sections.
6180 \outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz
6181 \def\seczzz#1{%
6182 \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
6183 \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}%
6186 % normally calls appendixsectionzzz:
6187 \outer\parseargdef\appendixsection{\apphead1{#1}}
6188 \def\appendixsectionzzz#1{%
6189 \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
6190 \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}%
6192 \let\appendixsec\appendixsection
6194 % normally calls unnumberedseczzz:
6195 \outer\parseargdef\unnumberedsec{\unnmhead1{#1}}
6196 \def\unnumberedseczzz#1{%
6197 \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
6198 \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}%
6201 % Subsections.
6203 % normally calls numberedsubseczzz:
6204 \outer\parseargdef\numberedsubsec{\numhead2{#1}}
6205 \def\numberedsubseczzz#1{%
6206 \global\subsubsecno=0 \global\advance\subsecno by 1
6207 \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}%
6210 % normally calls appendixsubseczzz:
6211 \outer\parseargdef\appendixsubsec{\apphead2{#1}}
6212 \def\appendixsubseczzz#1{%
6213 \global\subsubsecno=0 \global\advance\subsecno by 1
6214 \sectionheading{#1}{subsec}{Yappendix}%
6215 {\appendixletter.\the\secno.\the\subsecno}%
6218 % normally calls unnumberedsubseczzz:
6219 \outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}}
6220 \def\unnumberedsubseczzz#1{%
6221 \global\subsubsecno=0 \global\advance\subsecno by 1
6222 \sectionheading{#1}{subsec}{Ynothing}%
6223 {\the\unnumberedno.\the\secno.\the\subsecno}%
6226 % Subsubsections.
6228 % normally numberedsubsubseczzz:
6229 \outer\parseargdef\numberedsubsubsec{\numhead3{#1}}
6230 \def\numberedsubsubseczzz#1{%
6231 \global\advance\subsubsecno by 1
6232 \sectionheading{#1}{subsubsec}{Ynumbered}%
6233 {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}%
6236 % normally appendixsubsubseczzz:
6237 \outer\parseargdef\appendixsubsubsec{\apphead3{#1}}
6238 \def\appendixsubsubseczzz#1{%
6239 \global\advance\subsubsecno by 1
6240 \sectionheading{#1}{subsubsec}{Yappendix}%
6241 {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}%
6244 % normally unnumberedsubsubseczzz:
6245 \outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}}
6246 \def\unnumberedsubsubseczzz#1{%
6247 \global\advance\subsubsecno by 1
6248 \sectionheading{#1}{subsubsec}{Ynothing}%
6249 {\the\unnumberedno.\the\secno.\the\subsecno.\the\subsubsecno}%
6252 % These macros control what the section commands do, according
6253 % to what kind of chapter we are in (ordinary, appendix, or unnumbered).
6254 % Define them by default for a numbered chapter.
6255 \let\section = \numberedsec
6256 \let\subsection = \numberedsubsec
6257 \let\subsubsection = \numberedsubsubsec
6259 % Define @majorheading, @heading and @subheading
6261 \def\majorheading{%
6262 {\advance\chapheadingskip by 10pt \chapbreak }%
6263 \parsearg\chapheadingzzz
6266 \def\chapheading{\chapbreak \parsearg\chapheadingzzz}
6267 \def\chapheadingzzz#1{%
6268 \vbox{\chapfonts \raggedtitlesettings #1\par}%
6269 \nobreak\bigskip \nobreak
6270 \suppressfirstparagraphindent
6273 % @heading, @subheading, @subsubheading.
6274 \parseargdef\heading{\sectionheading{#1}{sec}{Yomitfromtoc}{}
6275 \suppressfirstparagraphindent}
6276 \parseargdef\subheading{\sectionheading{#1}{subsec}{Yomitfromtoc}{}
6277 \suppressfirstparagraphindent}
6278 \parseargdef\subsubheading{\sectionheading{#1}{subsubsec}{Yomitfromtoc}{}
6279 \suppressfirstparagraphindent}
6281 % These macros generate a chapter, section, etc. heading only
6282 % (including whitespace, linebreaking, etc. around it),
6283 % given all the information in convenient, parsed form.
6285 % Args are the skip and penalty (usually negative)
6286 \def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}
6288 % Parameter controlling skip before chapter headings (if needed)
6289 \newskip\chapheadingskip
6291 % Define plain chapter starts, and page on/off switching for it.
6292 \def\chapbreak{\dobreak \chapheadingskip {-4000}}
6294 % Start a new page
6295 \def\chappager{\par\vfill\supereject}
6297 % \chapoddpage - start on an odd page for a new chapter
6298 % Because \domark is called before \chapoddpage, the filler page will
6299 % get the headings for the next chapter, which is wrong. But we don't
6300 % care -- we just disable all headings on the filler page.
6301 \def\chapoddpage{%
6302 \chappager
6303 \ifodd\pageno \else
6304 \begingroup
6305 \headingsoff
6306 \null
6307 \chappager
6308 \endgroup
6312 \parseargdef\setchapternewpage{\csname CHAPPAG#1\endcsname\HEADINGSon}
6314 \def\CHAPPAGoff{%
6315 \global\let\contentsalignmacro = \chappager
6316 \global\let\pchapsepmacro=\chapbreak
6317 \global\def\HEADINGSon{\HEADINGSsinglechapoff}}
6319 \def\CHAPPAGon{%
6320 \global\let\contentsalignmacro = \chappager
6321 \global\let\pchapsepmacro=\chappager
6322 \global\def\HEADINGSon{\HEADINGSsingle}}
6324 \def\CHAPPAGodd{%
6325 \global\let\contentsalignmacro = \chapoddpage
6326 \global\let\pchapsepmacro=\chapoddpage
6327 \global\def\HEADINGSon{\HEADINGSdouble}}
6329 \setchapternewpage on
6331 % \chapmacro - Chapter opening.
6333 % #1 is the text, #2 is the section type (Ynumbered, Ynothing,
6334 % Yappendix, Yomitfromtoc), #3 the chapter number.
6335 % Not used for @heading series.
6337 % To test against our argument.
6338 \def\Ynothingkeyword{Ynothing}
6339 \def\Yappendixkeyword{Yappendix}
6340 \def\Yomitfromtockeyword{Yomitfromtoc}
6343 % Definitions for @thischapter. These can be overridden in translation
6344 % files.
6345 \def\thischapterAppendix{%
6346 \putwordAppendix{} \thischapternum: \thischaptername}
6348 \def\thischapterChapter{%
6349 \putwordChapter{} \thischapternum: \thischaptername}
6352 \def\chapmacro#1#2#3{%
6353 \expandafter\ifx\thisenv\titlepage\else
6354 \checkenv{}% chapters, etc., should not start inside an environment.
6356 % Insert the first mark before the heading break (see notes for \domark).
6357 \let\prevchapterdefs=\currentchapterdefs
6358 \let\prevsectiondefs=\currentsectiondefs
6359 \gdef\currentsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}%
6360 \gdef\thissection{}}%
6362 \def\temptype{#2}%
6363 \ifx\temptype\Ynothingkeyword
6364 \gdef\currentchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
6365 \gdef\thischapter{\thischaptername}}%
6366 \else\ifx\temptype\Yomitfromtockeyword
6367 \gdef\currentchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
6368 \gdef\thischapter{}}%
6369 \else\ifx\temptype\Yappendixkeyword
6370 \toks0={#1}%
6371 \xdef\currentchapterdefs{%
6372 \gdef\noexpand\thischaptername{\the\toks0}%
6373 \gdef\noexpand\thischapternum{\appendixletter}%
6374 \let\noexpand\thischapter\noexpand\thischapterAppendix
6376 \else
6377 \toks0={#1}%
6378 \xdef\currentchapterdefs{%
6379 \gdef\noexpand\thischaptername{\the\toks0}%
6380 \gdef\noexpand\thischapternum{\the\chapno}%
6381 \let\noexpand\thischapter\noexpand\thischapterChapter
6383 \fi\fi\fi
6385 % Output the mark. Pass it through \safewhatsit, to take care of
6386 % the preceding space.
6387 \safewhatsit\domark
6389 % Insert the chapter heading break.
6390 \pchapsepmacro
6392 % Now the second mark, after the heading break. No break points
6393 % between here and the heading.
6394 \let\prevchapterdefs=\currentchapterdefs
6395 \let\prevsectiondefs=\currentsectiondefs
6396 \domark
6399 \chapfonts \rm
6400 \let\footnote=\errfootnoteheading % give better error message
6402 % Have to define \currentsection before calling \donoderef, because the
6403 % xref code eventually uses it. On the other hand, it has to be called
6404 % after \pchapsepmacro, or the headline will change too soon.
6405 \gdef\currentsection{#1}%
6407 % Only insert the separating space if we have a chapter/appendix
6408 % number, and don't print the unnumbered ``number''.
6409 \ifx\temptype\Ynothingkeyword
6410 \setbox0 = \hbox{}%
6411 \def\toctype{unnchap}%
6412 \else\ifx\temptype\Yomitfromtockeyword
6413 \setbox0 = \hbox{}% contents like unnumbered, but no toc entry
6414 \def\toctype{omit}%
6415 \else\ifx\temptype\Yappendixkeyword
6416 \setbox0 = \hbox{\putwordAppendix{} #3\enspace}%
6417 \def\toctype{app}%
6418 \else
6419 \setbox0 = \hbox{#3\enspace}%
6420 \def\toctype{numchap}%
6421 \fi\fi\fi
6423 % Write the toc entry for this chapter. Must come before the
6424 % \donoderef, because we include the current node name in the toc
6425 % entry, and \donoderef resets it to empty.
6426 \writetocentry{\toctype}{#1}{#3}%
6428 % For pdftex, we have to write out the node definition (aka, make
6429 % the pdfdest) after any page break, but before the actual text has
6430 % been typeset. If the destination for the pdf outline is after the
6431 % text, then jumping from the outline may wind up with the text not
6432 % being visible, for instance under high magnification.
6433 \donoderef{#2}%
6435 % Typeset the actual heading.
6436 \nobreak % Avoid page breaks at the interline glue.
6437 \vbox{\raggedtitlesettings \hangindent=\wd0 \centerparametersmaybe
6438 \unhbox0 #1\par}%
6440 \nobreak\bigskip % no page break after a chapter title
6441 \nobreak
6444 % @centerchap -- centered and unnumbered.
6445 \let\centerparametersmaybe = \relax
6446 \def\centerparameters{%
6447 \advance\rightskip by 3\rightskip
6448 \leftskip = \rightskip
6449 \parfillskip = 0pt
6453 % Section titles. These macros combine the section number parts and
6454 % call the generic \sectionheading to do the printing.
6456 \newskip\secheadingskip
6457 \def\secheadingbreak{\dobreak \secheadingskip{-1000}}
6459 % Subsection titles.
6460 \newskip\subsecheadingskip
6461 \def\subsecheadingbreak{\dobreak \subsecheadingskip{-500}}
6463 % Subsubsection titles.
6464 \def\subsubsecheadingskip{\subsecheadingskip}
6465 \def\subsubsecheadingbreak{\subsecheadingbreak}
6467 % Definition for @thissection. This can be overridden in translation
6468 % files.
6469 \def\thissectionDef{%
6470 \putwordSection{} \thissectionnum: \thissectionname}
6474 % Print any size, any type, section title.
6476 % #1 is the text of the title,
6477 % #2 is the section level (sec/subsec/subsubsec),
6478 % #3 is the section type (Ynumbered, Ynothing, Yappendix, Yomitfromtoc),
6479 % #4 is the section number.
6481 \def\seckeyword{sec}
6483 \def\sectionheading#1#2#3#4{%
6485 \def\sectionlevel{#2}%
6486 \def\temptype{#3}%
6488 % It is ok for the @heading series commands to appear inside an
6489 % environment (it's been historically allowed, though the logic is
6490 % dubious), but not the others.
6491 \ifx\temptype\Yomitfromtockeyword\else
6492 \checkenv{}% non-@*heading should not be in an environment.
6494 \let\footnote=\errfootnoteheading
6496 % Switch to the right set of fonts.
6497 \csname #2fonts\endcsname \rm
6499 % Insert first mark before the heading break (see notes for \domark).
6500 \let\prevsectiondefs=\currentsectiondefs
6501 \ifx\temptype\Ynothingkeyword
6502 \ifx\sectionlevel\seckeyword
6503 \gdef\currentsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}%
6504 \gdef\thissection{\thissectionname}}%
6506 \else\ifx\temptype\Yomitfromtockeyword
6507 % Don't redefine \thissection.
6508 \else\ifx\temptype\Yappendixkeyword
6509 \ifx\sectionlevel\seckeyword
6510 \toks0={#1}%
6511 \xdef\currentsectiondefs{%
6512 \gdef\noexpand\thissectionname{\the\toks0}%
6513 \gdef\noexpand\thissectionnum{#4}%
6514 \let\noexpand\thissection\noexpand\thissectionDef
6517 \else
6518 \ifx\sectionlevel\seckeyword
6519 \toks0={#1}%
6520 \xdef\currentsectiondefs{%
6521 \gdef\noexpand\thissectionname{\the\toks0}%
6522 \gdef\noexpand\thissectionnum{#4}%
6523 \let\noexpand\thissection\noexpand\thissectionDef
6526 \fi\fi\fi
6528 % Go into vertical mode. Usually we'll already be there, but we
6529 % don't want the following whatsit to end up in a preceding paragraph
6530 % if the document didn't happen to have a blank line.
6531 \par
6533 % Output the mark. Pass it through \safewhatsit, to take care of
6534 % the preceding space.
6535 \safewhatsit\domark
6537 % Insert space above the heading.
6538 \csname #2headingbreak\endcsname
6540 % Now the second mark, after the heading break. No break points
6541 % between here and the heading.
6542 \global\let\prevsectiondefs=\currentsectiondefs
6543 \domark
6545 % Only insert the space after the number if we have a section number.
6546 \ifx\temptype\Ynothingkeyword
6547 \setbox0 = \hbox{}%
6548 \def\toctype{unn}%
6549 \gdef\currentsection{#1}%
6550 \else\ifx\temptype\Yomitfromtockeyword
6551 % for @headings -- no section number, don't include in toc,
6552 % and don't redefine \currentsection.
6553 \setbox0 = \hbox{}%
6554 \def\toctype{omit}%
6555 \let\sectionlevel=\empty
6556 \else\ifx\temptype\Yappendixkeyword
6557 \setbox0 = \hbox{#4\enspace}%
6558 \def\toctype{app}%
6559 \gdef\currentsection{#1}%
6560 \else
6561 \setbox0 = \hbox{#4\enspace}%
6562 \def\toctype{num}%
6563 \gdef\currentsection{#1}%
6564 \fi\fi\fi
6566 % Write the toc entry (before \donoderef). See comments in \chapmacro.
6567 \writetocentry{\toctype\sectionlevel}{#1}{#4}%
6569 % Write the node reference (= pdf destination for pdftex).
6570 % Again, see comments in \chapmacro.
6571 \donoderef{#3}%
6573 % Interline glue will be inserted when the vbox is completed.
6574 % That glue will be a valid breakpoint for the page, since it'll be
6575 % preceded by a whatsit (usually from the \donoderef, or from the
6576 % \writetocentry if there was no node). We don't want to allow that
6577 % break, since then the whatsits could end up on page n while the
6578 % section is on page n+1, thus toc/etc. are wrong. Debian bug 276000.
6579 \nobreak
6581 % Output the actual section heading.
6582 \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright
6583 \hangindent=\wd0 % zero if no section number
6584 \unhbox0 #1}%
6586 % Add extra space after the heading -- half of whatever came above it.
6587 % Don't allow stretch, though.
6588 \kern .5 \csname #2headingskip\endcsname
6590 % Do not let the kern be a potential breakpoint, as it would be if it
6591 % was followed by glue.
6592 \nobreak
6594 % We'll almost certainly start a paragraph next, so don't let that
6595 % glue accumulate. (Not a breakpoint because it's preceded by a
6596 % discardable item.) However, when a paragraph is not started next
6597 % (\startdefun, \cartouche, \center, etc.), this needs to be wiped out
6598 % or the negative glue will cause weirdly wrong output, typically
6599 % obscuring the section heading with something else.
6600 \vskip-\parskip
6602 % This is so the last item on the main vertical list is a known
6603 % \penalty > 10000, so \startdefun, etc., can recognize the situation
6604 % and do the needful.
6605 \penalty 10001
6609 \message{toc,}
6610 % Table of contents.
6611 \newwrite\tocfile
6613 % Write an entry to the toc file, opening it if necessary.
6614 % Called from @chapter, etc.
6616 % Example usage: \writetocentry{sec}{Section Name}{\the\chapno.\the\secno}
6617 % We append the current node name (if any) and page number as additional
6618 % arguments for the \{chap,sec,...}entry macros which will eventually
6619 % read this. The node name is used in the pdf outlines as the
6620 % destination to jump to.
6622 % We open the .toc file for writing here instead of at @setfilename (or
6623 % any other fixed time) so that @contents can be anywhere in the document.
6624 % But if #1 is `omit', then we don't do anything. This is used for the
6625 % table of contents chapter openings themselves.
6627 \newif\iftocfileopened
6628 \def\omitkeyword{omit}%
6630 \def\writetocentry#1#2#3{%
6631 \edef\writetoctype{#1}%
6632 \ifx\writetoctype\omitkeyword \else
6633 \iftocfileopened\else
6634 \immediate\openout\tocfile = \jobname.toc
6635 \global\tocfileopenedtrue
6638 \iflinks
6639 {\atdummies
6640 \edef\temp{%
6641 \write\tocfile{@#1entry{#2}{#3}{\lastnode}{\noexpand\folio}}}%
6642 \temp
6647 % Tell \shipout to create a pdf destination on each page, if we're
6648 % writing pdf. These are used in the table of contents. We can't
6649 % just write one on every page because the title pages are numbered
6650 % 1 and 2 (the page numbers aren't printed), and so are the first
6651 % two pages of the document. Thus, we'd have two destinations named
6652 % `1', and two named `2'.
6653 \ifpdforxetex
6654 \global\pdfmakepagedesttrue
6659 % These characters do not print properly in the Computer Modern roman
6660 % fonts, so we must take special care. This is more or less redundant
6661 % with the Texinfo input format setup at the end of this file.
6663 \def\activecatcodes{%
6664 \catcode`\"=\active
6665 \catcode`\$=\active
6666 \catcode`\<=\active
6667 \catcode`\>=\active
6668 \catcode`\\=\active
6669 \catcode`\^=\active
6670 \catcode`\_=\active
6671 \catcode`\|=\active
6672 \catcode`\~=\active
6676 % Read the toc file, which is essentially Texinfo input.
6677 \def\readtocfile{%
6678 \setupdatafile
6679 \activecatcodes
6680 \input \tocreadfilename
6683 % process toc file to find the maximum width of the section numbers for
6684 % each chapter
6685 \def\findsecnowidths{%
6686 \begingroup
6687 \setupdatafile
6688 \activecatcodes
6689 \secentryfonts
6690 % Redefinitions
6691 \def\numchapentry##1##2##3##4{%
6692 \def\curchapname{secnowidth-##2}%
6693 \curchapmax=0pt
6695 \let\appentry\numchapentry
6697 \def\numsecentry##1##2##3##4{%
6698 \def\cursecname{secnowidth-##2}%
6699 \cursecmax=0pt
6701 \setbox0=\hbox{##2}%
6702 \ifdim\wd0>\curchapmax
6703 \curchapmax=\wd0
6704 \expandafter\xdef\csname\curchapname\endcsname{\the\wd0}%
6707 \let\appsecentry\numsecentry
6709 \def\numsubsecentry##1##2##3##4{%
6710 \def\curssecname{secnowidth-##2}%
6711 \curssecmax=0pt
6713 \setbox0=\hbox{##2}%
6714 \ifdim\wd0>\cursecmax
6715 \cursecmax=\wd0
6716 \expandafter\xdef\csname\cursecname\endcsname{\the\wd0}%
6719 \let\appsubsecentry\numsubsecentry
6721 \def\numsubsubsecentry##1##2##3##4{%
6722 \setbox0=\hbox{##2}%
6723 \ifdim\wd0>\curssecmax
6724 \curssecmax=\wd0
6725 \expandafter\xdef\csname\curssecname\endcsname{\the\wd0}%
6728 \let\appsubsubsecentry\numsubsubsecentry
6730 % Discard any output by outputting to dummy vbox, in case the toc file
6731 % contains macros that we have not redefined above.
6732 \setbox\dummybox\vbox\bgroup
6733 \input \tocreadfilename\relax
6734 \egroup
6735 \endgroup
6737 \newdimen\curchapmax
6738 \newdimen\cursecmax
6739 \newdimen\curssecmax
6742 % set #1 to the maximum section width for #2
6743 \def\retrievesecnowidth#1#2{%
6744 \expandafter\let\expandafter\savedsecnowidth \csname secnowidth-#2\endcsname
6745 \ifx\savedsecnowidth\relax
6746 #1=0pt
6747 \else
6748 #1=\savedsecnowidth
6751 \newdimen\secnowidthchap
6752 \secnowidthchap=0pt
6753 \newdimen\secnowidthsec
6754 \secnowidthsec=0pt
6755 \newdimen\secnowidthssec
6756 \secnowidthssec=0pt
6759 \newskip\contentsrightmargin \contentsrightmargin=1in
6760 \newcount\savepageno
6761 \newcount\lastnegativepageno \lastnegativepageno = -1
6763 % Prepare to read what we've written to \tocfile.
6765 \def\startcontents#1{%
6766 % If @setchapternewpage on, and @headings double, the contents should
6767 % start on an odd page, unlike chapters.
6768 \contentsalignmacro
6769 \immediate\closeout\tocfile
6771 % Don't need to put `Contents' or `Short Contents' in the headline.
6772 % It is abundantly clear what they are.
6773 \chapmacro{#1}{Yomitfromtoc}{}%
6775 \savepageno = \pageno
6776 \begingroup % Set up to handle contents files properly.
6777 \raggedbottom % Worry more about breakpoints than the bottom.
6778 \entryrightmargin=\contentsrightmargin % Don't use the full line length.
6780 % Roman numerals for page numbers.
6781 \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi
6782 \def\thistitle{}% no title in double-sided headings
6783 % Record where the Roman numerals started.
6784 \ifnum\romancount=0 \global\romancount=\pagecount \fi
6785 \linkentrytexttrue
6788 % \raggedbottom in plain.tex hardcodes \topskip so override it
6789 \catcode`\@=11
6790 \def\raggedbottom{\advance\topskip by 0pt plus60pt \r@ggedbottomtrue}
6791 \catcode`\@=\other
6793 % redefined for the two-volume lispref. We always output on
6794 % \jobname.toc even if this is redefined.
6796 \def\tocreadfilename{\jobname.toc}
6798 % Normal (long) toc.
6800 \def\contents{%
6801 \startcontents{\putwordTOC}%
6802 \openin 1 \tocreadfilename\space
6803 \ifeof 1 \else
6804 \findsecnowidths
6805 \readtocfile
6807 \vfill \eject
6808 \contentsalignmacro % in case @setchapternewpage odd is in effect
6809 \ifeof 1 \else
6810 \pdfmakeoutlines
6812 \closein 1
6813 \endgroup
6814 \contentsendroman
6817 % And just the chapters.
6818 \def\summarycontents{%
6819 \startcontents{\putwordShortTOC}%
6821 \let\partentry = \shortpartentry
6822 \let\numchapentry = \shortchapentry
6823 \let\appentry = \shortchapentry
6824 \let\unnchapentry = \shortunnchapentry
6825 % We want a true roman here for the page numbers.
6826 \secfonts
6827 \let\rm=\shortcontrm \let\bf=\shortcontbf
6828 \let\sl=\shortcontsl \let\tt=\shortconttt
6830 \hyphenpenalty = 10000
6831 \advance\baselineskip by 1pt % Open it up a little.
6832 \extrasecnoskip=0.4pt
6833 \def\numsecentry##1##2##3##4{}
6834 \let\appsecentry = \numsecentry
6835 \let\unnsecentry = \numsecentry
6836 \let\numsubsecentry = \numsecentry
6837 \let\appsubsecentry = \numsecentry
6838 \let\unnsubsecentry = \numsecentry
6839 \let\numsubsubsecentry = \numsecentry
6840 \let\appsubsubsecentry = \numsecentry
6841 \let\unnsubsubsecentry = \numsecentry
6842 \openin 1 \tocreadfilename\space
6843 \ifeof 1 \else
6844 \readtocfile
6846 \closein 1
6847 \vfill \eject
6848 \contentsalignmacro % in case @setchapternewpage odd is in effect
6849 \endgroup
6850 \contentsendroman
6852 \let\shortcontents = \summarycontents
6854 % Get ready to use Arabic numerals again
6855 \def\contentsendroman{%
6856 \lastnegativepageno = \pageno
6857 \global\pageno=1
6858 \contentsendcount = \pagecount
6861 % Typeset the label for a chapter or appendix for the short contents.
6862 % The arg is, e.g., `A' for an appendix, or `3' for a chapter.
6864 \def\shortchaplabel#1{%
6865 % This space should be enough, since a single number is .5em, and the
6866 % widest letter (M) is 1em, at least in the Computer Modern fonts.
6867 % But use \hss just in case.
6869 % We'd like to right-justify chapter numbers, but that looks strange
6870 % with appendix letters. And right-justifying numbers and
6871 % left-justifying letters looks strange when there is less than 10
6872 % chapters. Have to read the whole toc once to know how many chapters
6873 % there are before deciding ...
6874 \hbox to 1em{#1\hss}%
6877 % These macros generate individual entries in the table of contents,
6878 % and are read in from the *.toc file.
6880 % The arguments are like:
6881 % \def\numchapentry#1#2#3#4
6882 % #1 - the chapter or section name.
6883 % #2 - section number
6884 % #3 - level of section (e.g "chap", "sec")
6885 % #4 - page number
6887 % Parts, in the main contents. Replace the part number, which doesn't
6888 % exist, with an empty box. Let's hope all the numbers have the same width.
6889 % Also ignore the page number, which is conventionally not printed.
6890 \def\numeralbox{\setbox0=\hbox{8}\hbox to \wd0{\hfil}}
6891 \def\partentry#1#2#3#4{%
6892 % Add stretch and a bonus for breaking the page before the part heading.
6893 % This reduces the chance of the page being broken immediately after the
6894 % part heading, before a following chapter heading.
6895 \vskip 0pt plus 5\baselineskip
6896 \penalty-300
6897 \vskip 0pt plus -5\baselineskip
6898 \dochapentry{#1}{\numeralbox}{}%
6901 % Parts, in the short toc.
6902 \def\shortpartentry#1#2#3#4{%
6903 \penalty-300
6904 \vskip.5\baselineskip plus.15\baselineskip minus.1\baselineskip
6905 \shortchapentry{{\bf #1}}{\numeralbox}{}{}%
6908 % Chapters, in the main contents.
6909 \def\numchapentry#1#2#3#4{%
6910 \retrievesecnowidth\secnowidthchap{#2}%
6911 \dochapentry{#1}{#2}{#4}%
6914 % Chapters, in the short toc.
6915 \def\shortchapentry#1#2#3#4{%
6916 \tocentry{#1}{\shortchaplabel{#2}}{#4}%
6919 % Appendices, in the main contents.
6920 % Need the word Appendix, and a fixed-size box.
6922 \def\appendixbox#1{%
6923 % We use M since it's probably the widest letter.
6924 \setbox0 = \hbox{\putwordAppendix{} M}%
6925 \hbox to \wd0{\putwordAppendix{} #1\hss}}
6927 \def\appentry#1#2#3#4{%
6928 \retrievesecnowidth\secnowidthchap{#2}%
6929 \dochapentry{\appendixbox{#2}\hskip.7em#1}{}{#4}%
6932 % Unnumbered chapters.
6933 \def\unnchapentry#1#2#3#4{\dochapentry{#1}{}{#4}}
6934 \def\shortunnchapentry#1#2#3#4{\tocentry{#1}{}{#4}}
6936 % Sections.
6937 \def\numsecentry#1#2#3#4{\dosecentry{#1}{#2}{#4}}
6939 \def\numsecentry#1#2#3#4{%
6940 \retrievesecnowidth\secnowidthsec{#2}%
6941 \dosecentry{#1}{#2}{#4}%
6943 \let\appsecentry=\numsecentry
6944 \def\unnsecentry#1#2#3#4{%
6945 \retrievesecnowidth\secnowidthsec{#2}%
6946 \dosecentry{#1}{}{#4}%
6949 % Subsections.
6950 \def\numsubsecentry#1#2#3#4{%
6951 \retrievesecnowidth\secnowidthssec{#2}%
6952 \dosubsecentry{#1}{#2}{#4}%
6954 \let\appsubsecentry=\numsubsecentry
6955 \def\unnsubsecentry#1#2#3#4{%
6956 \retrievesecnowidth\secnowidthssec{#2}%
6957 \dosubsecentry{#1}{}{#4}%
6960 % And subsubsections.
6961 \def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#2}{#4}}
6962 \let\appsubsubsecentry=\numsubsubsecentry
6963 \def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{}{#4}}
6965 % This parameter controls the indentation of the various levels.
6966 % Same as \defaultparindent.
6967 \newdimen\tocindent \tocindent = 15pt
6969 % Now for the actual typesetting. In all these, #1 is the text, #2 is
6970 % a section number if present, and #3 is the page number.
6972 % If the toc has to be broken over pages, we want it to be at chapters
6973 % if at all possible; hence the \penalty.
6974 \def\dochapentry#1#2#3{%
6975 \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip
6976 \begingroup
6977 % Move the page numbers slightly to the right
6978 \advance\entryrightmargin by -0.05em
6979 \chapentryfonts
6980 \extrasecnoskip=0.4em % separate chapter number more
6981 \tocentry{#1}{#2}{#3}%
6982 \endgroup
6983 \nobreak\vskip .25\baselineskip plus.1\baselineskip
6986 \def\dosecentry#1#2#3{\begingroup
6987 \secnowidth=\secnowidthchap
6988 \secentryfonts \leftskip=\tocindent
6989 \tocentry{#1}{#2}{#3}%
6990 \endgroup}
6992 \def\dosubsecentry#1#2#3{\begingroup
6993 \secnowidth=\secnowidthsec
6994 \subsecentryfonts \leftskip=2\tocindent
6995 \tocentry{#1}{#2}{#3}%
6996 \endgroup}
6998 \def\dosubsubsecentry#1#2#3{\begingroup
6999 \secnowidth=\secnowidthssec
7000 \subsubsecentryfonts \leftskip=3\tocindent
7001 \tocentry{#1}{#2}{#3}%
7002 \endgroup}
7004 % Used for the maximum width of a section number so we can align
7005 % section titles.
7006 \newdimen\secnowidth
7007 \secnowidth=0pt
7008 \newdimen\extrasecnoskip
7009 \extrasecnoskip=0pt
7011 % \tocentry{TITLE}{SEC NO}{PAGE}
7013 \def\tocentry#1#2#3{%
7014 \def\secno{#2}%
7015 \ifx\empty\secno
7016 \entry{#1}{#3}%
7017 \else
7018 \ifdim 0pt=\secnowidth
7019 \setbox0=\hbox{#2\hskip\labelspace\hskip\extrasecnoskip}%
7020 \else
7021 \advance\secnowidth by \labelspace
7022 \advance\secnowidth by \extrasecnoskip
7023 \setbox0=\hbox to \secnowidth{%
7024 #2\hskip\labelspace\hskip\extrasecnoskip\hfill}%
7026 \entrycontskip=\wd0
7027 \entry{\box0 #1}{#3}%
7030 \newdimen\labelspace
7031 \labelspace=0.6em
7033 \def\chapentryfonts{\secfonts \rm}
7034 \def\secentryfonts{\textfonts}
7035 \def\subsecentryfonts{\textfonts}
7036 \def\subsubsecentryfonts{\textfonts}
7039 \message{environments,}
7040 % @foo ... @end foo.
7042 % @tex ... @end tex escapes into raw TeX temporarily.
7043 % One exception: @ is still an escape character, so that @end tex works.
7044 % But \@ or @@ will get a plain @ character.
7046 \envdef\tex{%
7047 \setregularquotes
7048 \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
7049 \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
7050 \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie
7051 \catcode `\%=14
7052 \catcode `\+=\other
7053 \catcode `\"=\other
7054 \catcode `\|=\other
7055 \catcode `\<=\other
7056 \catcode `\>=\other
7057 \catcode `\`=\other
7058 \catcode `\'=\other
7060 % ' is active in math mode (mathcode"8000). So reset it, and all our
7061 % other math active characters (just in case), to plain's definitions.
7062 \mathactive
7064 % Inverse of the list at the beginning of the file.
7065 \let\b=\ptexb
7066 \let\bullet=\ptexbullet
7067 \let\c=\ptexc
7068 \let\,=\ptexcomma
7069 \let\.=\ptexdot
7070 \let\dots=\ptexdots
7071 \let\equiv=\ptexequiv
7072 \let\!=\ptexexclam
7073 \let\i=\ptexi
7074 \let\indent=\ptexindent
7075 \let\noindent=\ptexnoindent
7076 \let\{=\ptexlbrace
7077 \let\+=\tabalign
7078 \let\}=\ptexrbrace
7079 \let\/=\ptexslash
7080 \let\sp=\ptexsp
7081 \let\*=\ptexstar
7082 %\let\sup=\ptexsup % do not redefine, we want @sup to work in math mode
7083 \let\t=\ptext
7084 \expandafter \let\csname top\endcsname=\ptextop % we've made it outer
7085 \let\frenchspacing=\plainfrenchspacing
7087 \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
7088 \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}%
7089 \def\@{@}%
7091 % There is no need to define \Etex.
7093 % Define @lisp ... @end lisp.
7094 % @lisp environment forms a group so it can rebind things,
7095 % including the definition of @end lisp (which normally is erroneous).
7097 % Amount to narrow the margins by for @lisp.
7098 \newskip\lispnarrowing \lispnarrowing=0.4in
7100 % This is the definition that ^^M gets inside @lisp, @example, and other
7101 % such environments. \null is better than a space, since it doesn't
7102 % have any width.
7103 \def\lisppar{\null\endgraf}
7105 % This space is always present above and below environments.
7106 \newskip\envskipamount \envskipamount = 0pt
7108 % Make spacing and below environment symmetrical. We use \parskip here
7109 % to help in doing that, since in @example-like environments \parskip
7110 % is reset to zero; thus the \afterenvbreak inserts no space -- but the
7111 % start of the next paragraph will insert \parskip.
7113 \def\aboveenvbreak{{%
7114 % =10000 instead of <10000 because of a special case in \itemzzz and
7115 % \sectionheading, q.v.
7116 \ifnum \lastpenalty=10000 \else
7117 \advance\envskipamount by \parskip
7118 \endgraf
7119 \ifdim\lastskip<\envskipamount
7120 \removelastskip
7121 \ifnum\lastpenalty<10000
7122 % Penalize breaking before the environment, because preceding text
7123 % often leads into it.
7124 \penalty100
7126 \vskip\envskipamount
7131 \def\afterenvbreak{{%
7132 % =10000 instead of <10000 because of a special case in \itemzzz and
7133 % \sectionheading, q.v.
7134 \ifnum \lastpenalty=10000 \else
7135 \advance\envskipamount by \parskip
7136 \endgraf
7137 \ifdim\lastskip<\envskipamount
7138 \removelastskip
7139 % it's not a good place to break if the last penalty was \nobreak
7140 % or better ...
7141 \ifnum\lastpenalty<10000 \penalty-50 \fi
7142 \vskip\envskipamount
7147 % \nonarrowing is a flag. If "set", @lisp etc don't narrow margins; it will
7148 % also clear it, so that its embedded environments do the narrowing again.
7149 \let\nonarrowing=\relax
7151 % @cartouche ... @end cartouche: draw rectangle w/rounded corners around
7152 % environment contents.
7155 \def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth
7156 \def\ctr{{\hskip 6pt\circle\char'010}}
7157 \def\cbl{{\circle\char'012\hskip -6pt}}
7158 \def\cbr{{\hskip 6pt\circle\char'011}}
7159 \def\carttop{\hbox to \cartouter{\hskip\lskip
7160 \ctl\leaders\hrule height\circthick\hfil\ctr
7161 \hskip\rskip}}
7162 \def\cartbot{\hbox to \cartouter{\hskip\lskip
7163 \cbl\leaders\hrule height\circthick\hfil\cbr
7164 \hskip\rskip}}
7166 \newskip\lskip\newskip\rskip
7168 % only require the font if @cartouche is actually used
7169 \def\cartouchefontdefs{%
7170 \font\circle=lcircle10\relax
7171 \circthick=\fontdimen8\circle
7173 \newdimen\circthick
7174 \newdimen\cartouter\newdimen\cartinner
7175 \newskip\normbskip\newskip\normpskip\newskip\normlskip
7177 \envparseargdef\cartouche{%
7178 \cartouchefontdefs
7179 \ifhmode\par\fi % can't be in the midst of a paragraph.
7180 \startsavinginserts
7181 \lskip=\leftskip \rskip=\rightskip
7182 \leftskip=0pt\rightskip=0pt % we want these *outside*.
7184 % Set paragraph width for text inside cartouche. There are
7185 % left and right margins of 3pt each plus two vrules 0.4pt each.
7186 \cartinner=\hsize \advance\cartinner by-\lskip
7187 \advance\cartinner by-\rskip
7188 \advance\cartinner by -6.8pt
7190 % For drawing top and bottom of cartouche. Each corner char
7191 % adds 6pt and we take off the width of a rule to line up with the
7192 % right boundary perfectly.
7193 \cartouter=\hsize
7194 \advance\cartouter by 11.6pt
7196 \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
7198 % If this cartouche directly follows a sectioning command, we need the
7199 % \parskip glue (backspaced over by default) or the cartouche can
7200 % collide with the section heading.
7201 \ifnum\lastpenalty>10000 \vskip\parskip \penalty\lastpenalty \fi
7203 \setbox\groupbox=\vtop\bgroup
7204 \baselineskip=0pt\parskip=0pt\lineskip=0pt
7205 \carttop
7206 \hbox\bgroup
7207 \hskip\lskip
7208 \vrule\kern3pt
7209 \vbox\bgroup
7210 \hsize=\cartinner
7211 \baselineskip=\normbskip
7212 \lineskip=\normlskip
7213 \parskip=\normpskip
7214 \def\arg{#1}%
7215 \ifx\arg\empty\else
7216 \centerV{\hfil \bf #1 \hfil}%
7218 \kern3pt
7219 \vskip -\parskip
7221 \def\Ecartouche{%
7222 \ifhmode\par\fi
7223 \kern3pt
7224 \egroup
7225 \kern3pt\vrule
7226 \hskip\rskip
7227 \egroup
7228 \cartbot
7229 \egroup
7230 \addgroupbox
7231 \checkinserts
7235 % This macro is called at the beginning of all the @example variants,
7236 % inside a group.
7237 \newdimen\nonfillparindent
7238 \def\nonfillstart{%
7239 \aboveenvbreak
7240 \ifdim\hfuzz < 12pt \hfuzz = 12pt \fi % Don't be fussy
7241 \sepspaces % Make spaces be word-separators rather than space tokens.
7242 \let\par = \lisppar % don't ignore blank lines
7243 \obeylines % each line of input is a line of output
7244 \parskip = 0pt
7245 % Turn off paragraph indentation but redefine \indent to emulate
7246 % the normal \indent.
7247 \nonfillparindent=\parindent
7248 \parindent = 0pt
7249 \let\indent\nonfillindent
7251 \emergencystretch = 0pt % don't try to avoid overfull boxes
7252 \ifx\nonarrowing\relax
7253 \advance \leftskip by \lispnarrowing
7254 \exdentamount=\lispnarrowing
7255 \else
7256 \let\nonarrowing = \relax
7258 \let\exdent=\nofillexdent
7261 \begingroup
7262 \obeyspaces
7263 % We want to swallow spaces (but not other tokens) after the fake
7264 % @indent in our nonfill-environments, where spaces are normally
7265 % active and set to @tie, resulting in them not being ignored after
7266 % @indent.
7267 \gdef\nonfillindent{\futurelet\temp\nonfillindentcheck}%
7268 \gdef\nonfillindentcheck{%
7269 \ifx\temp %
7270 \expandafter\nonfillindentgobble%
7271 \else%
7272 \leavevmode\nonfillindentbox%
7273 \fi%
7275 \endgroup
7276 \def\nonfillindentgobble#1{\nonfillindent}
7277 \def\nonfillindentbox{\hbox to \nonfillparindent{\hss}}
7279 % If you want all examples etc. small: @set dispenvsize small.
7280 % If you want even small examples the full size: @set dispenvsize nosmall.
7281 % This affects the following displayed environments:
7282 % @example, @display, @format, @lisp, @verbatim
7284 \def\smallword{small}
7285 \def\nosmallword{nosmall}
7286 \let\SETdispenvsize\relax
7287 \def\setnormaldispenv{%
7288 \ifx\SETdispenvsize\smallword
7289 % end paragraph for sake of leading, in case document has no blank
7290 % line. This is redundant with what happens in \aboveenvbreak, but
7291 % we need to do it before changing the fonts, and it's inconvenient
7292 % to change the fonts afterward.
7293 \ifnum \lastpenalty=10000 \else \endgraf \fi
7294 \smallexamplefonts \rm
7297 \def\setsmalldispenv{%
7298 \ifx\SETdispenvsize\nosmallword
7299 \else
7300 \ifnum \lastpenalty=10000 \else \endgraf \fi
7301 \smallexamplefonts \rm
7305 % We often define two environments, @foo and @smallfoo.
7306 % Let's do it in one command. #1 is the env name, #2 the definition.
7307 \def\makedispenvdef#1#2{%
7308 \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2}%
7309 \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2}%
7310 \expandafter\let\csname E#1\endcsname \afterenvbreak
7311 \expandafter\let\csname Esmall#1\endcsname \afterenvbreak
7314 % Define two environment synonyms (#1 and #2) for an environment.
7315 \def\maketwodispenvdef#1#2#3{%
7316 \makedispenvdef{#1}{#3}%
7317 \makedispenvdef{#2}{#3}%
7320 % @lisp: indented, narrowed, typewriter font;
7321 % @example: same as @lisp.
7323 % @smallexample and @smalllisp: use smaller fonts.
7324 % Originally contributed by Pavel@xerox.
7326 \maketwodispenvdef{lisp}{example}{%
7327 \nonfillstart
7328 \tt\setcodequotes
7329 \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
7330 \parsearg\gobble
7332 % @display/@smalldisplay: same as @lisp except keep current font.
7334 \makedispenvdef{display}{%
7335 \nonfillstart
7336 \gobble
7339 % @format/@smallformat: same as @display except don't narrow margins.
7341 \makedispenvdef{format}{%
7342 \let\nonarrowing = t%
7343 \nonfillstart
7344 \gobble
7347 % @flushleft: same as @format, but doesn't obey \SETdispenvsize.
7348 \envdef\flushleft{%
7349 \let\nonarrowing = t%
7350 \nonfillstart
7351 \gobble
7353 \let\Eflushleft = \afterenvbreak
7355 % @flushright.
7357 \envdef\flushright{%
7358 \let\nonarrowing = t%
7359 \nonfillstart
7360 \advance\leftskip by 0pt plus 1fill\relax
7361 \gobble
7363 \let\Eflushright = \afterenvbreak
7366 % @raggedright does more-or-less normal line breaking but no right
7367 % justification. From plain.tex.
7368 \envdef\raggedright{%
7369 \rightskip0pt plus2.4em \spaceskip.3333em \xspaceskip.5em\relax
7371 \let\Eraggedright\par
7374 % @quotation does normal linebreaking (hence we can't use \nonfillstart)
7375 % and narrows the margins. We keep \parskip nonzero in general, since
7376 % we're doing normal filling. So, when using \aboveenvbreak and
7377 % \afterenvbreak, temporarily make \parskip 0.
7379 \makedispenvdef{quotation}{\quotationstart}
7381 \def\quotationstart{%
7382 \indentedblockstart % same as \indentedblock, but increase right margin too.
7383 \ifx\nonarrowing\relax
7384 \advance\rightskip by \lispnarrowing
7386 \parsearg\quotationlabel
7389 % We have retained a nonzero parskip for the environment, since we're
7390 % doing normal filling.
7392 \def\Equotation{%
7393 \par
7394 \ifx\quotationauthor\thisisundefined\else
7395 % indent a bit.
7396 \leftline{\kern 2\leftskip \sl ---\quotationauthor}%
7398 {\parskip=0pt \afterenvbreak}%
7400 \def\Esmallquotation{\Equotation}
7402 % If we're given an argument, typeset it in bold with a colon after.
7403 \def\quotationlabel#1{%
7404 \def\temp{#1}%
7405 \ifx\temp\empty \else
7406 {\bf #1: }%
7410 % @indentedblock is like @quotation, but indents only on the left and
7411 % has no optional argument.
7413 \makedispenvdef{indentedblock}{\indentedblockstart}
7415 \def\indentedblockstart{%
7416 {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
7417 \parindent=0pt
7419 % @cartouche defines \nonarrowing to inhibit narrowing at next level down.
7420 \ifx\nonarrowing\relax
7421 \advance\leftskip by \lispnarrowing
7422 \exdentamount = \lispnarrowing
7423 \else
7424 \let\nonarrowing = \relax
7428 % Keep a nonzero parskip for the environment, since we're doing normal filling.
7430 \def\Eindentedblock{%
7431 \par
7432 {\parskip=0pt \afterenvbreak}%
7434 \def\Esmallindentedblock{\Eindentedblock}
7437 % LaTeX-like @verbatim...@end verbatim and @verb{<char>...<char>}
7438 % If we want to allow any <char> as delimiter,
7439 % we need the curly braces so that makeinfo sees the @verb command, eg:
7440 % `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org
7442 % [Knuth]: Donald Ervin Knuth, 1996. The TeXbook.
7444 % [Knuth] p.344; only we need to do the other characters Texinfo sets
7445 % active too. Otherwise, they get lost as the first character on a
7446 % verbatim line.
7447 \def\dospecials{%
7448 \do\ \do\\\do\{\do\}\do\$\do\&%
7449 \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~%
7450 \do\<\do\>\do\|\do\@\do+\do\"%
7451 % Don't do the quotes -- if we do, @set txicodequoteundirected and
7452 % @set txicodequotebacktick will not have effect on @verb and
7453 % @verbatim, and ?` and !` ligatures won't get disabled.
7454 %\do\`\do\'%
7457 % [Knuth] p. 380
7458 \def\uncatcodespecials{%
7459 \def\do##1{\catcode`##1=\other}\dospecials}
7461 % Setup for the @verb command.
7463 % Eight spaces for a tab
7464 \begingroup
7465 \catcode`\^^I=\active
7466 \gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }}
7467 \endgroup
7469 \def\setupverb{%
7471 \def\par{\leavevmode\endgraf}%
7472 \parindent = 0pt
7473 \setcodequotes
7474 \tabeightspaces
7475 % Respect line breaks,
7476 % print special symbols as themselves, and
7477 % make each space count
7478 % must do in this order:
7479 \obeylines \uncatcodespecials \sepspaces
7482 % Setup for the @verbatim environment
7484 % Real tab expansion.
7485 \newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount
7487 % We typeset each line of the verbatim in an \hbox, so we can handle
7488 % tabs.
7489 \newbox\verbbox
7490 \def\starttabbox{\setbox\verbbox=\hbox\bgroup}
7492 \begingroup
7493 \catcode`\^^I=\active
7494 \gdef\tabexpand{%
7495 \catcode`\^^I=\active
7496 \def^^I{\leavevmode\egroup
7497 \dimen\verbbox=\wd\verbbox % the width so far, or since the previous tab
7498 \divide\dimen\verbbox by\tabw
7499 \multiply\dimen\verbbox by\tabw % compute previous multiple of \tabw
7500 \advance\dimen\verbbox by\tabw % advance to next multiple of \tabw
7501 \wd\verbbox=\dimen\verbbox
7502 \leavevmode\box\verbbox \starttabbox
7505 \endgroup
7507 % start the verbatim environment.
7508 \def\setupverbatim{%
7509 \let\nonarrowing = t%
7510 \nonfillstart
7511 \tt % easiest (and conventionally used) font for verbatim
7512 \def\par{\egroup\leavevmode\box\verbbox\endgraf\starttabbox}%
7513 \tabexpand
7514 \setcodequotes
7515 % Respect line breaks,
7516 % print special symbols as themselves, and
7517 % make each space count.
7518 % Must do in this order:
7519 \obeylines \uncatcodespecials \sepspaces
7522 % Do the @verb magic: verbatim text is quoted by unique
7523 % delimiter characters. Before first delimiter expect a
7524 % right brace, after last delimiter expect closing brace:
7526 % \def\doverb'{'<char>#1<char>'}'{#1}
7528 % [Knuth] p. 382; only eat outer {}
7529 \begingroup
7530 \catcode`[=1\catcode`]=2\catcode`\{=\other\catcode`\}=\other
7531 \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next]
7532 \endgroup
7534 \def\verb{\begingroup\setupverb\doverb}
7537 % Do the @verbatim magic: define the macro \doverbatim so that
7538 % the (first) argument ends when '@end verbatim' is reached, ie:
7540 % \def\doverbatim#1@end verbatim{#1}
7542 % For Texinfo it's a lot easier than for LaTeX,
7543 % because texinfo's \verbatim doesn't stop at '\end{verbatim}':
7544 % we need not redefine '\', '{' and '}'.
7546 % Inspired by LaTeX's verbatim command set [latex.ltx]
7548 \begingroup
7549 \catcode`\ =\active
7550 \obeylines %
7551 % ignore everything up to the first ^^M, that's the newline at the end
7552 % of the @verbatim input line itself. Otherwise we get an extra blank
7553 % line in the output.
7554 \xdef\doverbatim#1^^M#2@end verbatim{%
7555 \starttabbox#2\egroup\noexpand\end\gobble verbatim}%
7556 % We really want {...\end verbatim} in the body of the macro, but
7557 % without the active space; thus we have to use \xdef and \gobble.
7558 % The \egroup ends the \verbbox started at the end of the last line in
7559 % the block.
7560 \endgroup
7562 \envdef\verbatim{%
7563 \setnormaldispenv\setupverbatim\doverbatim
7565 \let\Everbatim = \afterenvbreak
7568 % @verbatiminclude FILE - insert text of file in verbatim environment.
7570 \def\verbatiminclude{\parseargusing\filenamecatcodes\doverbatiminclude}
7572 \def\doverbatiminclude#1{%
7574 \makevalueexpandable
7575 \setupverbatim
7577 \indexnofonts % Allow `@@' and other weird things in file names.
7578 \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}%
7579 \edef\tmp{\noexpand\input #1 }
7580 \expandafter
7581 }\expandafter\starttabbox\tmp\egroup
7582 \afterenvbreak
7586 % @copying ... @end copying.
7587 % Save the text away for @insertcopying later.
7589 % We save the uninterpreted tokens, rather than creating a box.
7590 % Saving the text in a box would be much easier, but then all the
7591 % typesetting commands (@smallbook, font changes, etc.) have to be done
7592 % beforehand -- and a) we want @copying to be done first in the source
7593 % file; b) letting users define the frontmatter in as flexible order as
7594 % possible is desirable.
7596 \def\copying{\checkenv{}\begingroup\macrobodyctxt\docopying}
7597 {\catcode`\ =\other
7598 \gdef\docopying#1@end copying{\endgroup\def\copyingtext{#1}}
7601 \def\insertcopying{%
7602 \begingroup
7603 \parindent = 0pt % paragraph indentation looks wrong on title page
7604 \scanexp\copyingtext
7605 \endgroup
7609 \message{defuns,}
7610 % @defun etc.
7612 \newskip\defbodyindent \defbodyindent=.4in
7613 \newskip\defargsindent \defargsindent=50pt
7614 \newskip\deflastargmargin \deflastargmargin=18pt
7615 \newcount\defunpenalty
7617 % Start the processing of @deffn:
7618 \def\startdefun{%
7619 \ifnum\lastpenalty<10000
7620 \medbreak
7621 \defunpenalty=10003 % Will keep this @deffn together with the
7622 % following @def command, see below.
7623 \else
7624 % If there are two @def commands in a row, we'll have a \nobreak,
7625 % which is there to keep the function description together with its
7626 % header. But if there's nothing but headers, we need to allow a
7627 % break somewhere. Check specifically for penalty 10002, inserted
7628 % by \printdefunline, instead of 10000, since the sectioning
7629 % commands also insert a nobreak penalty, and we don't want to allow
7630 % a break between a section heading and a defun.
7632 % As a further refinement, we avoid "club" headers by signalling
7633 % with penalty of 10003 after the very first @deffn in the
7634 % sequence (see above), and penalty of 10002 after any following
7635 % @def command.
7636 \ifnum\lastpenalty=10002 \penalty2000 \else \defunpenalty=10002 \fi
7638 % Similarly, after a section heading, do not allow a break.
7639 % But do insert the glue.
7640 \medskip % preceded by discardable penalty, so not a breakpoint
7643 \parindent=0in
7644 \advance\leftskip by \defbodyindent
7645 \exdentamount=\defbodyindent
7648 % Called as \printdefunline \deffooheader{text}
7650 \def\printdefunline#1#2{%
7651 \begingroup
7652 \plainfrenchspacing
7653 % call \deffooheader:
7654 #1#2 \endheader
7655 % common ending:
7656 \interlinepenalty = 10000
7657 \advance\rightskip by 0pt plus 1fil\relax
7658 \endgraf
7659 \nobreak\vskip -\parskip
7660 \penalty\defunpenalty % signal to \startdefun and \deffoox
7661 % Some of the @defun-type tags do not enable magic parentheses,
7662 % rendering the following check redundant. But we don't optimize.
7663 \checkparencounts
7664 \endgroup
7667 \def\Edefun{\endgraf\medbreak}
7669 % @defblock, @defline do not automatically create index entries
7670 \envdef\defblock{%
7671 \startdefun
7673 \let\Edefblock\Edefun
7675 \def\defline{%
7676 \doingtypefnfalse
7677 \parseargusing\activeparens{\printdefunline\deflineheader}%
7679 \def\deflineheader#1 #2 #3\endheader{%
7680 \printdefname{#1}{}{#2}\magicamp\defunargs{#3\unskip}%
7683 \def\deftypeline{%
7684 \doingtypefntrue
7685 \parseargusing\activeparens{\printdefunline\deftypelineheader}%
7687 \def\deftypelineheader#1 #2 #3 #4\endheader{%
7688 \printdefname{#1}{#2}{#3}\magicamp\defunargs{#4\unskip}%
7691 % \makedefun{deffoo} (\deffooheader parameters) { (\deffooheader expansion) }
7693 % Define \deffoo, \deffoox \Edeffoo and \deffooheader.
7694 \def\makedefun#1{%
7695 \expandafter\let\csname E#1\endcsname = \Edefun
7696 \edef\temp{\noexpand\domakedefun
7697 \makecsname{#1}\makecsname{#1x}\makecsname{#1header}}%
7698 \temp
7700 \def\domakedefun#1#2#3{%
7701 \envdef#1{%
7702 \startdefun
7703 \doingtypefnfalse % distinguish typed functions from all else
7704 \parseargusing\activeparens{\printdefunline#3}%
7706 \def#2{%
7707 % First, check whether we are in the right environment:
7708 \checkenv#1%
7710 % As in \startdefun, allow line break if we have multiple x headers
7711 % in a row. It's not a great place, though.
7712 \ifnum\lastpenalty=10002 \penalty3000 \else \defunpenalty=10002 \fi
7714 \doingtypefnfalse % distinguish typed functions from all else
7715 \parseargusing\activeparens{\printdefunline#3}%
7717 \def#3% definition of \deffooheader follows
7720 \newif\ifdoingtypefn % doing typed function?
7721 \newif\ifrettypeownline % typeset return type on its own line?
7723 % @deftypefnnewline on|off says whether the return type of typed functions
7724 % are printed on their own line. This affects @deftypefn, @deftypefun,
7725 % @deftypeop, and @deftypemethod.
7727 \parseargdef\deftypefnnewline{%
7728 \def\temp{#1}%
7729 \ifx\temp\onword
7730 \expandafter\let\csname SETtxideftypefnnl\endcsname
7731 = \empty
7732 \else\ifx\temp\offword
7733 \expandafter\let\csname SETtxideftypefnnl\endcsname
7734 = \relax
7735 \else
7736 \errhelp = \EMsimple
7737 \errmessage{Unknown @txideftypefnnl value `\temp',
7738 must be on|off}%
7739 \fi\fi
7742 % Untyped functions:
7744 % @deffn category name args
7745 \makedefun{deffn}#1 #2 #3\endheader{%
7746 \doind{fn}{\code{#2}}%
7747 \printdefname{#1}{}{#2}\magicamp\defunargs{#3\unskip}%
7750 % @defop category class name args
7751 \makedefun{defop}#1 {\defopheaderx{#1\ \putwordon}}
7752 \def\defopheaderx#1#2 #3 #4\endheader{%
7753 \doind{fn}{\code{#3}\space\putwordon\ \code{#2}}%
7754 \printdefname{#1\ \code{#2}}{}{#3}\magicamp\defunargs{#4\unskip}%
7757 % Typed functions:
7759 % @deftypefn category type name args
7760 \makedefun{deftypefn}#1 #2 #3 #4\endheader{%
7761 \doind{fn}{\code{#3}}%
7762 \doingtypefntrue
7763 \printdefname{#1}{#2}{#3}\defunargs{#4\unskip}%
7766 % @deftypeop category class type name args
7767 \makedefun{deftypeop}#1 {\deftypeopheaderx{#1\ \putwordon}}
7768 \def\deftypeopheaderx#1#2 #3 #4 #5\endheader{%
7769 \doind{fn}{\code{#4}\space\putwordon\ \code{#1\ \code{#2}}}%
7770 \doingtypefntrue
7771 \printdefname{#1\ \code{#2}}{#3}{#4}\defunargs{#5\unskip}%
7774 % Typed variables:
7776 % @deftypevr category type var args
7777 \makedefun{deftypevr}#1 #2 #3 #4\endheader{%
7778 \doind{vr}{\code{#3}}%
7779 \printdefname{#1}{#2}{#3}\defunargs{#4\unskip}%
7782 % @deftypecv category class type var args
7783 \makedefun{deftypecv}#1 {\deftypecvheaderx{#1\ \putwordof}}
7784 \def\deftypecvheaderx#1#2 #3 #4 #5\endheader{%
7785 \doind{vr}{\code{#4}\space\putwordof\ \code{#2}}%
7786 \printdefname{#1\ \code{#2}}{#3}{#4}\defunargs{#5\unskip}%
7789 % Untyped variables:
7791 % @defvr category var args
7792 \makedefun{defvr}#1 {\deftypevrheader{#1} {} }
7794 % @defcv category class var args
7795 \makedefun{defcv}#1 {\defcvheaderx{#1\ \putwordof}}
7796 \def\defcvheaderx#1#2 {\deftypecvheaderx{#1}#2 {} }
7798 % Types:
7800 % @deftp category name args
7801 \makedefun{deftp}#1 #2 #3\endheader{%
7802 \doind{tp}{\code{#2}}%
7803 \printdefname{#1}{}{#2}\defunargs{#3\unskip}%
7806 % Remaining @defun-like shortcuts:
7807 \makedefun{defun}{\deffnheader{\putwordDeffunc} }
7808 \makedefun{defmac}{\deffnheader{\putwordDefmac} }
7809 \makedefun{defspec}{\deffnheader{\putwordDefspec} }
7810 \makedefun{deftypefun}{\deftypefnheader{\putwordDeffunc} }
7811 \makedefun{defvar}{\defvrheader{\putwordDefvar} }
7812 \makedefun{defopt}{\defvrheader{\putwordDefopt} }
7813 \makedefun{deftypevar}{\deftypevrheader{\putwordDefvar} }
7814 \makedefun{defmethod}{\defopheaderx\putwordMethodon}
7815 \makedefun{deftypemethod}{\deftypeopheaderx\putwordMethodon}
7816 \makedefun{defivar}{\defcvheaderx\putwordInstanceVariableof}
7817 \makedefun{deftypeivar}{\deftypecvheaderx\putwordInstanceVariableof}
7819 % \printdefname, which formats the name of the @def (not the args).
7820 % #1 is the category, such as "Function".
7821 % #2 is the return type, if any.
7822 % #3 is the function name.
7824 % We are followed by (but not passed) the arguments, if any.
7826 \def\printdefname#1#2#3{%
7827 \par
7828 % Get the values of \leftskip and \rightskip as they were outside the @def...
7829 \advance\leftskip by -\defbodyindent
7831 % Determine if we are typesetting the return type of a typed function
7832 % on a line by itself.
7833 \rettypeownlinefalse
7834 \ifdoingtypefn % doing a typed function specifically?
7835 % then check user option for putting return type on its own line:
7836 \ifflagclear{txideftypefnnl}{}{\rettypeownlinetrue}%
7839 % How we'll format the category name. Putting it in brackets helps
7840 % distinguish it from the body text that may end up on the next line
7841 % just below it.
7842 \def\temp{#1}%
7843 \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi}
7845 % Figure out line sizes for the paragraph shape. We'll always have at
7846 % least two.
7847 \tempnum = 2
7849 % The first line needs space for \box0; but if \rightskip is nonzero,
7850 % we need only space for the part of \box0 which exceeds it:
7851 \dimen0=\hsize \advance\dimen0 by -\wd0 \advance\dimen0 by \rightskip
7853 % If doing a return type on its own line, we'll have another line.
7854 \ifrettypeownline
7855 \advance\tempnum by 1
7856 \def\maybeshapeline{0in \hsize}%
7857 \else
7858 \def\maybeshapeline{}%
7861 % The continuations:
7862 \dimen2=\hsize \advance\dimen2 by -\defargsindent
7864 % The final paragraph shape:
7865 \parshape \tempnum 0in \dimen0 \maybeshapeline \defargsindent \dimen2
7867 % Put the category name at the right margin.
7868 \noindent
7869 \hbox to 0pt{%
7870 \hfil\box0 \kern-\hsize
7871 % \hsize has to be shortened this way:
7872 \kern\leftskip
7873 % Intentionally do not respect \rightskip, since we need the space.
7876 % Allow all lines to be underfull without complaint:
7877 \tolerance=10000 \hbadness=10000
7878 \exdentamount=\defbodyindent
7880 \def\^^M{}% for line continuation
7882 % defun fonts. We use typewriter by default (used to be bold) because:
7883 % . we're printing identifiers, they should be in tt in principle.
7884 % . in languages with many accents, such as Czech or French, it's
7885 % common to leave accents off identifiers. The result looks ok in
7886 % tt, but exceedingly strange in rm.
7887 % . we don't want -- and --- to be treated as ligatures.
7888 % . this still does not fix the ?` and !` ligatures, but so far no
7889 % one has made identifiers using them :).
7890 \df \tt
7891 \def\temp{#2}% text of the return type
7892 \ifx\temp\empty\else
7893 \tclose{\temp}% typeset the return type
7894 \ifrettypeownline
7895 % put return type on its own line; prohibit line break following:
7896 \hfil\vadjust{\nobreak}\break
7897 \else
7898 \space % type on same line, so just followed by a space
7900 \fi % no return type
7901 #3% output function name
7903 \ifflagclear{txidefnamenospace}{%
7904 {\rm\enskip}% hskip 0.5 em of \rmfont
7905 }{}%
7907 \boldbrax
7908 % arguments will be output next, if any.
7911 % Print arguments. Use slanted for @def*, typewriter for @deftype*.
7912 \def\defunargs#1{%
7913 \bgroup
7914 \def\^^M{}% for line continuation
7915 \df \ifdoingtypefn \tt \else \sl \fi
7916 \ifflagclear{txicodevaristt}{}%
7917 {\def\var##1{{\setregularquotes \ttsl ##1}}}%
7919 \egroup
7922 % We want ()&[] to print specially on the defun line.
7924 \def\activeparens{%
7925 \catcode`\(=\active \catcode`\)=\active
7926 \catcode`\[=\active \catcode`\]=\active
7927 \catcode`\&=\active
7930 % Make control sequences which act like normal parenthesis chars.
7931 \let\lparen = ( \let\rparen = )
7933 % Be sure that we always have a definition for `(', etc. For example,
7934 % if the fn name has parens in it, \boldbrax will not be in effect yet,
7935 % so TeX would otherwise complain about undefined control sequence.
7937 \activeparens
7938 \gdef\defcharsdefault{%
7939 \let(=\lparen \let)=\rparen
7940 \let[=\lbrack \let]=\rbrack
7941 \let& = \&%
7943 \globaldefs=1 \defcharsdefault
7945 \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}
7946 \gdef\magicamp{\let&=\amprm}
7948 \let\ampchar\&
7950 \newcount\parencount
7952 % If we encounter &foo, then turn on ()-hacking afterwards
7953 \newif\ifampseen
7954 \def\amprm#1 {\ampseentrue{\rm\&#1 }}
7956 \def\parenfont{%
7957 \ifampseen
7958 % At the first level, print parens in roman,
7959 % otherwise use the default font.
7960 \ifnum \parencount=1 \rm \fi
7961 \else
7962 % The \sf parens (in \boldbrax) actually are a little bolder than
7963 % the contained text. This is especially needed for [ and ] .
7967 \def\infirstlevel#1{%
7968 \ifampseen
7969 \ifnum\parencount=1
7974 \def\bfafterword#1 {#1 \bf}
7976 \def\opnr{%
7977 \global\advance\parencount by 1
7978 {\parenfont(}%
7979 \infirstlevel \bfafterword
7981 \def\clnr{%
7982 {\parenfont)}%
7983 \infirstlevel \sl
7984 \global\advance\parencount by -1
7987 \newcount\brackcount
7988 \def\lbrb{%
7989 \global\advance\brackcount by 1
7990 {\bf[}%
7992 \def\rbrb{%
7993 {\bf]}%
7994 \global\advance\brackcount by -1
7997 \def\checkparencounts{%
7998 \ifnum\parencount=0 \else \badparencount \fi
7999 \ifnum\brackcount=0 \else \badbrackcount \fi
8001 % these should not use \errmessage; the glibc manual, at least, actually
8002 % has such constructs (when documenting function pointers).
8003 \def\badparencount{%
8004 \message{Warning: unbalanced parentheses in @def...}%
8005 \global\parencount=0
8007 \def\badbrackcount{%
8008 \message{Warning: unbalanced square brackets in @def...}%
8009 \global\brackcount=0
8013 \message{macros,}
8014 % @macro.
8016 % To do this right we need a feature of e-TeX, \scantokens,
8017 % which we arrange to emulate with a temporary file in ordinary TeX.
8018 \ifx\eTeXversion\thisisundefined
8019 \newwrite\macscribble
8020 \def\scantokens#1{%
8021 \toks0={#1}%
8022 \immediate\openout\macscribble=\jobname.tmp
8023 \immediate\write\macscribble{\the\toks0}%
8024 \immediate\closeout\macscribble
8025 \input \jobname.tmp
8029 \let\E=\expandafter
8031 % Used at the time of macro expansion.
8032 % Argument is macro body with arguments substituted
8033 \def\scanmacro#1{%
8034 \newlinechar`\^^M
8035 % expand the expansion of \eatleadingcr twice to maybe remove a leading
8036 % newline (and \else and \fi tokens), then call \eatspaces on the result.
8037 \def\xeatspaces##1{%
8038 \E\E\E\E\E\E\E\eatspaces\E\E\E\E\E\E\E{\eatleadingcr##1%
8040 \def\xempty##1{}%
8042 % Process the macro body under the current catcode regime.
8043 \scantokens{#1@comment}%
8045 % The \comment is to remove the \newlinechar added by \scantokens, and
8046 % can be noticed by \parsearg. Note \c isn't used because this means cedilla
8047 % in math mode.
8050 % Used for copying and captions
8051 \def\scanexp#1{%
8052 \expandafter\scanmacro\expandafter{#1}%
8055 \newcount\paramno % Count of parameters
8056 \newtoks\macname % Macro name
8057 \newif\ifrecursive % Is it recursive?
8059 % List of all defined macros in the form
8060 % \commondummyword\macro1\commondummyword\macro2...
8061 % Currently is also contains all @aliases; the list can be split
8062 % if there is a need.
8063 \def\macrolist{}
8065 % Add the macro to \macrolist
8066 \def\addtomacrolist#1{\expandafter \addtomacrolistxxx \csname#1\endcsname}
8067 \def\addtomacrolistxxx#1{%
8068 \toks0 = \expandafter{\macrolist\commondummyword#1}%
8069 \xdef\macrolist{\the\toks0}%
8072 % Utility routines.
8073 % This does \let #1 = #2, with \csnames; that is,
8074 % \let \csname#1\endcsname = \csname#2\endcsname
8075 % (except of course we have to play expansion games).
8077 \def\cslet#1#2{%
8078 \expandafter\let
8079 \csname#1\expandafter\endcsname
8080 \csname#2\endcsname
8083 % Trim leading and trailing spaces off a string.
8084 % Concepts from aro-bend problem 15 (see CTAN).
8085 {\catcode`\@=11
8086 \gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }}
8087 \gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@}
8088 \gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @}
8089 \def\unbrace#1{#1}
8090 \unbrace{\gdef\trim@@@ #1 } #2@{#1}
8093 {\catcode`\^^M=\other%
8094 \gdef\eatleadingcr#1{\if\noexpand#1\noexpand^^M\else\E#1\fi}}%
8095 % Warning: this won't work for a delimited argument
8096 % or for an empty argument
8098 % Trim a single trailing ^^M off a string.
8099 {\catcode`\^^M=\other \catcode`\Q=3%
8100 \gdef\eatcr #1{\eatcra #1Q^^MQ}%
8101 \gdef\eatcra#1^^MQ{\eatcrb#1Q}%
8102 \gdef\eatcrb#1Q#2Q{#1}%
8105 % Macro bodies are absorbed as an argument in a context where
8106 % all characters are catcode 10, 11 or 12, except \ which is active
8107 % (as in normal texinfo). It is necessary to change the definition of \
8108 % to recognize macro arguments; this is the job of \mbodybackslash.
8110 % Non-ASCII encodings make 8-bit characters active, so un-activate
8111 % them to avoid their expansion. Must do this non-globally, to
8112 % confine the change to the current group.
8114 % It's necessary to have hard CRs when the macro is executed. This is
8115 % done by making ^^M (\endlinechar) catcode 12 when reading the macro
8116 % body, and then making it the \newlinechar in \scanmacro.
8118 \def\scanctxt{% used as subroutine
8119 \catcode`\"=\other
8120 \catcode`\+=\other
8121 \catcode`\<=\other
8122 \catcode`\>=\other
8123 \catcode`\^=\other
8124 \catcode`\_=\other
8125 \catcode`\|=\other
8126 \catcode`\~=\other
8127 \catcode`\@=\other
8128 \catcode`\^^M=\other
8129 \catcode`\\=\active
8130 \passthroughcharstrue
8133 \def\macrobodyctxt{% used for @macro definitions and @copying
8134 \scanctxt
8135 \catcode`\ =\other
8136 \catcode`\{=\other
8137 \catcode`\}=\other
8140 % Used when scanning braced macro arguments. Note, however, that catcode
8141 % changes here are ineffectual if the macro invocation was nested inside
8142 % an argument to another Texinfo command.
8143 \def\macroargctxt{%
8144 \scanctxt
8145 \catcode`\ =\active
8148 \def\macrolineargctxt{% used for whole-line arguments without braces
8149 \scanctxt
8150 \catcode`\{=\other
8151 \catcode`\}=\other
8154 % \mbodybackslash is the definition of \ in @macro bodies.
8155 % It maps \foo\ => \csname macarg.foo\endcsname => #N
8156 % where N is the macro parameter number.
8157 % We define \csname macarg.\endcsname to be \realbackslash, so
8158 % \\ in macro replacement text gets you a backslash.
8160 {\catcode`@=0 @catcode`@\=@active
8161 @gdef@usembodybackslash{@let\=@mbodybackslash}
8162 @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname}
8164 \expandafter\def\csname macarg.\endcsname{\realbackslash}
8166 \def\margbackslash#1{\char`\#1 }
8168 \def\macro{\recursivefalse\parsearg\macroxxx}
8169 \def\rmacro{\recursivetrue\parsearg\macroxxx}
8171 \def\macroxxx#1{%
8172 \getargs{#1}% now \macname is the macname and \argl the arglist
8173 \ifx\argl\empty % no arguments
8174 \paramno=0\relax
8175 \else
8176 \expandafter\parsemargdef \argl;%
8177 \if\paramno>256\relax
8178 \ifx\eTeXversion\thisisundefined
8179 \errhelp = \EMsimple
8180 \errmessage{You need eTeX to compile a file with macros with more than 256 arguments}
8184 \if1\csname ismacro.\the\macname\endcsname
8185 \message{Warning: redefining \the\macname}%
8186 \else
8187 \expandafter\ifx\csname \the\macname\endcsname \relax
8188 \else \errmessage{Macro name \the\macname\space already defined}\fi
8189 \global\cslet{macsave.\the\macname}{\the\macname}%
8190 \global\expandafter\let\csname ismacro.\the\macname\endcsname=1%
8191 \addtomacrolist{\the\macname}%
8193 \begingroup \macrobodyctxt \usembodybackslash
8194 \ifrecursive \expandafter\parsermacbody
8195 \else \expandafter\parsemacbody
8196 \fi}
8198 \parseargdef\unmacro{%
8199 \if1\csname ismacro.#1\endcsname
8200 \global\cslet{#1}{macsave.#1}%
8201 \global\expandafter\let \csname ismacro.#1\endcsname=0%
8202 % Remove the macro name from \macrolist:
8203 \begingroup
8204 \expandafter\let\csname#1\endcsname \relax
8205 \let\commondummyword\unmacrodo
8206 \xdef\macrolist{\macrolist}%
8207 \endgroup
8208 \else
8209 \errmessage{Macro #1 not defined}%
8213 % Called by \do from \dounmacro on each macro. The idea is to omit any
8214 % macro definitions that have been changed to \relax.
8216 \def\unmacrodo#1{%
8217 \ifx #1\relax
8218 % remove this
8219 \else
8220 \noexpand\commondummyword \noexpand#1%
8224 % \getargs -- Parse the arguments to a @macro line. Set \macname to
8225 % the name of the macro, and \argl to the braced argument list.
8226 \def\getargs#1{\getargsxxx#1{}}
8227 \def\getargsxxx#1#{\getmacname #1 \relax\getmacargs}
8228 \def\getmacname#1 #2\relax{\macname={#1}}
8229 \def\getmacargs#1{\def\argl{#1}}
8230 % This made use of the feature that if the last token of a
8231 % <parameter list> is #, then the preceding argument is delimited by
8232 % an opening brace, and that opening brace is not consumed.
8234 % Parse the optional {params} list to @macro or @rmacro.
8235 % Set \paramno to the number of arguments,
8236 % and \paramlist to a parameter text for the macro (e.g. #1,#2,#3 for a
8237 % three-param macro.) Define \macarg.BLAH for each BLAH in the params
8238 % list to some hook where the argument is to be expanded. If there are
8239 % less than 10 arguments that hook is to be replaced by ##N where N
8240 % is the position in that list, that is to say the macro arguments are to be
8241 % defined `a la TeX in the macro body.
8243 % That gets used by \mbodybackslash (above).
8245 % If there are 10 or more arguments, a different technique is used: see
8246 % \parsemmanyargdef.
8248 \def\parsemargdef#1;{%
8249 \paramno=0\def\paramlist{}%
8250 \let\hash\relax
8251 % \hash is redefined to `#' later to get it into definitions
8252 \let\xeatspaces\relax
8253 \let\xempty\relax
8254 \parsemargdefxxx#1,;,%
8255 \ifnum\paramno<10\relax\else
8256 \paramno0\relax
8257 \parsemmanyargdef@@#1,;,% 10 or more arguments
8260 \def\parsemargdefxxx#1,{%
8261 \if#1;\let\next=\relax
8262 \else \let\next=\parsemargdefxxx
8263 \advance\paramno by 1
8264 \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname
8265 {\xeatspaces{\hash\the\paramno\noexpand\xempty{}}}%
8266 \edef\paramlist{\paramlist\hash\the\paramno,}%
8267 \fi\next}
8268 % the \xempty{} is to give \eatleadingcr an argument in the case of an
8269 % empty macro argument.
8271 % \parsemacbody, \parsermacbody
8273 % Read recursive and nonrecursive macro bodies. (They're different since
8274 % rec and nonrec macros end differently.)
8276 % We are in \macrobodyctxt, and the \xdef causes backslashes in the macro
8277 % body to be transformed.
8278 % Set \macrobody to the body of the macro, and call \macrodef.
8280 {\catcode`\ =\other\long\gdef\parsemacbody#1@end macro{%
8281 \xdef\macrobody{\eatcr{#1}}\endgroup\macrodef}}%
8282 {\catcode`\ =\other\long\gdef\parsermacbody#1@end rmacro{%
8283 \xdef\macrobody{\eatcr{#1}}\endgroup\macrodef}}%
8285 % Make @ a letter, so that we can make private-to-Texinfo macro names.
8286 \edef\texiatcatcode{\the\catcode`\@}
8287 \catcode `@=11\relax
8289 %%%%%%%%%%%%%% Code for > 10 arguments only %%%%%%%%%%%%%%%%%%
8291 % If there are 10 or more arguments, a different technique is used, where the
8292 % hook remains in the body, and when macro is to be expanded the body is
8293 % processed again to replace the arguments.
8295 % In that case, the hook is \the\toks N-1, and we simply set \toks N-1 to the
8296 % argument N value and then \edef the body (nothing else will expand because of
8297 % the catcode regime under which the body was input).
8299 % If you compile with TeX (not eTeX), and you have macros with 10 or more
8300 % arguments, no macro can have more than 256 arguments (else error).
8302 % In case that there are 10 or more arguments we parse again the arguments
8303 % list to set new definitions for the \macarg.BLAH macros corresponding to
8304 % each BLAH argument. It was anyhow needed to parse already once this list
8305 % in order to count the arguments, and as macros with at most 9 arguments
8306 % are by far more frequent than macro with 10 or more arguments, defining
8307 % twice the \macarg.BLAH macros does not cost too much processing power.
8308 \def\parsemmanyargdef@@#1,{%
8309 \if#1;\let\next=\relax
8310 \else
8311 \let\next=\parsemmanyargdef@@
8312 \edef\tempb{\eatspaces{#1}}%
8313 \expandafter\def\expandafter\tempa
8314 \expandafter{\csname macarg.\tempb\endcsname}%
8315 % Note that we need some extra \noexpand\noexpand, this is because we
8316 % don't want \the to be expanded in the \parsermacbody as it uses an
8317 % \xdef .
8318 \expandafter\edef\tempa
8319 {\noexpand\noexpand\noexpand\the\toks\the\paramno}%
8320 \advance\paramno by 1\relax
8321 \fi\next}
8324 \let\endargs@\relax
8325 \let\nil@\relax
8326 \def\nilm@{\nil@}%
8327 \long\def\nillm@{\nil@}%
8329 % This macro is expanded during the Texinfo macro expansion, not during its
8330 % definition. It gets all the arguments' values and assigns them to macros
8331 % macarg.ARGNAME
8333 % #1 is the macro name
8334 % #2 is the list of argument names
8335 % #3 is the list of argument values
8336 \def\getargvals@#1#2#3{%
8337 \def\macargdeflist@{}%
8338 \def\saveparamlist@{#2}% Need to keep a copy for parameter expansion.
8339 \def\paramlist{#2,\nil@}%
8340 \def\macroname{#1}%
8341 \begingroup
8342 \macroargctxt
8343 \def\argvaluelist{#3,\nil@}%
8344 \def\@tempa{#3}%
8345 \ifx\@tempa\empty
8346 \setemptyargvalues@
8347 \else
8348 \getargvals@@
8351 \def\getargvals@@{%
8352 \ifx\paramlist\nilm@
8353 % Some sanity check needed here that \argvaluelist is also empty.
8354 \ifx\argvaluelist\nillm@
8355 \else
8356 \errhelp = \EMsimple
8357 \errmessage{Too many arguments in macro `\macroname'!}%
8359 \let\next\macargexpandinbody@
8360 \else
8361 \ifx\argvaluelist\nillm@
8362 % No more arguments values passed to macro. Set remaining named-arg
8363 % macros to empty.
8364 \let\next\setemptyargvalues@
8365 \else
8366 % pop current arg name into \@tempb
8367 \def\@tempa##1{\pop@{\@tempb}{\paramlist}##1\endargs@}%
8368 \expandafter\@tempa\expandafter{\paramlist}%
8369 % pop current argument value into \@tempc
8370 \def\@tempa##1{\longpop@{\@tempc}{\argvaluelist}##1\endargs@}%
8371 \expandafter\@tempa\expandafter{\argvaluelist}%
8372 % Here \@tempb is the current arg name and \@tempc is the current arg value.
8373 % First place the new argument macro definition into \@tempd
8374 \expandafter\macname\expandafter{\@tempc}%
8375 \expandafter\let\csname macarg.\@tempb\endcsname\relax
8376 \expandafter\def\expandafter\@tempe\expandafter{%
8377 \csname macarg.\@tempb\endcsname}%
8378 \edef\@tempd{\long\def\@tempe{\the\macname}}%
8379 \push@\@tempd\macargdeflist@
8380 \let\next\getargvals@@
8383 \next
8386 \def\push@#1#2{%
8387 \expandafter\expandafter\expandafter\def
8388 \expandafter\expandafter\expandafter#2%
8389 \expandafter\expandafter\expandafter{%
8390 \expandafter#1#2}%
8393 % Replace arguments by their values in the macro body, and place the result
8394 % in macro \@tempa.
8396 \def\macvalstoargs@{%
8397 % To do this we use the property that token registers that are \the'ed
8398 % within an \edef expand only once. So we are going to place all argument
8399 % values into respective token registers.
8401 % First we save the token context, and initialize argument numbering.
8402 \begingroup
8403 \paramno0\relax
8404 % Then, for each argument number #N, we place the corresponding argument
8405 % value into a new token list register \toks#N
8406 \expandafter\putargsintokens@\saveparamlist@,;,%
8407 % Then, we expand the body so that argument are replaced by their
8408 % values. The trick for values not to be expanded themselves is that they
8409 % are within tokens and that tokens expand only once in an \edef .
8410 \edef\@tempc{\csname mac.\macroname .body\endcsname}%
8411 % Now we restore the token stack pointer to free the token list registers
8412 % which we have used, but we make sure that expanded body is saved after
8413 % group.
8414 \expandafter
8415 \endgroup
8416 \expandafter\def\expandafter\@tempa\expandafter{\@tempc}%
8419 % Define the named-macro outside of this group and then close this group.
8421 \def\macargexpandinbody@{%
8422 \expandafter
8423 \endgroup
8424 \macargdeflist@
8425 % First the replace in body the macro arguments by their values, the result
8426 % is in \@tempa .
8427 \macvalstoargs@
8428 % Then we point at the \norecurse or \gobble (for recursive) macro value
8429 % with \@tempb .
8430 \expandafter\let\expandafter\@tempb\csname mac.\macroname .recurse\endcsname
8431 % Depending on whether it is recursive or not, we need some tailing
8432 % \egroup .
8433 \ifx\@tempb\gobble
8434 \let\@tempc\relax
8435 \else
8436 \let\@tempc\egroup
8438 % And now we do the real job:
8439 \edef\@tempd{\noexpand\@tempb{\macroname}\noexpand\scanmacro{\@tempa}\@tempc}%
8440 \@tempd
8443 \def\putargsintokens@#1,{%
8444 \if#1;\let\next\relax
8445 \else
8446 \let\next\putargsintokens@
8447 % First we allocate the new token list register, and give it a temporary
8448 % alias \@tempb .
8449 \toksdef\@tempb\the\paramno
8450 % Then we place the argument value into that token list register.
8451 \expandafter\let\expandafter\@tempa\csname macarg.#1\endcsname
8452 \expandafter\@tempb\expandafter{\@tempa}%
8453 \advance\paramno by 1\relax
8455 \next
8458 % Trailing missing arguments are set to empty.
8460 \def\setemptyargvalues@{%
8461 \ifx\paramlist\nilm@
8462 \let\next\macargexpandinbody@
8463 \else
8464 \expandafter\setemptyargvaluesparser@\paramlist\endargs@
8465 \let\next\setemptyargvalues@
8467 \next
8470 \def\setemptyargvaluesparser@#1,#2\endargs@{%
8471 \expandafter\def\expandafter\@tempa\expandafter{%
8472 \expandafter\def\csname macarg.#1\endcsname{}}%
8473 \push@\@tempa\macargdeflist@
8474 \def\paramlist{#2}%
8477 % #1 is the element target macro
8478 % #2 is the list macro
8479 % #3,#4\endargs@ is the list value
8480 \def\pop@#1#2#3,#4\endargs@{%
8481 \def#1{#3}%
8482 \def#2{#4}%
8484 \long\def\longpop@#1#2#3,#4\endargs@{%
8485 \long\def#1{#3}%
8486 \long\def#2{#4}%
8490 %%%%%%%%%%%%%% End of code for > 10 arguments %%%%%%%%%%%%%%%%%%
8493 % This defines a Texinfo @macro or @rmacro, called by \parsemacbody.
8494 % \macrobody has the body of the macro in it, with placeholders for
8495 % its parameters, looking like "\xeatspaces{\hash 1}".
8496 % \paramno is the number of parameters
8497 % \paramlist is a TeX parameter text, e.g. "#1,#2,#3,"
8498 % There are four cases: macros of zero, one, up to nine, and many arguments.
8499 % \xdef is used so that macro definitions will survive the file
8500 % they're defined in: @include reads the file inside a group.
8502 \def\macrodef{%
8503 \let\hash=##% convert placeholders to macro parameter chars
8504 \ifnum\paramno=1
8505 \long\def\xeatspaces##1{##1}%
8506 % We don't use \xeatspaces for single-argument macros, because we
8507 % want to keep ends of lines. This definition removes \xeatspaces
8508 % when \macrobody is expanded below.
8509 \else
8510 \def\xeatspaces{\string\xeatspaces}%
8511 % This expands \xeatspaces as a sequence of character tokens, which
8512 % stops \scantokens inserting an extra space after the control sequence.
8514 \ifcase\paramno
8516 \expandafter\xdef\csname\the\macname\endcsname{%
8517 \begingroup
8518 \noexpand\spaceisspace
8519 \noexpand\endlineisspace
8520 \noexpand\expandafter % skip any whitespace after the macro name.
8521 \expandafter\noexpand\csname\the\macname @@@\endcsname}%
8522 \expandafter\xdef\csname\the\macname @@@\endcsname{%
8523 \endgroup
8524 \noexpand\scanmacro{\macrobody}}%
8525 \or % 1
8526 \expandafter\xdef\csname\the\macname\endcsname{%
8527 \begingroup
8528 \noexpand\braceorline
8529 \expandafter\noexpand\csname\the\macname @@@\endcsname}%
8530 \expandafter\xdef\csname\the\macname @@@\endcsname##1{%
8531 \endgroup
8532 \noexpand\scanmacro{\macrobody}%
8534 \else % at most 9
8535 \ifnum\paramno<10\relax
8536 % @MACNAME sets the context for reading the macro argument
8537 % @MACNAME@@ gets the argument, processes backslashes and appends a
8538 % comma.
8539 % @MACNAME@@@ removes braces surrounding the argument list.
8540 % @MACNAME@@@@ scans the macro body with arguments substituted.
8541 \expandafter\xdef\csname\the\macname\endcsname{%
8542 \begingroup
8543 \noexpand\expandafter % This \expandafter skip any spaces after the
8544 \noexpand\macroargctxt % macro before we change the catcode of space.
8545 \noexpand\expandafter
8546 \expandafter\noexpand\csname\the\macname @@\endcsname}%
8547 \expandafter\xdef\csname\the\macname @@\endcsname##1{%
8548 \noexpand\passargtomacro
8549 \expandafter\noexpand\csname\the\macname @@@\endcsname{##1,}}%
8550 \expandafter\xdef\csname\the\macname @@@\endcsname##1{%
8551 \expandafter\noexpand\csname\the\macname @@@@\endcsname ##1}%
8552 \expandafter\expandafter
8553 \expandafter\xdef
8554 \expandafter\expandafter
8555 \csname\the\macname @@@@\endcsname\paramlist{%
8556 \endgroup\noexpand\scanmacro{\macrobody}}%
8557 \else % 10 or more:
8558 \expandafter\xdef\csname\the\macname\endcsname{%
8559 \noexpand\getargvals@{\the\macname}{\argl}%
8561 \global\expandafter\let\csname mac.\the\macname .body\endcsname\macrobody
8562 \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\gobble
8564 \fi}
8566 \catcode `\@\texiatcatcode\relax % end private-to-Texinfo catcodes
8568 \def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}}
8571 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8573 {\catcode`\@=0 \catcode`\\=13 % We need to manipulate \ so use @ as escape
8574 @catcode`@_=11 % private names
8575 @catcode`@!=11 % used as argument separator
8577 % \passargtomacro#1#2 -
8578 % Call #1 with a list of tokens #2, with any doubled backslashes in #2
8579 % compressed to one.
8581 % This implementation works by expansion, and not execution (so we cannot use
8582 % \def or similar). This reduces the risk of this failing in contexts where
8583 % complete expansion is done with no execution (for example, in writing out to
8584 % an auxiliary file for an index entry).
8586 % State is kept in the input stream: the argument passed to
8587 % @look_ahead, @gobble_and_check_finish and @add_segment is
8589 % THE_MACRO ARG_RESULT ! {PENDING_BS} NEXT_TOKEN (... rest of input)
8591 % where:
8592 % THE_MACRO - name of the macro we want to call
8593 % ARG_RESULT - argument list we build to pass to that macro
8594 % PENDING_BS - either a backslash or nothing
8595 % NEXT_TOKEN - used to look ahead in the input stream to see what's coming next
8597 @gdef@passargtomacro#1#2{%
8598 @add_segment #1!{}@relax#2\@_finish\%
8600 @gdef@_finish{@_finishx} @global@let@_finishx@relax
8602 % #1 - THE_MACRO ARG_RESULT
8603 % #2 - PENDING_BS
8604 % #3 - NEXT_TOKEN
8605 % #4 used to look ahead
8607 % If the next token is not a backslash, process the rest of the argument;
8608 % otherwise, remove the next token.
8609 @gdef@look_ahead#1!#2#3#4{%
8610 @ifx#4\%
8611 @expandafter@gobble_and_check_finish
8612 @else
8613 @expandafter@add_segment
8614 @fi#1!{#2}#4#4%
8617 % #1 - THE_MACRO ARG_RESULT
8618 % #2 - PENDING_BS
8619 % #3 - NEXT_TOKEN
8620 % #4 should be a backslash, which is gobbled.
8621 % #5 looks ahead
8623 % Double backslash found. Add a single backslash, and look ahead.
8624 @gdef@gobble_and_check_finish#1!#2#3#4#5{%
8625 @add_segment#1\!{}#5#5%
8628 @gdef@is_fi{@fi}
8630 % #1 - THE_MACRO ARG_RESULT
8631 % #2 - PENDING_BS
8632 % #3 - NEXT_TOKEN
8633 % #4 is input stream until next backslash
8635 % Input stream is either at the start of the argument, or just after a
8636 % backslash sequence, either a lone backslash, or a doubled backslash.
8637 % NEXT_TOKEN contains the first token in the input stream: if it is \finish,
8638 % finish; otherwise, append to ARG_RESULT the segment of the argument up until
8639 % the next backslash. PENDING_BACKSLASH contains a backslash to represent
8640 % a backslash just before the start of the input stream that has not been
8641 % added to ARG_RESULT.
8642 @gdef@add_segment#1!#2#3#4\{%
8643 @ifx#3@_finish
8644 @call_the_macro#1!%
8645 @else
8646 % append the pending backslash to the result, followed by the next segment
8647 @expandafter@is_fi@look_ahead#1#2#4!{\}@fi
8648 % this @fi is discarded by @look_ahead.
8649 % we can't get rid of it with \expandafter because we don't know how
8650 % long #4 is.
8653 % #1 - THE_MACRO
8654 % #2 - ARG_RESULT
8655 % #3 discards the res of the conditional in @add_segment, and @is_fi ends the
8656 % conditional.
8657 @gdef@call_the_macro#1#2!#3@fi{@is_fi #1{#2}}
8660 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8662 % \braceorline MAC is used for a one-argument macro MAC. It checks
8663 % whether the next non-whitespace character is a {. It sets the context
8664 % for reading the argument (slightly different in the two cases). Then,
8665 % to read the argument, in the whole-line case, it then calls the regular
8666 % \parsearg MAC; in the lbrace case, it calls \passargtomacro MAC.
8668 \def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx}
8669 \def\braceorlinexxx{%
8670 \ifx\nchar\bgroup
8671 \macroargctxt
8672 \expandafter\passargtomacro
8673 \else
8674 \macrolineargctxt\expandafter\parsearg
8675 \fi \macnamexxx}
8678 % @linemacro
8680 \parseargdef\linemacro{%
8681 \getargs{#1}% now \macname is the macname and \argl the arglist
8682 \ifx\argl\empty
8683 \paramno=0
8684 \let\hash\relax
8685 \def\paramlist{\hash 1\endlinemacro}%
8686 \else
8687 \expandafter\linegetparamlist\argl;%
8689 \begingroup \macrobodyctxt \usembodybackslash
8690 \parselinemacrobody
8693 % Build up \paramlist which will be used as the parameter text for the macro.
8694 % At the end it will be like "#1 #2 #3\endlinemacro".
8695 \def\linegetparamlist#1;{%
8696 \paramno=0\def\paramlist{}%
8697 \let\hash\relax
8698 \linegetparamlistxxx#1,;,%
8700 \def\linegetparamlistxxx#1,{%
8701 \if#1;\let\next=\linegetparamlistxxxx
8702 \else \let\next=\linegetparamlistxxx
8703 \advance\paramno by 1
8704 \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname
8705 {\hash\the\paramno}%
8706 \edef\paramlist{\paramlist\hash\the\paramno\space}%
8707 \fi\next}
8708 \def\linegetparamlistxxxx{%
8709 \expandafter\fixparamlist\paramlist\fixparamlist
8711 % Replace final space token
8712 \def\fixparamlist#1 \fixparamlist{%
8713 \def\paramlist{#1\endlinemacro}%
8716 % Read the body of the macro, replacing backslash-surrounded variables
8718 {\catcode`\ =\other\long\gdef\parselinemacrobody#1@end linemacro{%
8719 \xdef\macrobody{#1}%
8720 \endgroup
8721 \linemacrodef
8724 % Make the definition
8725 \def\linemacrodef{%
8726 \let\hash=##%
8727 \expandafter\xdef\csname\the\macname\endcsname{%
8728 \bgroup
8729 \noexpand\parsearg
8730 \expandafter\noexpand\csname\the\macname @@\endcsname
8732 \expandafter\xdef\csname\the\macname @@\endcsname##1{%
8733 \egroup
8734 \expandafter\noexpand
8735 \csname\the\macname @@@\endcsname##1\noexpand\endlinemacro
8737 \expandafter\expandafter
8738 \expandafter\xdef
8739 \expandafter\expandafter\csname\the\macname @@@\endcsname\paramlist{%
8740 \newlinechar=13 % split \macrobody into lines
8741 \noexpand\scantokens{\macrobody}%
8747 % @alias.
8748 % We need some trickery to remove the optional spaces around the equal
8749 % sign. Make them active and then expand them all to nothing.
8751 \def\alias{\parseargusing\obeyspaces\aliasxxx}
8752 \def\aliasxxx #1{\aliasyyy#1\relax}
8753 \def\aliasyyy #1=#2\relax{%
8755 \expandafter\let\obeyedspace=\empty
8756 \addtomacrolist{#1}%
8757 \xdef\next{\global\let\makecsname{#1}=\makecsname{#2}}%
8759 \next
8763 \message{cross references,}
8765 \newwrite\auxfile
8766 \newif\ifhavexrefs % True if xref values are known.
8767 \newif\ifwarnedxrefs % True if we warned once that they aren't known.
8769 % @inforef is relatively simple.
8770 \def\inforef #1{\inforefzzz #1,,,,**}
8771 \def\inforefzzz #1,#2,#3,#4**{%
8772 \putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
8773 node \samp{\ignorespaces#1{}}}
8775 % @node's only job in TeX is to define \lastnode, which is used in
8776 % cross-references. The @node line might or might not have commas, and
8777 % might or might not have spaces before the first comma, like:
8778 % @node foo , bar , ...
8779 % We don't want such trailing spaces in the node name.
8781 \parseargdef\node{\checkenv{}\donode #1 ,\finishnodeparse}
8783 % also remove a trailing comma, in case of something like this:
8784 % @node Help-Cross, , , Cross-refs
8785 \def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse}
8786 \def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}\omittopnode}
8788 % Used so that the @top node doesn't have to be wrapped in an @ifnottex
8789 % conditional.
8790 % \doignore goes to more effort to skip nested conditionals but we don't need
8791 % that here.
8792 \def\omittopnode{%
8793 \ifx\lastnode\wordTop
8794 \expandafter\ignorenode\fi
8796 \def\wordTop{Top}
8798 % Until the next @node, @part or @bye command, divert output to a box that
8799 % is not output.
8800 \def\ignorenode{\setbox\dummybox\vbox\bgroup
8801 \def\part{\egroup\part}%
8802 \def\node{\egroup\node}%
8803 \ignorenodebye
8806 {\let\bye\relax
8807 \gdef\ignorenodebye{\let\bye\ignorenodebyedef}
8808 \gdef\ignorenodebyedef{\egroup(`Top' node ignored)\bye}}
8809 % The redefinition of \bye here is because it is declared \outer
8811 \let\lastnode=\empty
8813 % Write a cross-reference definition for the current node. #1 is the
8814 % type (Ynumbered, Yappendix, Ynothing).
8816 \def\donoderef#1{%
8817 \ifx\lastnode\empty\else
8818 \setref{\lastnode}{#1}%
8819 \global\let\lastnode=\empty
8823 % @nodedescription, @nodedescriptionblock - do nothing for TeX
8824 \parseargdef\nodedescription{}
8825 \def\nodedescriptionblock{\doignore{nodedescriptionblock}}
8828 % @anchor{NAME} -- define xref target at arbitrary point.
8830 \newcount\savesfregister
8832 \def\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi}
8833 \def\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi}
8834 \def\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces}
8836 % \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an
8837 % anchor), which consists of three parts:
8838 % 1) NAME-title - the current sectioning name taken from \currentsection,
8839 % or the anchor name.
8840 % 2) NAME-snt - section number and type, passed as the SNT arg, or
8841 % empty for anchors.
8842 % 3) NAME-pg - the page number.
8844 % This is called from \donoderef, \anchor, and \dofloat. In the case of
8845 % floats, there is an additional part, which is not written here:
8846 % 4) NAME-lof - the text as it should appear in a @listoffloats.
8848 \def\setref#1#2{%
8849 \pdfmkdest{#1}%
8850 \iflinks
8852 \requireauxfile
8853 \atdummies % preserve commands, but don't expand them
8854 % match definition in \xrdef, \refx, \xrefX.
8855 \def\value##1{##1}%
8856 \edef\writexrdef##1##2{%
8857 \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef
8858 ##1}{##2}}% these are parameters of \writexrdef
8860 \toks0 = \expandafter{\currentsection}%
8861 \immediate \writexrdef{title}{\the\toks0 }%
8862 \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc.
8863 \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, at \shipout
8868 % @xrefautosectiontitle on|off says whether @section(ing) names are used
8869 % automatically in xrefs, if the third arg is not explicitly specified.
8870 % This was provided as a "secret" @set xref-automatic-section-title
8871 % variable, now it's official.
8873 \parseargdef\xrefautomaticsectiontitle{%
8874 \def\temp{#1}%
8875 \ifx\temp\onword
8876 \expandafter\let\csname SETxref-automatic-section-title\endcsname
8877 = \empty
8878 \else\ifx\temp\offword
8879 \expandafter\let\csname SETxref-automatic-section-title\endcsname
8880 = \relax
8881 \else
8882 \errhelp = \EMsimple
8883 \errmessage{Unknown @xrefautomaticsectiontitle value `\temp',
8884 must be on|off}%
8885 \fi\fi
8889 % @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is
8890 % the node name, #2 the name of the Info cross-reference, #3 the printed
8891 % node name, #4 the name of the Info file, #5 the name of the printed
8892 % manual. All but the node name can be omitted.
8894 \def\pxref{\putwordsee{} \xrefXX}
8895 \def\xref{\putwordSee{} \xrefXX}
8896 \def\ref{\xrefXX}
8898 \def\xrefXX#1{\def\xrefXXarg{#1}\futurelet\tokenafterxref\xrefXXX}
8899 \def\xrefXXX{\expandafter\xrefX\expandafter[\xrefXXarg,,,,,,,]}
8901 \newbox\toprefbox
8902 \newbox\printedrefnamebox
8903 \newbox\infofilenamebox
8904 \newbox\printedmanualbox
8906 \def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
8907 \unsepspaces
8909 \getprintedrefname{#1}{#3}{#5}%
8910 \def\infofilename{\ignorespaces #4}%
8911 \setbox\infofilenamebox = \hbox{\infofilename\unskip}%
8913 \startxreflink{#1}{#4}%
8915 % Have to otherify everything special to allow the \csname to
8916 % include an _ in the xref name, etc.
8917 \indexnofonts
8918 \turnoffactive
8919 \def\value##1{##1}%
8920 \expandafter\global\expandafter\let\expandafter\Xthisreftitle
8921 \csname XR#1-title\endcsname
8924 % Float references are printed completely differently: "Figure 1.2"
8925 % instead of "[somenode], p.3". \iffloat distinguishes them by
8926 % \Xthisreftitle being set to a magic string.
8927 \iffloat\Xthisreftitle
8928 % If the user specified the print name (third arg) to the ref,
8929 % print it instead of our usual "Figure 1.2".
8930 \ifdim\wd\printedrefnamebox = 0pt
8931 \refx{#1-snt}%
8932 \else
8933 \printedrefname
8936 % If the user also gave the printed manual name (fifth arg), append
8937 % "in MANUALNAME".
8938 \ifdim \wd\printedmanualbox > 0pt
8939 \space \putwordin{} \cite{\printedmanual}%
8941 \else
8942 % node/anchor (non-float) references.
8944 % If we use \unhbox to print the node names, TeX does not insert
8945 % empty discretionaries after hyphens, which means that it will not
8946 % find a line break at a hyphen in a node names. Since some manuals
8947 % are best written with fairly long node names, containing hyphens,
8948 % this is a loss. Therefore, we give the text of the node name
8949 % again, so it is as if TeX is seeing it for the first time.
8951 \ifdim \wd\printedmanualbox > 0pt
8952 % Cross-manual reference with a printed manual name.
8954 \crossmanualxref{\cite{\printedmanual\unskip}}%
8956 \else\ifdim \wd\infofilenamebox > 0pt
8957 % Cross-manual reference with only an info filename (arg 4), no
8958 % printed manual name (arg 5). This is essentially the same as
8959 % the case above; we output the filename, since we have nothing else.
8961 \crossmanualxref{\code{\infofilename\unskip}}%
8963 \else
8964 % Reference within this manual.
8966 % Only output a following space if the -snt ref is nonempty, as the ref
8967 % will be empty for @unnumbered and @anchor.
8968 \setbox2 = \hbox{\ignorespaces \refx{#1-snt}}%
8969 \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
8971 % output the `[mynode]' via the macro below so it can be overridden.
8972 \xrefprintnodename\printedrefname
8974 \ifflagclear{txiomitxrefpg}{%
8975 % We always want a comma
8977 % output the `page 3'.
8978 \turnoffactive \putpageref{#1}%
8979 % Add a , if xref followed by a space
8980 \if\space\noexpand\tokenafterxref ,%
8981 \else\ifx\ \tokenafterxref ,% @TAB
8982 \else\ifx\*\tokenafterxref ,% @*
8983 \else\ifx\ \tokenafterxref ,% @SPACE
8984 \else\ifx\
8985 \tokenafterxref ,% @NL
8986 \else\ifx\tie\tokenafterxref ,% @tie
8987 \fi\fi\fi\fi\fi\fi
8988 }{}%
8989 \fi\fi
8991 \endlink
8992 \endgroup}
8994 % \getprintedrefname{NODE}{LABEL}{MANUAL}
8995 % - set \printedrefname and \printedmanual
8997 \def\getprintedrefname#1#2#3{%
8998 % Get args without leading/trailing spaces.
8999 \def\printedrefname{\ignorespaces #2}%
9000 \setbox\printedrefnamebox = \hbox{\printedrefname\unskip}%
9002 \def\printedmanual{\ignorespaces #3}%
9003 \setbox\printedmanualbox = \hbox{\printedmanual\unskip}%
9005 % If the printed reference name (arg #2) was not explicitly given in
9006 % the @xref, figure out what we want to use.
9007 \ifdim \wd\printedrefnamebox = 0pt
9008 % No printed node name was explicitly given.
9009 \expandafter\ifx\csname SETxref-automatic-section-title\endcsname \relax
9010 % Not auto section-title: use node name inside the square brackets.
9011 \def\printedrefname{\ignorespaces #1}%
9012 \else
9013 % Auto section-title: use chapter/section title inside
9014 % the square brackets if we have it.
9015 \ifdim \wd\printedmanualbox > 0pt
9016 % It is in another manual, so we don't have it; use node name.
9017 \def\printedrefname{\ignorespaces #1}%
9018 \else
9019 \ifhavexrefs
9020 % We (should) know the real title if we have the xref values.
9021 \def\printedrefname{\refx{#1-title}}%
9022 \else
9023 % Otherwise just copy the Info node name.
9024 \def\printedrefname{\ignorespaces #1}%
9025 \fi%
9031 % \startxreflink{NODE}{FILE} - start link in pdf output.
9032 \def\startxreflink#1#2{%
9033 \ifpdforxetex
9034 % For pdfTeX and LuaTeX
9035 {\indexnofonts
9036 \makevalueexpandable
9037 \turnoffactive
9038 % This expands tokens, so do it after making catcode changes, so _
9039 % etc. don't get their TeX definitions. This ignores all spaces in
9040 % #2, including (wrongly) those in the middle of the filename.
9041 \getfilename{#2}%
9043 % This (wrongly) does not take account of leading or trailing
9044 % spaces in #1, which should be ignored.
9045 \setpdfdestname{#1}%
9047 \ifx\pdfdestname\empty
9048 \def\pdfdestname{Top}% no empty targets
9051 \leavevmode
9052 \ifpdf
9053 \startlink attr{/Border [0 0 0]}%
9054 \ifnum\filenamelength>0
9055 goto file{\the\filename.pdf} name{\pdfdestname}%
9056 \else
9057 goto name{\pdfmkpgn{\pdfdestname}}%
9059 \else % XeTeX
9060 \ifnum\filenamelength>0
9061 % With default settings,
9062 % XeTeX (xdvipdfmx) replaces link destination names with integers.
9063 % In this case, the replaced destination names of
9064 % remote PDFs are no longer known. In order to avoid a replacement,
9065 % you can use xdvipdfmx's command line option `-C 0x0010'.
9066 % If you use XeTeX 0.99996+ (TeX Live 2016+),
9067 % this command line option is no longer necessary
9068 % because we can use the `dvipdfmx:config' special.
9069 \special{pdf:bann << /Border [0 0 0] /Type /Annot /Subtype /Link /A
9070 << /S /GoToR /F (\the\filename.pdf) /D (\pdfdestname) >> >>}%
9071 \else
9072 \special{pdf:bann << /Border [0 0 0] /Type /Annot /Subtype /Link /A
9073 << /S /GoTo /D (\pdfdestname) >> >>}%
9077 \setcolor{\linkcolor}%
9081 % can be overridden in translation files
9082 \def\putpageref#1{%
9083 \space\putwordpage\tie\refx{#1-pg}}
9085 % Output a cross-manual xref to #1. Used just above (twice).
9087 % Only include the text "Section ``foo'' in" if the foo is neither
9088 % missing or Top. Thus, @xref{,,,foo,The Foo Manual} outputs simply
9089 % "see The Foo Manual", the idea being to refer to the whole manual.
9091 % But, this being TeX, we can't easily compare our node name against the
9092 % string "Top" while ignoring the possible spaces before and after in
9093 % the input. By adding the arbitrary 7sp below, we make it much less
9094 % likely that a real node name would have the same width as "Top" (e.g.,
9095 % in a monospaced font). Hopefully it will never happen in practice.
9097 % For the same basic reason, we retypeset the "Top" at every
9098 % reference, since the current font is indeterminate.
9100 \def\crossmanualxref#1{%
9101 \setbox\toprefbox = \hbox{Top\kern7sp}%
9102 \setbox2 = \hbox{\ignorespaces \printedrefname \unskip \kern7sp}%
9103 \ifdim \wd2 > 7sp % nonempty?
9104 \ifdim \wd2 = \wd\toprefbox \else % same as Top?
9105 \putwordSection{} ``\printedrefname'' \putwordin{}\space
9111 % This macro is called from \xrefX for the `[nodename]' part of xref
9112 % output. It's a separate macro only so it can be changed more easily,
9113 % since square brackets don't work well in some documents. Particularly
9114 % one that Bob is working on :).
9116 \def\xrefprintnodename#1{[#1]}
9118 % @link{NODENAME, LABEL, MANUAL} - create a "plain" link, with no
9119 % page number. Not useful if printed on paper.
9121 \def\link#1{\linkX[#1,,,]}
9122 \def\linkX[#1,#2,#3,#4]{%
9123 \begingroup
9124 \unsepspaces
9125 \getprintedrefname{#1}{#2}{#3}%
9126 \startxreflink{#1}{#3}%
9127 \printedrefname
9128 \endlink
9129 \endgroup
9133 % Things referred to by \setref.
9135 \def\Ynothing{}
9136 \def\Yomitfromtoc{}
9137 \def\Ynumbered{%
9138 \ifnum\secno=0
9139 \putwordChapter@tie \the\chapno
9140 \else \ifnum\subsecno=0
9141 \putwordSection@tie \the\chapno.\the\secno
9142 \else \ifnum\subsubsecno=0
9143 \putwordSection@tie \the\chapno.\the\secno.\the\subsecno
9144 \else
9145 \putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno
9146 \fi\fi\fi
9148 \def\Yappendix{%
9149 \ifnum\secno=0
9150 \putwordAppendix@tie @char\the\appendixno{}%
9151 \else \ifnum\subsecno=0
9152 \putwordSection@tie @char\the\appendixno.\the\secno
9153 \else \ifnum\subsubsecno=0
9154 \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno
9155 \else
9156 \putwordSection@tie
9157 @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno
9158 \fi\fi\fi
9161 % \refx{NAME} - reference a cross-reference string named NAME.
9162 \def\refx#1{%
9163 \requireauxfile
9165 \indexnofonts
9166 \turnoffactive
9167 \def\value##1{##1}%
9168 \expandafter\global\expandafter\let\expandafter\thisrefX
9169 \csname XR#1\endcsname
9171 \ifx\thisrefX\relax
9172 % If not defined, say something at least.
9173 \angleleft un\-de\-fined\angleright
9174 \iflinks
9175 \ifhavexrefs
9176 {\toks0 = {#1}% avoid expansion of possibly-complex value
9177 \message{\linenumber Undefined cross reference `\the\toks0'.}}%
9178 \else
9179 \ifwarnedxrefs\else
9180 \global\warnedxrefstrue
9181 \message{Cross reference values unknown; you must run TeX again.}%
9185 \else
9186 % It's defined, so just use it.
9187 \thisrefX
9191 % This is the macro invoked by entries in the aux file. Define a control
9192 % sequence for a cross-reference target (we prepend XR to the control sequence
9193 % name to avoid collisions). The value is the page number. If this is a float
9194 % type, we have more work to do.
9196 \def\xrdef#1#2{%
9197 {% Expand the node or anchor name to remove control sequences.
9198 % \turnoffactive stops 8-bit characters being changed to commands
9199 % like @'e. \refx does the same to retrieve the value in the definition.
9200 \indexnofonts
9201 \turnoffactive
9202 \def\value##1{##1}%
9203 \xdef\safexrefname{#1}%
9206 \bgroup
9207 \expandafter\gdef\csname XR\safexrefname\endcsname{#2}%
9208 \egroup
9209 % We put the \gdef inside a group to avoid the definitions building up on
9210 % TeX's save stack, which can cause it to run out of space for aux files with
9211 % thousands of lines. \gdef doesn't use the save stack, but \csname does
9212 % when it defines an unknown control sequence as \relax.
9214 % Was that xref control sequence that we just defined for a float?
9215 \expandafter\iffloat\csname XR\safexrefname\endcsname
9216 % it was a float, and we have the (safe) float type in \iffloattype.
9217 \expandafter\let\expandafter\floatlist
9218 \csname floatlist\iffloattype\endcsname
9220 % Is this the first time we've seen this float type?
9221 \expandafter\ifx\floatlist\relax
9222 \toks0 = {\do}% yes, so just \do
9223 \else
9224 % had it before, so preserve previous elements in list.
9225 \toks0 = \expandafter{\floatlist\do}%
9228 % Remember this xref in the control sequence \floatlistFLOATTYPE,
9229 % for later use in \listoffloats.
9230 \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0
9231 {\safexrefname}}%
9235 % If working on a large document in chapters, it is convenient to
9236 % be able to disable indexing, cross-referencing, and contents, for test runs.
9237 % This is done with @novalidate at the beginning of the file.
9239 \newif\iflinks \linkstrue % by default we want the aux files.
9240 \let\novalidate = \linksfalse
9242 % Used when writing to the aux file, or when using data from it.
9243 \def\requireauxfile{%
9244 \iflinks
9245 \tryauxfile
9246 % Open the new aux file. TeX will close it automatically at exit.
9247 \immediate\openout\auxfile=\jobname.aux
9249 \global\let\requireauxfile=\relax % Only do this once.
9252 % Read the last existing aux file, if any. No error if none exists.
9254 \def\tryauxfile{%
9255 \openin 1 \jobname.aux
9256 \ifeof 1 \else
9257 \readdatafile{aux}%
9258 \global\havexrefstrue
9260 \closein 1
9263 \def\setupdatafile{%
9264 \catcode`\^^@=\other
9265 \catcode`\^^A=\other
9266 \catcode`\^^B=\other
9267 \catcode`\^^C=\other
9268 \catcode`\^^D=\other
9269 \catcode`\^^E=\other
9270 \catcode`\^^F=\other
9271 \catcode`\^^G=\other
9272 \catcode`\^^H=\other
9273 \catcode`\^^K=\other
9274 \catcode`\^^L=\other
9275 \catcode`\^^N=\other
9276 \catcode`\^^P=\other
9277 \catcode`\^^Q=\other
9278 \catcode`\^^R=\other
9279 \catcode`\^^S=\other
9280 \catcode`\^^T=\other
9281 \catcode`\^^U=\other
9282 \catcode`\^^V=\other
9283 \catcode`\^^W=\other
9284 \catcode`\^^X=\other
9285 \catcode`\^^Z=\other
9286 \catcode`\^^[=\other
9287 \catcode`\^^\=\other
9288 \catcode`\^^]=\other
9289 \catcode`\^^^=\other
9290 \catcode`\^^_=\other
9291 \catcode`\^=\other
9293 % Special characters. Should be turned off anyway, but...
9294 \catcode`\~=\other
9295 \catcode`\[=\other
9296 \catcode`\]=\other
9297 \catcode`\"=\other
9298 \catcode`\_=\active
9299 \catcode`\|=\active
9300 \catcode`\<=\active
9301 \catcode`\>=\active
9302 \catcode`\$=\other
9303 \catcode`\#=\other
9304 \catcode`\&=\other
9305 \catcode`\%=\other
9306 \catcode`+=\other % avoid \+ for paranoia even though we've turned it off
9308 \catcode`\\=\active
9310 % @ is our escape character in .aux files, and we need braces.
9311 \catcode`\{=1
9312 \catcode`\}=2
9313 \catcode`\@=0
9316 \def\readdatafile#1{%
9317 \begingroup
9318 \setupdatafile
9319 \input\jobname.#1
9320 \endgroup}
9323 \message{insertions,}
9324 % including footnotes.
9326 \newcount \footnoteno
9328 % The trailing space in the following definition for supereject is
9329 % vital for proper filling; pages come out unaligned when you do a
9330 % pagealignmacro call if that space before the closing brace is
9331 % removed. (Generally, numeric constants should always be followed by a
9332 % space to prevent strange expansion errors.)
9333 \def\supereject{\par\penalty -20000\footnoteno =0 }
9335 % @footnotestyle is meaningful for Info output only.
9336 \let\footnotestyle=\comment
9338 {\catcode `\@=11
9340 % Auto-number footnotes. Otherwise like plain.
9341 \gdef\footnote{%
9342 \global\advance\footnoteno by \@ne
9343 \edef\thisfootno{$^{\the\footnoteno}$}%
9345 % In case the footnote comes at the end of a sentence, preserve the
9346 % extra spacing after we do the footnote number.
9347 \let\@sf\empty
9348 \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi
9350 % Remove inadvertent blank space before typesetting the footnote number.
9351 \unskip
9352 \thisfootno\@sf
9353 \dofootnote
9356 % Don't bother with the trickery in plain.tex to not require the
9357 % footnote text as a parameter. Our footnotes don't need to be so general.
9359 % Oh yes, they do; otherwise, @ifset (and anything else that uses
9360 % \parseargline) fails inside footnotes because the tokens are fixed when
9361 % the footnote is read. --karl, 16nov96.
9363 \gdef\dofootnote{%
9364 \insert\footins\bgroup
9366 % Nested footnotes are not supported in TeX, that would take a lot
9367 % more work. (\startsavinginserts does not suffice.)
9368 \let\footnote=\errfootnotenest
9370 % We want to typeset this text as a normal paragraph, even if the
9371 % footnote reference occurs in (for example) a display environment.
9372 % So reset some parameters.
9373 \hsize=\txipagewidth
9374 \interlinepenalty\interfootnotelinepenalty
9375 \splittopskip\ht\strutbox % top baseline for broken footnotes
9376 \splitmaxdepth\dp\strutbox
9377 \floatingpenalty\@MM
9378 \leftskip\z@skip
9379 \rightskip\z@skip
9380 \spaceskip\z@skip
9381 \xspaceskip\z@skip
9382 \parindent\defaultparindent
9384 \smallfonts \rm
9386 % Because we use hanging indentation in footnotes, a @noindent appears
9387 % to exdent this text, so make it be a no-op. makeinfo does not use
9388 % hanging indentation so @noindent can still be needed within footnote
9389 % text after an @example or the like (not that this is good style).
9390 \let\noindent = \relax
9392 % Hang the footnote text off the number. Use \everypar in case the
9393 % footnote extends for more than one paragraph.
9394 \everypar = {\hang}%
9395 \textindent{\thisfootno}%
9397 % Don't crash into the line above the footnote text. Since this
9398 % expands into a box, it must come within the paragraph, lest it
9399 % provide a place where TeX can split the footnote.
9400 \footstrut
9402 % Invoke rest of plain TeX footnote routine.
9403 \futurelet\next\fo@t
9405 }%end \catcode `\@=11
9407 \def\errfootnotenest{%
9408 \errhelp=\EMsimple
9409 \errmessage{Nested footnotes not supported in texinfo.tex,
9410 even though they work in makeinfo; sorry}
9413 \def\errfootnoteheading{%
9414 \errhelp=\EMsimple
9415 \errmessage{Footnotes in chapters, sections, etc., are not supported}
9418 % In case a @footnote appears in a vbox, save the footnote text and create
9419 % the real \insert just after the vbox finished. Otherwise, the insertion
9420 % would be lost.
9421 % Similarly, if a @footnote appears inside an alignment, save the footnote
9422 % text to a box and make the \insert when a row of the table is finished.
9423 % And the same can be done for other insert classes. --kasal, 16nov03.
9425 % Replace the \insert primitive by a cheating macro.
9426 % Deeper inside, just make sure that the saved insertions are not spilled
9427 % out prematurely.
9429 \def\startsavinginserts{%
9430 \ifx \insert\ptexinsert
9431 \let\insert\saveinsert
9432 \else
9433 \let\checkinserts\relax
9437 % This \insert replacement works for both \insert\footins{foo} and
9438 % \insert\footins\bgroup foo\egroup, but it doesn't work for \insert27{foo}.
9440 \def\saveinsert#1{%
9441 \edef\next{\noexpand\savetobox \makeSAVEname#1}%
9442 \afterassignment\next
9443 % swallow the left brace
9444 \let\temp =
9446 \def\makeSAVEname#1{\makecsname{SAVE\expandafter\gobble\string#1}}
9447 \def\savetobox#1{\global\setbox#1 = \vbox\bgroup \unvbox#1}
9449 \def\checksaveins#1{\ifvoid#1\else \placesaveins#1\fi}
9451 \def\placesaveins#1{%
9452 \ptexinsert \csname\expandafter\gobblesave\string#1\endcsname
9453 {\box#1}%
9456 % eat @SAVE -- beware, all of them have catcode \other:
9458 \def\dospecials{\do S\do A\do V\do E} \uncatcodespecials % ;-)
9459 \gdef\gobblesave @SAVE{}
9462 % initialization:
9463 \def\newsaveins #1{%
9464 \edef\next{\noexpand\newsaveinsX \makeSAVEname#1}%
9465 \next
9467 \def\newsaveinsX #1{%
9468 \csname newbox\endcsname #1%
9469 \expandafter\def\expandafter\checkinserts\expandafter{\checkinserts
9470 \checksaveins #1}%
9473 % initialize:
9474 \let\checkinserts\empty
9475 \newsaveins\footins
9476 \newsaveins\margin
9479 % @image. We use the macros from epsf.tex to support this.
9480 % If epsf.tex is not installed and @image is used, we complain.
9482 % Check for and read epsf.tex up front. If we read it only at @image
9483 % time, we might be inside a group, and then its definitions would get
9484 % undone and the next image would fail.
9485 \openin 1 = epsf.tex
9486 \ifeof 1 \else
9487 % Do not bother showing banner with epsf.tex v2.7k (available in
9488 % doc/epsf.tex and on ctan).
9489 \def\epsfannounce{\toks0 = }%
9490 \input epsf.tex
9492 \closein 1
9494 % We will only complain once about lack of epsf.tex.
9495 \newif\ifwarnednoepsf
9496 \newhelp\noepsfhelp{epsf.tex must be installed for images to
9497 work. It is also included in the Texinfo distribution, or you can get
9498 it from https://ctan.org/texarchive/macros/texinfo/texinfo/doc/epsf.tex.}
9500 \def\image#1{%
9501 \ifx\epsfbox\thisisundefined
9502 \ifwarnednoepsf \else
9503 \errhelp = \noepsfhelp
9504 \errmessage{epsf.tex not found, images will be ignored}%
9505 \global\warnednoepsftrue
9507 \else
9508 \imagexxx #1,,,,,\finish
9512 % Approximate height of a line in the standard text font.
9513 \newdimen\capheight
9514 \setbox0=\vbox{\tenrm H}
9515 \capheight=\ht0
9518 % Arguments to @image:
9519 % #1 is (mandatory) image filename; we tack on .eps extension.
9520 % #2 is (optional) width, #3 is (optional) height.
9521 % #4 is (ignored optional) html alt text.
9522 % #5 is (ignored optional) extension.
9523 % #6 is just the usual extra ignored arg for parsing stuff.
9524 \newif\ifimagevmode
9525 \def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup
9526 \catcode`\^^M = 5 % in case we're inside an example
9527 \normalturnoffactive % allow _ et al. in names
9528 \makevalueexpandable
9529 \ifvmode
9530 \imagevmodetrue
9531 \medskip
9532 % Usually we'll have text after the image which will insert
9533 % \parskip glue, so insert it here too to equalize the space
9534 % above and below.
9535 \vskip\parskip
9537 % Place image in a \vtop for a top page margin that is (close to) correct,
9538 % as \topskip glue is relative to the first baseline.
9539 \vtop\bgroup \kern -\capheight \vskip-\parskip
9542 \ifx\centersub\centerV
9543 % For @center @image, enter vertical mode and add vertical space
9544 % Enter an extra \parskip because @center doesn't add space itself.
9545 \vbox\bgroup\vskip\parskip\medskip\vskip\parskip
9546 \else
9547 % Enter horizontal mode so that indentation from an enclosing
9548 % environment such as @quotation is respected.
9549 % However, if we're at the top level, we don't want the
9550 % normal paragraph indentation.
9551 \imageindent
9554 % Output the image.
9555 \ifpdf
9556 % For pdfTeX and LuaTeX <= 0.80
9557 \dopdfimage{#1}{#2}{#3}%
9558 \else
9559 \ifx\XeTeXrevision\thisisundefined
9560 % For epsf.tex
9561 % \epsfbox itself resets \epsf?size at each figure.
9562 \setbox0 = \hbox{\ignorespaces #2}%
9563 \ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
9564 \setbox0 = \hbox{\ignorespaces #3}%
9565 \ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
9566 \epsfbox{#1.eps}%
9567 \else
9568 % For XeTeX
9569 \doxeteximage{#1}{#2}{#3}%
9573 \ifimagevmode
9574 \egroup
9575 \medskip % space after a standalone image
9577 \ifx\centersub\centerV % @center @image
9578 \medskip
9579 \egroup % close \vbox
9581 \endgroup}
9584 % @float FLOATTYPE,LABEL,LOC ... @end float for displayed figures, tables,
9585 % etc. We don't actually implement floating yet, we always include the
9586 % float "here". But it seemed the best name for the future.
9588 \envparseargdef\float{\eatcommaspace\eatcommaspace\dofloat#1, , ,\finish}
9590 % There may be a space before second and/or third parameter; delete it.
9591 \def\eatcommaspace#1, {#1,}
9593 % #1 is the optional FLOATTYPE, the text label for this float, typically
9594 % "Figure", "Table", "Example", etc. Can't contain commas. If omitted,
9595 % this float will not be numbered and cannot be referred to.
9597 % #2 is the optional xref label. Also must be present for the float to
9598 % be referable.
9600 % #3 is the optional positioning argument; for now, it is ignored. It
9601 % will somehow specify the positions allowed to float to (here, top, bottom).
9603 % We keep a separate counter for each FLOATTYPE, which we reset at each
9604 % chapter-level command.
9605 \let\resetallfloatnos=\empty
9607 \def\dofloat#1,#2,#3,#4\finish{%
9608 \let\thiscaption=\empty
9609 \let\thisshortcaption=\empty
9611 % don't lose footnotes inside @float.
9613 % BEWARE: when the floats start float, we have to issue warning whenever an
9614 % insert appears inside a float which could possibly float. --kasal, 26may04
9616 \startsavinginserts
9618 % We can't be used inside a paragraph.
9619 \par
9621 \vtop\bgroup
9622 \def\floattype{#1}%
9623 \def\floatlabel{#2}%
9624 \def\floatloc{#3}% we do nothing with this yet.
9626 \ifx\floattype\empty
9627 \let\safefloattype=\empty
9628 \else
9630 % the floattype might have accents or other special characters,
9631 % but we need to use it in a control sequence name.
9632 \indexnofonts
9633 \turnoffactive
9634 \xdef\safefloattype{\floattype}%
9638 % If label is given but no type, we handle that as the empty type.
9639 \ifx\floatlabel\empty \else
9640 % We want each FLOATTYPE to be numbered separately (Figure 1,
9641 % Table 1, Figure 2, ...). (And if no label, no number.)
9643 \expandafter\getfloatno\csname\safefloattype floatno\endcsname
9644 \global\advance\floatno by 1
9647 % This magic value for \currentsection is output by \setref as the
9648 % XREFLABEL-title value. \xrefX uses it to distinguish float
9649 % labels (which have a completely different output format) from
9650 % node and anchor labels. And \xrdef uses it to construct the
9651 % lists of floats.
9653 \edef\currentsection{\floatmagic=\safefloattype}%
9654 \setref{\floatlabel}{Yfloat}%
9658 % start with \parskip glue, I guess.
9659 \vskip\parskip
9661 % Don't suppress indentation if a float happens to start a section.
9662 \restorefirstparagraphindent
9665 % we have these possibilities:
9666 % @float Foo,lbl & @caption{Cap}: Foo 1.1: Cap
9667 % @float Foo,lbl & no caption: Foo 1.1
9668 % @float Foo & @caption{Cap}: Foo: Cap
9669 % @float Foo & no caption: Foo
9670 % @float ,lbl & Caption{Cap}: 1.1: Cap
9671 % @float ,lbl & no caption: 1.1
9672 % @float & @caption{Cap}: Cap
9673 % @float & no caption:
9675 \def\Efloat{%
9676 \let\floatident = \empty
9678 % In all cases, if we have a float type, it comes first.
9679 \ifx\floattype\empty \else \def\floatident{\floattype}\fi
9681 % If we have an xref label, the number comes next.
9682 \ifx\floatlabel\empty \else
9683 \ifx\floattype\empty \else % if also had float type, need tie first.
9684 \appendtomacro\floatident{\tie}%
9686 % the number.
9687 \appendtomacro\floatident{\chaplevelprefix\the\floatno}%
9690 % Start the printed caption with what we've constructed in
9691 % \floatident, but keep it separate; we need \floatident again.
9692 \let\captionline = \floatident
9694 \ifx\thiscaption\empty \else
9695 \ifx\floatident\empty \else
9696 \appendtomacro\captionline{: }% had ident, so need a colon between
9699 % caption text.
9700 \appendtomacro\captionline{\scanexp\thiscaption}%
9703 % If we have anything to print, print it, with space before.
9704 % Eventually this needs to become an \insert.
9705 \ifx\captionline\empty \else
9706 \vskip.5\parskip
9707 \captionline
9709 % Space below caption.
9710 \vskip\parskip
9713 % If have an xref label, write the list of floats info. Do this
9714 % after the caption, to avoid chance of it being a breakpoint.
9715 \ifx\floatlabel\empty \else
9716 % Write the text that goes in the lof to the aux file as
9717 % \floatlabel-lof. Besides \floatident, we include the short
9718 % caption if specified, else the full caption if specified, else nothing.
9720 \requireauxfile
9721 \atdummies
9723 \ifx\thisshortcaption\empty
9724 \def\gtemp{\thiscaption}%
9725 \else
9726 \def\gtemp{\thisshortcaption}%
9728 \immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident
9729 \ifx\gtemp\empty \else : \gtemp \fi}}%
9732 \egroup % end of \vtop
9734 \checkinserts
9737 % Append the tokens #2 to the definition of macro #1, not expanding either.
9739 \def\appendtomacro#1#2{%
9740 \expandafter\def\expandafter#1\expandafter{#1#2}%
9743 % @caption, @shortcaption
9745 \def\caption{\docaption\thiscaption}
9746 \def\shortcaption{\docaption\thisshortcaption}
9747 \def\docaption{\checkenv\float \bgroup\scanctxt\docaptionz}
9748 \def\docaptionz#1#2{\egroup \def#1{#2}}
9750 % The parameter is the control sequence identifying the counter we are
9751 % going to use. Create it if it doesn't exist and assign it to \floatno.
9752 \def\getfloatno#1{%
9753 \ifx#1\relax
9754 % Haven't seen this figure type before.
9755 \csname newcount\endcsname #1%
9757 % Remember to reset this floatno at the next chap.
9758 \expandafter\gdef\expandafter\resetallfloatnos
9759 \expandafter{\resetallfloatnos #1=0 }%
9761 \let\floatno#1%
9764 % \setref calls this to get the XREFLABEL-snt value. We want an @xref
9765 % to the FLOATLABEL to expand to "Figure 3.1". We call \setref when we
9766 % first read the @float command.
9768 \def\Yfloat{\floattype@tie \chaplevelprefix\the\floatno}%
9770 % Magic string used for the XREFLABEL-title value, so \xrefX can
9771 % distinguish floats from other xref types.
9772 \def\floatmagic{!!float!!}
9774 % #1 is the control sequence we are passed; we expand into a conditional
9775 % which is true if #1 represents a float ref. That is, the magic
9776 % \currentsection value which we \setref above.
9778 \def\iffloat#1{\expandafter\doiffloat#1==\finish}
9780 % #1 is (maybe) the \floatmagic string. If so, #2 will be the
9781 % (safe) float type for this float. We set \iffloattype to #2.
9783 \def\doiffloat#1=#2=#3\finish{%
9784 \def\temp{#1}%
9785 \def\iffloattype{#2}%
9786 \ifx\temp\floatmagic
9789 % @listoffloats FLOATTYPE - print a list of floats like a table of contents.
9791 \parseargdef\listoffloats{%
9792 \def\floattype{#1}% floattype
9794 % the floattype might have accents or other special characters,
9795 % but we need to use it in a control sequence name.
9796 \indexnofonts
9797 \turnoffactive
9798 \xdef\safefloattype{\floattype}%
9801 % \xrdef saves the floats as a \do-list in \floatlistSAFEFLOATTYPE.
9802 \expandafter\ifx\csname floatlist\safefloattype\endcsname \relax
9803 \ifhavexrefs
9804 % if the user said @listoffloats foo but never @float foo.
9805 \message{\linenumber No `\safefloattype' floats to list.}%
9807 \else
9808 \begingroup
9809 \leftskip=\tocindent % indent these entries like a toc
9810 \let\do=\listoffloatsdo
9811 \csname floatlist\safefloattype\endcsname
9812 \endgroup
9816 % This is called on each entry in a list of floats. We're passed the
9817 % xref label, in the form LABEL-title, which is how we save it in the
9818 % aux file. We strip off the -title and look up \XRLABEL-lof, which
9819 % has the text we're supposed to typeset here.
9821 % Figures without xref labels will not be included in the list (since
9822 % they won't appear in the aux file).
9824 \def\listoffloatsdo#1{\listoffloatsdoentry#1\finish}
9825 \def\listoffloatsdoentry#1-title\finish{{%
9826 % Can't fully expand XR#1-lof because it can contain anything. Just
9827 % pass the control sequence. On the other hand, XR#1-pg is just the
9828 % page number, and we want to fully expand that so we can get a link
9829 % in pdf output.
9830 \toksA = \expandafter{\csname XR#1-lof\endcsname}%
9832 % use the same \entry macro we use to generate the TOC and index.
9833 \edef\writeentry{\noexpand\entry{\the\toksA}{\csname XR#1-pg\endcsname}}%
9834 \writeentry
9838 \message{localization,}
9840 % For single-language documents, @documentlanguage is usually given very
9841 % early, just after @documentencoding. Single argument is the language
9842 % (de) or locale (de_DE) abbreviation.
9845 \catcode`\_ = \active
9846 \globaldefs=1
9847 \parseargdef\documentlanguage{%
9848 \tex % read txi-??.tex file in plain TeX.
9849 % Read the file by the name they passed if it exists.
9850 \let_ = \normalunderscore % normal _ character for filename test
9851 \openin 1 txi-#1.tex
9852 \ifeof 1
9853 \documentlanguagetrywithoutunderscore #1_\finish
9854 \else
9855 \globaldefs = 1 % everything in the txi-LL files needs to persist
9856 \input txi-#1.tex
9858 \closein 1
9859 \endgroup % end raw TeX
9862 % If they passed de_DE, and txi-de_DE.tex doesn't exist,
9863 % try txi-de.tex.
9865 \gdef\documentlanguagetrywithoutunderscore#1_#2\finish{%
9866 \openin 1 txi-#1.tex
9867 \ifeof 1
9868 \errhelp = \nolanghelp
9869 \errmessage{Cannot read language file txi-#1.tex}%
9870 \else
9871 \globaldefs = 1 % everything in the txi-LL files needs to persist
9872 \input txi-#1.tex
9874 \closein 1
9876 }% end of special _ catcode
9878 \newhelp\nolanghelp{The given language definition file cannot be found or
9879 is empty. Maybe you need to install it? Putting it in the current
9880 directory should work if nowhere else does.}
9882 % This macro is called from txi-??.tex files; the first argument is the
9883 % \language name to set (without the "\lang@" prefix), the second and
9884 % third args are \{left,right}hyphenmin.
9886 % The language names to pass are determined when the format is built.
9887 % See the etex.log file created at that time, e.g.,
9888 % /usr/local/texlive/2008/texmf-var/web2c/pdftex/etex.log.
9890 % With TeX Live 2008, etex now includes hyphenation patterns for all
9891 % available languages. This means we can support hyphenation in
9892 % Texinfo, at least to some extent. (This still doesn't solve the
9893 % accented characters problem.)
9895 \catcode`@=11
9896 \def\txisetlanguage#1#2#3{%
9897 % do not set the language if the name is undefined in the current TeX.
9898 \expandafter\ifx\csname lang@#1\endcsname \relax
9899 \message{no patterns for #1}%
9900 \else
9901 \global\language = \csname lang@#1\endcsname
9903 % but there is no harm in adjusting the hyphenmin values regardless.
9904 \global\lefthyphenmin = #2\relax
9905 \global\righthyphenmin = #3\relax
9908 % XeTeX and LuaTeX can handle Unicode natively.
9909 % Their default I/O uses UTF-8 sequences instead of a byte-wise operation.
9910 % Other TeX engines' I/O (pdfTeX, etc.) is byte-wise.
9912 \newif\iftxinativeunicodecapable
9913 \newif\iftxiusebytewiseio
9915 \ifx\XeTeXrevision\thisisundefined
9916 \ifx\luatexversion\thisisundefined
9917 \txinativeunicodecapablefalse
9918 \txiusebytewiseiotrue
9919 \else
9920 \txinativeunicodecapabletrue
9921 \txiusebytewiseiofalse
9923 \else
9924 \txinativeunicodecapabletrue
9925 \txiusebytewiseiofalse
9928 % Set I/O by bytes instead of UTF-8 sequence for XeTeX and LuaTex
9929 % for non-UTF-8 (byte-wise) encodings.
9931 \def\setbytewiseio{%
9932 \ifx\XeTeXrevision\thisisundefined
9933 \else
9934 \XeTeXdefaultencoding "bytes" % For subsequent files to be read
9935 \XeTeXinputencoding "bytes" % For document root file
9936 % Unfortunately, there seems to be no corresponding XeTeX command for
9937 % output encoding. This is a problem for auxiliary index and TOC files.
9938 % The only solution would be perhaps to write out @U{...} sequences in
9939 % place of non-ASCII characters.
9942 \ifx\luatexversion\thisisundefined
9943 \else
9944 \directlua{
9945 local utf8_char, byte, gsub = unicode.utf8.char, string.byte, string.gsub
9946 local function convert_char (char)
9947 return utf8_char(byte(char))
9950 local function convert_line (line)
9951 return gsub(line, ".", convert_char)
9954 callback.register("process_input_buffer", convert_line)
9956 local function convert_line_out (line)
9957 local line_out = ""
9958 for c in string.utfvalues(line) do
9959 line_out = line_out .. string.char(c)
9961 return line_out
9964 callback.register("process_output_buffer", convert_line_out)
9968 \txiusebytewiseiotrue
9972 % Helpers for encodings.
9973 % Set the catcode of characters 128 through 255 to the specified number.
9975 \def\setnonasciicharscatcode#1{%
9976 \count255=128
9977 \loop\ifnum\count255<256
9978 \global\catcode\count255=#1\relax
9979 \advance\count255 by 1
9980 \repeat
9983 \def\setnonasciicharscatcodenonglobal#1{%
9984 \count255=128
9985 \loop\ifnum\count255<256
9986 \catcode\count255=#1\relax
9987 \advance\count255 by 1
9988 \repeat
9991 % @documentencoding sets the definition of non-ASCII characters
9992 % according to the specified encoding.
9994 \def\documentencoding{\parseargusing\filenamecatcodes\documentencodingzzz}
9995 \def\documentencodingzzz#1{%
9997 % Encoding being declared for the document.
9998 \def\declaredencoding{\csname #1.enc\endcsname}%
10000 % Supported encodings: names converted to tokens in order to be able
10001 % to compare them with \ifx.
10002 \def\ascii{\csname US-ASCII.enc\endcsname}%
10003 \def\latnine{\csname ISO-8859-15.enc\endcsname}%
10004 \def\latone{\csname ISO-8859-1.enc\endcsname}%
10005 \def\lattwo{\csname ISO-8859-2.enc\endcsname}%
10006 \def\utfeight{\csname UTF-8.enc\endcsname}%
10008 \ifx \declaredencoding \ascii
10009 \asciichardefs
10011 \else \ifx \declaredencoding \lattwo
10012 \iftxinativeunicodecapable
10013 \setbytewiseio
10015 \setnonasciicharscatcode\active
10016 \lattwochardefs
10018 \else \ifx \declaredencoding \latone
10019 \iftxinativeunicodecapable
10020 \setbytewiseio
10022 \setnonasciicharscatcode\active
10023 \latonechardefs
10025 \else \ifx \declaredencoding \latnine
10026 \iftxinativeunicodecapable
10027 \setbytewiseio
10029 \setnonasciicharscatcode\active
10030 \latninechardefs
10032 \else \ifx \declaredencoding \utfeight
10033 \iftxinativeunicodecapable
10034 % For native Unicode handling (XeTeX and LuaTeX)
10035 \nativeunicodechardefs
10036 \else
10037 % For treating UTF-8 as byte sequences (TeX, eTeX and pdfTeX).
10038 % Since we already invoke \utfeightchardefs at the top level,
10039 % making non-ascii chars active is sufficient.
10040 \setnonasciicharscatcode\active
10043 \else
10044 \message{Ignoring unknown document encoding: #1.}%
10046 \fi % utfeight
10047 \fi % latnine
10048 \fi % latone
10049 \fi % lattwo
10050 \fi % ascii
10052 \ifx\XeTeXrevision\thisisundefined
10053 \else
10054 \ifx \declaredencoding \utfeight
10055 \else
10056 \ifx \declaredencoding \ascii
10057 \else
10058 \message{Warning: XeTeX with non-UTF-8 encodings cannot handle %
10059 non-ASCII characters in auxiliary files.}%
10065 % A message to be logged when using a character that isn't available
10066 % the default font encoding (OT1).
10068 \def\missingcharmsg#1{\message{Character missing, sorry: #1.}}
10070 % Take account of \c (plain) vs. \, (Texinfo) difference.
10071 \def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi}
10073 \def\gdefchar#1#2{%
10074 \gdef#1{%
10075 \ifpassthroughchars
10076 \string#1%
10077 \else
10082 \begingroup
10084 % Make non-ASCII characters active for defining the character definition
10085 % macros.
10086 \setnonasciicharscatcode\active
10088 % Latin1 (ISO-8859-1) character definitions.
10089 \gdef\latonechardefs{%
10090 \gdefchar^^a0{\tie}
10091 \gdefchar^^a1{\exclamdown}
10092 \gdefchar^^a2{{\tcfont \char162}} % cent
10093 \gdefchar^^a3{\pounds{}}
10094 \gdefchar^^a4{{\tcfont \char164}} % currency
10095 \gdefchar^^a5{{\tcfont \char165}} % yen
10096 \gdefchar^^a6{{\tcfont \char166}} % broken bar
10097 \gdefchar^^a7{\S}
10098 \gdefchar^^a8{\"{}}
10099 \gdefchar^^a9{\copyright{}}
10100 \gdefchar^^aa{\ordf}
10101 \gdefchar^^ab{\guillemetleft{}}
10102 \gdefchar^^ac{\ensuremath\lnot}
10103 \gdefchar^^ad{\-}
10104 \gdefchar^^ae{\registeredsymbol{}}
10105 \gdefchar^^af{\={}}
10107 \gdefchar^^b0{\textdegree}
10108 \gdefchar^^b1{$\pm$}
10109 \gdefchar^^b2{$^2$}
10110 \gdefchar^^b3{$^3$}
10111 \gdefchar^^b4{\'{}}
10112 \gdefchar^^b5{$\mu$}
10113 \gdefchar^^b6{\P}
10114 \gdefchar^^b7{\ensuremath\cdot}
10115 \gdefchar^^b8{\cedilla\ }
10116 \gdefchar^^b9{$^1$}
10117 \gdefchar^^ba{\ordm}
10118 \gdefchar^^bb{\guillemetright{}}
10119 \gdefchar^^bc{$1\over4$}
10120 \gdefchar^^bd{$1\over2$}
10121 \gdefchar^^be{$3\over4$}
10122 \gdefchar^^bf{\questiondown}
10124 \gdefchar^^c0{\`A}
10125 \gdefchar^^c1{\'A}
10126 \gdefchar^^c2{\^A}
10127 \gdefchar^^c3{\~A}
10128 \gdefchar^^c4{\"A}
10129 \gdefchar^^c5{\ringaccent A}
10130 \gdefchar^^c6{\AE}
10131 \gdefchar^^c7{\cedilla C}
10132 \gdefchar^^c8{\`E}
10133 \gdefchar^^c9{\'E}
10134 \gdefchar^^ca{\^E}
10135 \gdefchar^^cb{\"E}
10136 \gdefchar^^cc{\`I}
10137 \gdefchar^^cd{\'I}
10138 \gdefchar^^ce{\^I}
10139 \gdefchar^^cf{\"I}
10141 \gdefchar^^d0{\DH}
10142 \gdefchar^^d1{\~N}
10143 \gdefchar^^d2{\`O}
10144 \gdefchar^^d3{\'O}
10145 \gdefchar^^d4{\^O}
10146 \gdefchar^^d5{\~O}
10147 \gdefchar^^d6{\"O}
10148 \gdefchar^^d7{$\times$}
10149 \gdefchar^^d8{\O}
10150 \gdefchar^^d9{\`U}
10151 \gdefchar^^da{\'U}
10152 \gdefchar^^db{\^U}
10153 \gdefchar^^dc{\"U}
10154 \gdefchar^^dd{\'Y}
10155 \gdefchar^^de{\TH}
10156 \gdefchar^^df{\ss}
10158 \gdefchar^^e0{\`a}
10159 \gdefchar^^e1{\'a}
10160 \gdefchar^^e2{\^a}
10161 \gdefchar^^e3{\~a}
10162 \gdefchar^^e4{\"a}
10163 \gdefchar^^e5{\ringaccent a}
10164 \gdefchar^^e6{\ae}
10165 \gdefchar^^e7{\cedilla c}
10166 \gdefchar^^e8{\`e}
10167 \gdefchar^^e9{\'e}
10168 \gdefchar^^ea{\^e}
10169 \gdefchar^^eb{\"e}
10170 \gdefchar^^ec{\`{\dotless i}}
10171 \gdefchar^^ed{\'{\dotless i}}
10172 \gdefchar^^ee{\^{\dotless i}}
10173 \gdefchar^^ef{\"{\dotless i}}
10175 \gdefchar^^f0{\dh}
10176 \gdefchar^^f1{\~n}
10177 \gdefchar^^f2{\`o}
10178 \gdefchar^^f3{\'o}
10179 \gdefchar^^f4{\^o}
10180 \gdefchar^^f5{\~o}
10181 \gdefchar^^f6{\"o}
10182 \gdefchar^^f7{$\div$}
10183 \gdefchar^^f8{\o}
10184 \gdefchar^^f9{\`u}
10185 \gdefchar^^fa{\'u}
10186 \gdefchar^^fb{\^u}
10187 \gdefchar^^fc{\"u}
10188 \gdefchar^^fd{\'y}
10189 \gdefchar^^fe{\th}
10190 \gdefchar^^ff{\"y}
10193 % Latin9 (ISO-8859-15) encoding character definitions.
10194 \gdef\latninechardefs{%
10195 % Encoding is almost identical to Latin1.
10196 \latonechardefs
10198 \gdefchar^^a4{\euro{}}
10199 \gdefchar^^a6{\v S}
10200 \gdefchar^^a8{\v s}
10201 \gdefchar^^b4{\v Z}
10202 \gdefchar^^b8{\v z}
10203 \gdefchar^^bc{\OE}
10204 \gdefchar^^bd{\oe}
10205 \gdefchar^^be{\"Y}
10208 % Latin2 (ISO-8859-2) character definitions.
10209 \gdef\lattwochardefs{%
10210 \gdefchar^^a0{\tie}
10211 \gdefchar^^a1{\ogonek{A}}
10212 \gdefchar^^a2{\u{}}
10213 \gdefchar^^a3{\L}
10214 \gdefchar^^a4{\missingcharmsg{CURRENCY SIGN}}
10215 \gdefchar^^a5{\v L}
10216 \gdefchar^^a6{\'S}
10217 \gdefchar^^a7{\S}
10218 \gdefchar^^a8{\"{}}
10219 \gdefchar^^a9{\v S}
10220 \gdefchar^^aa{\cedilla S}
10221 \gdefchar^^ab{\v T}
10222 \gdefchar^^ac{\'Z}
10223 \gdefchar^^ad{\-}
10224 \gdefchar^^ae{\v Z}
10225 \gdefchar^^af{\dotaccent Z}
10227 \gdefchar^^b0{\textdegree}
10228 \gdefchar^^b1{\ogonek{a}}
10229 \gdefchar^^b2{\ogonek{ }}
10230 \gdefchar^^b3{\l}
10231 \gdefchar^^b4{\'{}}
10232 \gdefchar^^b5{\v l}
10233 \gdefchar^^b6{\'s}
10234 \gdefchar^^b7{\v{}}
10235 \gdefchar^^b8{\cedilla\ }
10236 \gdefchar^^b9{\v s}
10237 \gdefchar^^ba{\cedilla s}
10238 \gdefchar^^bb{\v t}
10239 \gdefchar^^bc{\'z}
10240 \gdefchar^^bd{\H{}}
10241 \gdefchar^^be{\v z}
10242 \gdefchar^^bf{\dotaccent z}
10244 \gdefchar^^c0{\'R}
10245 \gdefchar^^c1{\'A}
10246 \gdefchar^^c2{\^A}
10247 \gdefchar^^c3{\u A}
10248 \gdefchar^^c4{\"A}
10249 \gdefchar^^c5{\'L}
10250 \gdefchar^^c6{\'C}
10251 \gdefchar^^c7{\cedilla C}
10252 \gdefchar^^c8{\v C}
10253 \gdefchar^^c9{\'E}
10254 \gdefchar^^ca{\ogonek{E}}
10255 \gdefchar^^cb{\"E}
10256 \gdefchar^^cc{\v E}
10257 \gdefchar^^cd{\'I}
10258 \gdefchar^^ce{\^I}
10259 \gdefchar^^cf{\v D}
10261 \gdefchar^^d0{\DH}
10262 \gdefchar^^d1{\'N}
10263 \gdefchar^^d2{\v N}
10264 \gdefchar^^d3{\'O}
10265 \gdefchar^^d4{\^O}
10266 \gdefchar^^d5{\H O}
10267 \gdefchar^^d6{\"O}
10268 \gdefchar^^d7{$\times$}
10269 \gdefchar^^d8{\v R}
10270 \gdefchar^^d9{\ringaccent U}
10271 \gdefchar^^da{\'U}
10272 \gdefchar^^db{\H U}
10273 \gdefchar^^dc{\"U}
10274 \gdefchar^^dd{\'Y}
10275 \gdefchar^^de{\cedilla T}
10276 \gdefchar^^df{\ss}
10278 \gdefchar^^e0{\'r}
10279 \gdefchar^^e1{\'a}
10280 \gdefchar^^e2{\^a}
10281 \gdefchar^^e3{\u a}
10282 \gdefchar^^e4{\"a}
10283 \gdefchar^^e5{\'l}
10284 \gdefchar^^e6{\'c}
10285 \gdefchar^^e7{\cedilla c}
10286 \gdefchar^^e8{\v c}
10287 \gdefchar^^e9{\'e}
10288 \gdefchar^^ea{\ogonek{e}}
10289 \gdefchar^^eb{\"e}
10290 \gdefchar^^ec{\v e}
10291 \gdefchar^^ed{\'{\dotless{i}}}
10292 \gdefchar^^ee{\^{\dotless{i}}}
10293 \gdefchar^^ef{\v d}
10295 \gdefchar^^f0{\dh}
10296 \gdefchar^^f1{\'n}
10297 \gdefchar^^f2{\v n}
10298 \gdefchar^^f3{\'o}
10299 \gdefchar^^f4{\^o}
10300 \gdefchar^^f5{\H o}
10301 \gdefchar^^f6{\"o}
10302 \gdefchar^^f7{$\div$}
10303 \gdefchar^^f8{\v r}
10304 \gdefchar^^f9{\ringaccent u}
10305 \gdefchar^^fa{\'u}
10306 \gdefchar^^fb{\H u}
10307 \gdefchar^^fc{\"u}
10308 \gdefchar^^fd{\'y}
10309 \gdefchar^^fe{\cedilla t}
10310 \gdefchar^^ff{\dotaccent{}}
10313 \endgroup % active chars
10315 % UTF-8 character definitions.
10317 % This code to support UTF-8 is based on LaTeX's utf8.def, with some
10318 % changes for Texinfo conventions. It is included here under the GPL by
10319 % permission from Frank Mittelbach and the LaTeX team.
10321 \newcount\countUTFx
10322 \newcount\countUTFy
10323 \newcount\countUTFz
10325 \gdef\UTFviiiTwoOctets#1#2{\expandafter
10326 \UTFviiiDefined\csname u8:#1\string #2\endcsname}
10328 \gdef\UTFviiiThreeOctets#1#2#3{\expandafter
10329 \UTFviiiDefined\csname u8:#1\string #2\string #3\endcsname}
10331 \gdef\UTFviiiFourOctets#1#2#3#4{\expandafter
10332 \UTFviiiDefined\csname u8:#1\string #2\string #3\string #4\endcsname}
10334 \gdef\UTFviiiDefined#1{%
10335 \ifx #1\relax
10336 \message{\linenumber Unicode char \string #1 not defined for Texinfo}%
10337 \else
10338 \expandafter #1%
10342 % Give non-ASCII bytes the active definitions for processing UTF-8 sequences
10343 \begingroup
10344 \catcode`\~13
10345 \catcode`\$12
10346 \catcode`\"12
10348 % Loop from \countUTFx to \countUTFy, performing \UTFviiiTmp
10349 % substituting ~ and $ with a character token of that value.
10350 \def\UTFviiiLoop{%
10351 \global\catcode\countUTFx\active
10352 \uccode`\~\countUTFx
10353 \uccode`\$\countUTFx
10354 \uppercase\expandafter{\UTFviiiTmp}%
10355 \advance\countUTFx by 1
10356 \ifnum\countUTFx < \countUTFy
10357 \expandafter\UTFviiiLoop
10358 \fi}
10360 % For bytes other than the first in a UTF-8 sequence. Not expected to
10361 % be expanded except when writing to auxiliary files.
10362 \countUTFx = "80
10363 \countUTFy = "C2
10364 \def\UTFviiiTmp{%
10365 \gdef~{%
10366 \ifpassthroughchars $\fi}}%
10367 \UTFviiiLoop
10369 \countUTFx = "C2
10370 \countUTFy = "E0
10371 \def\UTFviiiTmp{%
10372 \gdef~{%
10373 \ifpassthroughchars $%
10374 \else\expandafter\UTFviiiTwoOctets\expandafter$\fi}}%
10375 \UTFviiiLoop
10377 \countUTFx = "E0
10378 \countUTFy = "F0
10379 \def\UTFviiiTmp{%
10380 \gdef~{%
10381 \ifpassthroughchars $%
10382 \else\expandafter\UTFviiiThreeOctets\expandafter$\fi}}%
10383 \UTFviiiLoop
10385 \countUTFx = "F0
10386 \countUTFy = "F4
10387 \def\UTFviiiTmp{%
10388 \gdef~{%
10389 \ifpassthroughchars $%
10390 \else\expandafter\UTFviiiFourOctets\expandafter$\fi
10392 \UTFviiiLoop
10393 \endgroup
10395 \def\globallet{\global\let} % save some \expandafter's below
10397 % @U{xxxx} to produce U+xxxx, if we support it.
10398 \def\U#1{%
10399 \expandafter\ifx\csname uni:#1\endcsname \relax
10400 \iftxinativeunicodecapable
10401 % All Unicode characters can be used if native Unicode handling is
10402 % active. However, if the font does not have the glyph,
10403 % letters are missing.
10404 \begingroup
10405 \uccode`\.="#1\relax
10406 \uppercase{.}
10407 \endgroup
10408 \else
10409 \errhelp = \EMsimple
10410 \errmessage{Unicode character U+#1 not supported, sorry}%
10412 \else
10413 \csname uni:#1\endcsname
10417 % These macros are used here to construct the name of a control
10418 % sequence to be defined.
10419 \def\UTFviiiTwoOctetsName#1#2{%
10420 \csname u8:#1\string #2\endcsname}%
10421 \def\UTFviiiThreeOctetsName#1#2#3{%
10422 \csname u8:#1\string #2\string #3\endcsname}%
10423 \def\UTFviiiFourOctetsName#1#2#3#4{%
10424 \csname u8:#1\string #2\string #3\string #4\endcsname}%
10426 % For UTF-8 byte sequences (TeX, e-TeX and pdfTeX),
10427 % provide a definition macro to replace a Unicode character;
10428 % this gets used by the @U command
10430 \begingroup
10431 \catcode`\"=12
10432 \catcode`\<=12
10433 \catcode`\.=12
10434 \catcode`\,=12
10435 \catcode`\;=12
10436 \catcode`\!=12
10437 \catcode`\~=13
10438 \gdef\DeclareUnicodeCharacterUTFviii#1#2{%
10439 \countUTFz = "#1\relax
10440 \begingroup
10441 \parseXMLCharref
10443 % Give \u8:... its definition. The sequence of seven \expandafter's
10444 % expands after the \gdef three times, e.g.
10446 % 1. \UTFviiTwoOctetsName B1 B2
10447 % 2. \csname u8:B1 \string B2 \endcsname
10448 % 3. \u8: B1 B2 (a single control sequence token)
10450 \expandafter\expandafter
10451 \expandafter\expandafter
10452 \expandafter\expandafter
10453 \expandafter\gdef \UTFviiiTmp{#2}%
10455 \expandafter\ifx\csname uni:#1\endcsname \relax \else
10456 \message{Internal error, already defined: #1}%
10459 % define an additional control sequence for this code point.
10460 \expandafter\globallet\csname uni:#1\endcsname \UTFviiiTmp
10461 \endgroup}
10463 % Given the value in \countUTFz as a Unicode code point, set \UTFviiiTmp
10464 % to the corresponding UTF-8 sequence.
10465 \gdef\parseXMLCharref{%
10466 \ifnum\countUTFz < "20\relax
10467 \errhelp = \EMsimple
10468 \errmessage{Cannot define Unicode char value < 0020}%
10469 \else\ifnum\countUTFz < "800\relax
10470 \parseUTFviiiA,%
10471 \parseUTFviiiB C\UTFviiiTwoOctetsName.,%
10472 \else\ifnum\countUTFz < "10000\relax
10473 \parseUTFviiiA;%
10474 \parseUTFviiiA,%
10475 \parseUTFviiiB E\UTFviiiThreeOctetsName.{,;}%
10476 \else
10477 \parseUTFviiiA;%
10478 \parseUTFviiiA,%
10479 \parseUTFviiiA!%
10480 \parseUTFviiiB F\UTFviiiFourOctetsName.{!,;}%
10481 \fi\fi\fi
10484 % Extract a byte from the end of the UTF-8 representation of \countUTFx.
10485 % It must be a non-initial byte in the sequence.
10486 % Change \uccode of #1 for it to be used in \parseUTFviiiB as one
10487 % of the bytes.
10488 \gdef\parseUTFviiiA#1{%
10489 \countUTFx = \countUTFz
10490 \divide\countUTFz by 64
10491 \countUTFy = \countUTFz % Save to be the future value of \countUTFz.
10492 \multiply\countUTFz by 64
10494 % \countUTFz is now \countUTFx with the last 5 bits cleared. Subtract
10495 % in order to get the last five bits.
10496 \advance\countUTFx by -\countUTFz
10498 % Convert this to the byte in the UTF-8 sequence.
10499 \advance\countUTFx by 128
10500 \uccode `#1\countUTFx
10501 \countUTFz = \countUTFy}
10503 % Used to put a UTF-8 byte sequence into \UTFviiiTmp
10504 % #1 is the increment for \countUTFz to yield a the first byte of the UTF-8
10505 % sequence.
10506 % #2 is one of the \UTFviii*OctetsName macros.
10507 % #3 is always a full stop (.)
10508 % #4 is a template for the other bytes in the sequence. The values for these
10509 % bytes is substituted in here with \uppercase using the \uccode's.
10510 \gdef\parseUTFviiiB#1#2#3#4{%
10511 \advance\countUTFz by "#10\relax
10512 \uccode `#3\countUTFz
10513 \uppercase{\gdef\UTFviiiTmp{#2#3#4}}}
10514 \endgroup
10516 % For native Unicode handling (XeTeX and LuaTeX),
10517 % provide a definition macro that sets a catcode to `other' non-globally
10519 \def\DeclareUnicodeCharacterNativeOther#1#2{%
10520 \catcode"#1=\other
10523 % https://en.wikipedia.org/wiki/Plane_(Unicode)#Basic_M
10524 % U+0000..U+007F = https://en.wikipedia.org/wiki/Basic_Latin_(Unicode_block)
10525 % U+0080..U+00FF = https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)
10526 % U+0100..U+017F = https://en.wikipedia.org/wiki/Latin_Extended-A
10527 % U+0180..U+024F = https://en.wikipedia.org/wiki/Latin_Extended-B
10529 % Many of our renditions are less than wonderful, and all the missing
10530 % characters are available somewhere. Loading the necessary fonts
10531 % awaits user request. We can't truly support Unicode without
10532 % reimplementing everything that's been done in LaTeX for many years,
10533 % plus probably using luatex or xetex, and who knows what else.
10534 % We won't be doing that here in this simple file. But we can try to at
10535 % least make most of the characters not bomb out.
10537 \def\unicodechardefs{%
10538 \DeclareUnicodeCharacter{0020}{ } % space
10539 \DeclareUnicodeCharacter{0021}{\char"21 }% % space to terminate number
10540 \DeclareUnicodeCharacter{0022}{\char"22 }%
10541 \DeclareUnicodeCharacter{0023}{\char"23 }%
10542 \DeclareUnicodeCharacter{0024}{\char"24 }%
10543 \DeclareUnicodeCharacter{0025}{\char"25 }%
10544 \DeclareUnicodeCharacter{0026}{\char"26 }%
10545 \DeclareUnicodeCharacter{0027}{\char"27 }%
10546 \DeclareUnicodeCharacter{0028}{\char"28 }%
10547 \DeclareUnicodeCharacter{0029}{\char"29 }%
10548 \DeclareUnicodeCharacter{002A}{\char"2A }%
10549 \DeclareUnicodeCharacter{002B}{\char"2B }%
10550 \DeclareUnicodeCharacter{002C}{\char"2C }%
10551 \DeclareUnicodeCharacter{002D}{\char"2D }%
10552 \DeclareUnicodeCharacter{002E}{\char"2E }%
10553 \DeclareUnicodeCharacter{002F}{\char"2F }%
10554 \DeclareUnicodeCharacter{0030}{0}%
10555 \DeclareUnicodeCharacter{0031}{1}%
10556 \DeclareUnicodeCharacter{0032}{2}%
10557 \DeclareUnicodeCharacter{0033}{3}%
10558 \DeclareUnicodeCharacter{0034}{4}%
10559 \DeclareUnicodeCharacter{0035}{5}%
10560 \DeclareUnicodeCharacter{0036}{6}%
10561 \DeclareUnicodeCharacter{0037}{7}%
10562 \DeclareUnicodeCharacter{0038}{8}%
10563 \DeclareUnicodeCharacter{0039}{9}%
10564 \DeclareUnicodeCharacter{003A}{\char"3A }%
10565 \DeclareUnicodeCharacter{003B}{\char"3B }%
10566 \DeclareUnicodeCharacter{003C}{\char"3C }%
10567 \DeclareUnicodeCharacter{003D}{\char"3D }%
10568 \DeclareUnicodeCharacter{003E}{\char"3E }%
10569 \DeclareUnicodeCharacter{003F}{\char"3F }%
10570 \DeclareUnicodeCharacter{0040}{\char"40 }%
10571 \DeclareUnicodeCharacter{0041}{A}%
10572 \DeclareUnicodeCharacter{0042}{B}%
10573 \DeclareUnicodeCharacter{0043}{C}%
10574 \DeclareUnicodeCharacter{0044}{D}%
10575 \DeclareUnicodeCharacter{0045}{E}%
10576 \DeclareUnicodeCharacter{0046}{F}%
10577 \DeclareUnicodeCharacter{0047}{G}%
10578 \DeclareUnicodeCharacter{0048}{H}%
10579 \DeclareUnicodeCharacter{0049}{I}%
10580 \DeclareUnicodeCharacter{004A}{J}%
10581 \DeclareUnicodeCharacter{004B}{K}%
10582 \DeclareUnicodeCharacter{004C}{L}%
10583 \DeclareUnicodeCharacter{004D}{M}%
10584 \DeclareUnicodeCharacter{004E}{N}%
10585 \DeclareUnicodeCharacter{004F}{O}%
10586 \DeclareUnicodeCharacter{0050}{P}%
10587 \DeclareUnicodeCharacter{0051}{Q}%
10588 \DeclareUnicodeCharacter{0052}{R}%
10589 \DeclareUnicodeCharacter{0053}{S}%
10590 \DeclareUnicodeCharacter{0054}{T}%
10591 \DeclareUnicodeCharacter{0055}{U}%
10592 \DeclareUnicodeCharacter{0056}{V}%
10593 \DeclareUnicodeCharacter{0057}{W}%
10594 \DeclareUnicodeCharacter{0058}{X}%
10595 \DeclareUnicodeCharacter{0059}{Y}%
10596 \DeclareUnicodeCharacter{005A}{Z}%
10597 \DeclareUnicodeCharacter{005B}{\char"5B }%
10598 \DeclareUnicodeCharacter{005C}{\char"5C }%
10599 \DeclareUnicodeCharacter{005D}{\char"5D }%
10600 \DeclareUnicodeCharacter{005E}{\char"5E }%
10601 \DeclareUnicodeCharacter{005F}{\char"5F }%
10602 \DeclareUnicodeCharacter{0060}{\char"60 }%
10603 \DeclareUnicodeCharacter{0061}{a}%
10604 \DeclareUnicodeCharacter{0062}{b}%
10605 \DeclareUnicodeCharacter{0063}{c}%
10606 \DeclareUnicodeCharacter{0064}{d}%
10607 \DeclareUnicodeCharacter{0065}{e}%
10608 \DeclareUnicodeCharacter{0066}{f}%
10609 \DeclareUnicodeCharacter{0067}{g}%
10610 \DeclareUnicodeCharacter{0068}{h}%
10611 \DeclareUnicodeCharacter{0069}{i}%
10612 \DeclareUnicodeCharacter{006A}{j}%
10613 \DeclareUnicodeCharacter{006B}{k}%
10614 \DeclareUnicodeCharacter{006C}{l}%
10615 \DeclareUnicodeCharacter{006D}{m}%
10616 \DeclareUnicodeCharacter{006E}{n}%
10617 \DeclareUnicodeCharacter{006F}{o}%
10618 \DeclareUnicodeCharacter{0070}{p}%
10619 \DeclareUnicodeCharacter{0071}{q}%
10620 \DeclareUnicodeCharacter{0072}{r}%
10621 \DeclareUnicodeCharacter{0073}{s}%
10622 \DeclareUnicodeCharacter{0074}{t}%
10623 \DeclareUnicodeCharacter{0075}{u}%
10624 \DeclareUnicodeCharacter{0076}{v}%
10625 \DeclareUnicodeCharacter{0077}{w}%
10626 \DeclareUnicodeCharacter{0078}{x}%
10627 \DeclareUnicodeCharacter{0079}{y}%
10628 \DeclareUnicodeCharacter{007A}{z}%
10629 \DeclareUnicodeCharacter{007B}{\char"7B }%
10630 \DeclareUnicodeCharacter{007C}{\char"7C }%
10631 \DeclareUnicodeCharacter{007D}{\char"7D }%
10632 \DeclareUnicodeCharacter{007E}{\char"7E }%
10633 % \DeclareUnicodeCharacter{007F}{} % DEL
10635 \DeclareUnicodeCharacter{00A0}{\tie}%
10636 \DeclareUnicodeCharacter{00A1}{\exclamdown}%
10637 \DeclareUnicodeCharacter{00A2}{{\tcfont \char162}}% 0242=cent
10638 \DeclareUnicodeCharacter{00A3}{\pounds{}}%
10639 \DeclareUnicodeCharacter{00A4}{{\tcfont \char164}}% 0244=currency
10640 \DeclareUnicodeCharacter{00A5}{{\tcfont \char165}}% 0245=yen
10641 \DeclareUnicodeCharacter{00A6}{{\tcfont \char166}}% 0246=brokenbar
10642 \DeclareUnicodeCharacter{00A7}{\S}%
10643 \DeclareUnicodeCharacter{00A8}{\"{ }}%
10644 \DeclareUnicodeCharacter{00A9}{\copyright{}}%
10645 \DeclareUnicodeCharacter{00AA}{\ordf}%
10646 \DeclareUnicodeCharacter{00AB}{\guillemetleft{}}%
10647 \DeclareUnicodeCharacter{00AC}{\ensuremath\lnot}%
10648 \DeclareUnicodeCharacter{00AD}{\-}%
10649 \DeclareUnicodeCharacter{00AE}{\registeredsymbol{}}%
10650 \DeclareUnicodeCharacter{00AF}{\={ }}%
10652 \DeclareUnicodeCharacter{00B0}{\textdegree}%
10653 \DeclareUnicodeCharacter{00B1}{\ensuremath\pm}%
10654 \DeclareUnicodeCharacter{00B2}{$^2$}%
10655 \DeclareUnicodeCharacter{00B3}{$^3$}%
10656 \DeclareUnicodeCharacter{00B4}{\'{ }}%
10657 \DeclareUnicodeCharacter{00B5}{$\mu$}%
10658 \DeclareUnicodeCharacter{00B6}{\P}%
10659 \DeclareUnicodeCharacter{00B7}{\ensuremath\cdot}%
10660 \DeclareUnicodeCharacter{00B8}{\cedilla{ }}%
10661 \DeclareUnicodeCharacter{00B9}{$^1$}%
10662 \DeclareUnicodeCharacter{00BA}{\ordm}%
10663 \DeclareUnicodeCharacter{00BB}{\guillemetright{}}%
10664 \DeclareUnicodeCharacter{00BC}{$1\over4$}%
10665 \DeclareUnicodeCharacter{00BD}{$1\over2$}%
10666 \DeclareUnicodeCharacter{00BE}{$3\over4$}%
10667 \DeclareUnicodeCharacter{00BF}{\questiondown}%
10669 \DeclareUnicodeCharacter{00C0}{\`A}%
10670 \DeclareUnicodeCharacter{00C1}{\'A}%
10671 \DeclareUnicodeCharacter{00C2}{\^A}%
10672 \DeclareUnicodeCharacter{00C3}{\~A}%
10673 \DeclareUnicodeCharacter{00C4}{\"A}%
10674 \DeclareUnicodeCharacter{00C5}{\AA}%
10675 \DeclareUnicodeCharacter{00C6}{\AE}%
10676 \DeclareUnicodeCharacter{00C7}{\cedilla{C}}%
10677 \DeclareUnicodeCharacter{00C8}{\`E}%
10678 \DeclareUnicodeCharacter{00C9}{\'E}%
10679 \DeclareUnicodeCharacter{00CA}{\^E}%
10680 \DeclareUnicodeCharacter{00CB}{\"E}%
10681 \DeclareUnicodeCharacter{00CC}{\`I}%
10682 \DeclareUnicodeCharacter{00CD}{\'I}%
10683 \DeclareUnicodeCharacter{00CE}{\^I}%
10684 \DeclareUnicodeCharacter{00CF}{\"I}%
10686 \DeclareUnicodeCharacter{00D0}{\DH}%
10687 \DeclareUnicodeCharacter{00D1}{\~N}%
10688 \DeclareUnicodeCharacter{00D2}{\`O}%
10689 \DeclareUnicodeCharacter{00D3}{\'O}%
10690 \DeclareUnicodeCharacter{00D4}{\^O}%
10691 \DeclareUnicodeCharacter{00D5}{\~O}%
10692 \DeclareUnicodeCharacter{00D6}{\"O}%
10693 \DeclareUnicodeCharacter{00D7}{\ensuremath\times}%
10694 \DeclareUnicodeCharacter{00D8}{\O}%
10695 \DeclareUnicodeCharacter{00D9}{\`U}%
10696 \DeclareUnicodeCharacter{00DA}{\'U}%
10697 \DeclareUnicodeCharacter{00DB}{\^U}%
10698 \DeclareUnicodeCharacter{00DC}{\"U}%
10699 \DeclareUnicodeCharacter{00DD}{\'Y}%
10700 \DeclareUnicodeCharacter{00DE}{\TH}%
10701 \DeclareUnicodeCharacter{00DF}{\ss}%
10703 \DeclareUnicodeCharacter{00E0}{\`a}%
10704 \DeclareUnicodeCharacter{00E1}{\'a}%
10705 \DeclareUnicodeCharacter{00E2}{\^a}%
10706 \DeclareUnicodeCharacter{00E3}{\~a}%
10707 \DeclareUnicodeCharacter{00E4}{\"a}%
10708 \DeclareUnicodeCharacter{00E5}{\aa}%
10709 \DeclareUnicodeCharacter{00E6}{\ae}%
10710 \DeclareUnicodeCharacter{00E7}{\cedilla{c}}%
10711 \DeclareUnicodeCharacter{00E8}{\`e}%
10712 \DeclareUnicodeCharacter{00E9}{\'e}%
10713 \DeclareUnicodeCharacter{00EA}{\^e}%
10714 \DeclareUnicodeCharacter{00EB}{\"e}%
10715 \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}}%
10716 \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}}%
10717 \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}}%
10718 \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}}%
10720 \DeclareUnicodeCharacter{00F0}{\dh}%
10721 \DeclareUnicodeCharacter{00F1}{\~n}%
10722 \DeclareUnicodeCharacter{00F2}{\`o}%
10723 \DeclareUnicodeCharacter{00F3}{\'o}%
10724 \DeclareUnicodeCharacter{00F4}{\^o}%
10725 \DeclareUnicodeCharacter{00F5}{\~o}%
10726 \DeclareUnicodeCharacter{00F6}{\"o}%
10727 \DeclareUnicodeCharacter{00F7}{\ensuremath\div}%
10728 \DeclareUnicodeCharacter{00F8}{\o}%
10729 \DeclareUnicodeCharacter{00F9}{\`u}%
10730 \DeclareUnicodeCharacter{00FA}{\'u}%
10731 \DeclareUnicodeCharacter{00FB}{\^u}%
10732 \DeclareUnicodeCharacter{00FC}{\"u}%
10733 \DeclareUnicodeCharacter{00FD}{\'y}%
10734 \DeclareUnicodeCharacter{00FE}{\th}%
10735 \DeclareUnicodeCharacter{00FF}{\"y}%
10737 \DeclareUnicodeCharacter{0100}{\=A}%
10738 \DeclareUnicodeCharacter{0101}{\=a}%
10739 \DeclareUnicodeCharacter{0102}{\u{A}}%
10740 \DeclareUnicodeCharacter{0103}{\u{a}}%
10741 \DeclareUnicodeCharacter{0104}{\ogonek{A}}%
10742 \DeclareUnicodeCharacter{0105}{\ogonek{a}}%
10743 \DeclareUnicodeCharacter{0106}{\'C}%
10744 \DeclareUnicodeCharacter{0107}{\'c}%
10745 \DeclareUnicodeCharacter{0108}{\^C}%
10746 \DeclareUnicodeCharacter{0109}{\^c}%
10747 \DeclareUnicodeCharacter{010A}{\dotaccent{C}}%
10748 \DeclareUnicodeCharacter{010B}{\dotaccent{c}}%
10749 \DeclareUnicodeCharacter{010C}{\v{C}}%
10750 \DeclareUnicodeCharacter{010D}{\v{c}}%
10751 \DeclareUnicodeCharacter{010E}{\v{D}}%
10752 \DeclareUnicodeCharacter{010F}{d'}%
10754 \DeclareUnicodeCharacter{0110}{\DH}%
10755 \DeclareUnicodeCharacter{0111}{\dh}%
10756 \DeclareUnicodeCharacter{0112}{\=E}%
10757 \DeclareUnicodeCharacter{0113}{\=e}%
10758 \DeclareUnicodeCharacter{0114}{\u{E}}%
10759 \DeclareUnicodeCharacter{0115}{\u{e}}%
10760 \DeclareUnicodeCharacter{0116}{\dotaccent{E}}%
10761 \DeclareUnicodeCharacter{0117}{\dotaccent{e}}%
10762 \DeclareUnicodeCharacter{0118}{\ogonek{E}}%
10763 \DeclareUnicodeCharacter{0119}{\ogonek{e}}%
10764 \DeclareUnicodeCharacter{011A}{\v{E}}%
10765 \DeclareUnicodeCharacter{011B}{\v{e}}%
10766 \DeclareUnicodeCharacter{011C}{\^G}%
10767 \DeclareUnicodeCharacter{011D}{\^g}%
10768 \DeclareUnicodeCharacter{011E}{\u{G}}%
10769 \DeclareUnicodeCharacter{011F}{\u{g}}%
10771 \DeclareUnicodeCharacter{0120}{\dotaccent{G}}%
10772 \DeclareUnicodeCharacter{0121}{\dotaccent{g}}%
10773 \DeclareUnicodeCharacter{0122}{\cedilla{G}}%
10774 \DeclareUnicodeCharacter{0123}{\cedilla{g}}%
10775 \DeclareUnicodeCharacter{0124}{\^H}%
10776 \DeclareUnicodeCharacter{0125}{\^h}%
10777 \DeclareUnicodeCharacter{0126}{\missingcharmsg{H WITH STROKE}}%
10778 \DeclareUnicodeCharacter{0127}{\missingcharmsg{h WITH STROKE}}%
10779 \DeclareUnicodeCharacter{0128}{\~I}%
10780 \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}}%
10781 \DeclareUnicodeCharacter{012A}{\=I}%
10782 \DeclareUnicodeCharacter{012B}{\={\dotless{i}}}%
10783 \DeclareUnicodeCharacter{012C}{\u{I}}%
10784 \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}}%
10785 \DeclareUnicodeCharacter{012E}{\ogonek{I}}%
10786 \DeclareUnicodeCharacter{012F}{\ogonek{i}}%
10788 \DeclareUnicodeCharacter{0130}{\dotaccent{I}}%
10789 \DeclareUnicodeCharacter{0131}{\dotless{i}}%
10790 \DeclareUnicodeCharacter{0132}{IJ}%
10791 \DeclareUnicodeCharacter{0133}{ij}%
10792 \DeclareUnicodeCharacter{0134}{\^J}%
10793 \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}}%
10794 \DeclareUnicodeCharacter{0136}{\cedilla{K}}%
10795 \DeclareUnicodeCharacter{0137}{\cedilla{k}}%
10796 \DeclareUnicodeCharacter{0138}{\ensuremath\kappa}%
10797 \DeclareUnicodeCharacter{0139}{\'L}%
10798 \DeclareUnicodeCharacter{013A}{\'l}%
10799 \DeclareUnicodeCharacter{013B}{\cedilla{L}}%
10800 \DeclareUnicodeCharacter{013C}{\cedilla{l}}%
10801 \DeclareUnicodeCharacter{013D}{L'}% should kern
10802 \DeclareUnicodeCharacter{013E}{l'}% should kern
10803 \DeclareUnicodeCharacter{013F}{L\U{00B7}}%
10805 \DeclareUnicodeCharacter{0140}{l\U{00B7}}%
10806 \DeclareUnicodeCharacter{0141}{\L}%
10807 \DeclareUnicodeCharacter{0142}{\l}%
10808 \DeclareUnicodeCharacter{0143}{\'N}%
10809 \DeclareUnicodeCharacter{0144}{\'n}%
10810 \DeclareUnicodeCharacter{0145}{\cedilla{N}}%
10811 \DeclareUnicodeCharacter{0146}{\cedilla{n}}%
10812 \DeclareUnicodeCharacter{0147}{\v{N}}%
10813 \DeclareUnicodeCharacter{0148}{\v{n}}%
10814 \DeclareUnicodeCharacter{0149}{'n}%
10815 \DeclareUnicodeCharacter{014A}{\missingcharmsg{ENG}}%
10816 \DeclareUnicodeCharacter{014B}{\missingcharmsg{eng}}%
10817 \DeclareUnicodeCharacter{014C}{\=O}%
10818 \DeclareUnicodeCharacter{014D}{\=o}%
10819 \DeclareUnicodeCharacter{014E}{\u{O}}%
10820 \DeclareUnicodeCharacter{014F}{\u{o}}%
10822 \DeclareUnicodeCharacter{0150}{\H{O}}%
10823 \DeclareUnicodeCharacter{0151}{\H{o}}%
10824 \DeclareUnicodeCharacter{0152}{\OE}%
10825 \DeclareUnicodeCharacter{0153}{\oe}%
10826 \DeclareUnicodeCharacter{0154}{\'R}%
10827 \DeclareUnicodeCharacter{0155}{\'r}%
10828 \DeclareUnicodeCharacter{0156}{\cedilla{R}}%
10829 \DeclareUnicodeCharacter{0157}{\cedilla{r}}%
10830 \DeclareUnicodeCharacter{0158}{\v{R}}%
10831 \DeclareUnicodeCharacter{0159}{\v{r}}%
10832 \DeclareUnicodeCharacter{015A}{\'S}%
10833 \DeclareUnicodeCharacter{015B}{\'s}%
10834 \DeclareUnicodeCharacter{015C}{\^S}%
10835 \DeclareUnicodeCharacter{015D}{\^s}%
10836 \DeclareUnicodeCharacter{015E}{\cedilla{S}}%
10837 \DeclareUnicodeCharacter{015F}{\cedilla{s}}%
10839 \DeclareUnicodeCharacter{0160}{\v{S}}%
10840 \DeclareUnicodeCharacter{0161}{\v{s}}%
10841 \DeclareUnicodeCharacter{0162}{\cedilla{T}}%
10842 \DeclareUnicodeCharacter{0163}{\cedilla{t}}%
10843 \DeclareUnicodeCharacter{0164}{\v{T}}%
10844 \DeclareUnicodeCharacter{0165}{\v{t}}%
10845 \DeclareUnicodeCharacter{0166}{\missingcharmsg{H WITH STROKE}}%
10846 \DeclareUnicodeCharacter{0167}{\missingcharmsg{h WITH STROKE}}%
10847 \DeclareUnicodeCharacter{0168}{\~U}%
10848 \DeclareUnicodeCharacter{0169}{\~u}%
10849 \DeclareUnicodeCharacter{016A}{\=U}%
10850 \DeclareUnicodeCharacter{016B}{\=u}%
10851 \DeclareUnicodeCharacter{016C}{\u{U}}%
10852 \DeclareUnicodeCharacter{016D}{\u{u}}%
10853 \DeclareUnicodeCharacter{016E}{\ringaccent{U}}%
10854 \DeclareUnicodeCharacter{016F}{\ringaccent{u}}%
10856 \DeclareUnicodeCharacter{0170}{\H{U}}%
10857 \DeclareUnicodeCharacter{0171}{\H{u}}%
10858 \DeclareUnicodeCharacter{0172}{\ogonek{U}}%
10859 \DeclareUnicodeCharacter{0173}{\ogonek{u}}%
10860 \DeclareUnicodeCharacter{0174}{\^W}%
10861 \DeclareUnicodeCharacter{0175}{\^w}%
10862 \DeclareUnicodeCharacter{0176}{\^Y}%
10863 \DeclareUnicodeCharacter{0177}{\^y}%
10864 \DeclareUnicodeCharacter{0178}{\"Y}%
10865 \DeclareUnicodeCharacter{0179}{\'Z}%
10866 \DeclareUnicodeCharacter{017A}{\'z}%
10867 \DeclareUnicodeCharacter{017B}{\dotaccent{Z}}%
10868 \DeclareUnicodeCharacter{017C}{\dotaccent{z}}%
10869 \DeclareUnicodeCharacter{017D}{\v{Z}}%
10870 \DeclareUnicodeCharacter{017E}{\v{z}}%
10871 \DeclareUnicodeCharacter{017F}{\missingcharmsg{LONG S}}%
10873 \DeclareUnicodeCharacter{01C4}{D\v{Z}}%
10874 \DeclareUnicodeCharacter{01C5}{D\v{z}}%
10875 \DeclareUnicodeCharacter{01C6}{d\v{z}}%
10876 \DeclareUnicodeCharacter{01C7}{LJ}%
10877 \DeclareUnicodeCharacter{01C8}{Lj}%
10878 \DeclareUnicodeCharacter{01C9}{lj}%
10879 \DeclareUnicodeCharacter{01CA}{NJ}%
10880 \DeclareUnicodeCharacter{01CB}{Nj}%
10881 \DeclareUnicodeCharacter{01CC}{nj}%
10882 \DeclareUnicodeCharacter{01CD}{\v{A}}%
10883 \DeclareUnicodeCharacter{01CE}{\v{a}}%
10884 \DeclareUnicodeCharacter{01CF}{\v{I}}%
10886 \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}}%
10887 \DeclareUnicodeCharacter{01D1}{\v{O}}%
10888 \DeclareUnicodeCharacter{01D2}{\v{o}}%
10889 \DeclareUnicodeCharacter{01D3}{\v{U}}%
10890 \DeclareUnicodeCharacter{01D4}{\v{u}}%
10892 \DeclareUnicodeCharacter{01E2}{\={\AE}}%
10893 \DeclareUnicodeCharacter{01E3}{\={\ae}}%
10894 \DeclareUnicodeCharacter{01E6}{\v{G}}%
10895 \DeclareUnicodeCharacter{01E7}{\v{g}}%
10896 \DeclareUnicodeCharacter{01E8}{\v{K}}%
10897 \DeclareUnicodeCharacter{01E9}{\v{k}}%
10899 \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}}%
10900 \DeclareUnicodeCharacter{01F1}{DZ}%
10901 \DeclareUnicodeCharacter{01F2}{Dz}%
10902 \DeclareUnicodeCharacter{01F3}{dz}%
10903 \DeclareUnicodeCharacter{01F4}{\'G}%
10904 \DeclareUnicodeCharacter{01F5}{\'g}%
10905 \DeclareUnicodeCharacter{01F8}{\`N}%
10906 \DeclareUnicodeCharacter{01F9}{\`n}%
10907 \DeclareUnicodeCharacter{01FC}{\'{\AE}}%
10908 \DeclareUnicodeCharacter{01FD}{\'{\ae}}%
10909 \DeclareUnicodeCharacter{01FE}{\'{\O}}%
10910 \DeclareUnicodeCharacter{01FF}{\'{\o}}%
10912 \DeclareUnicodeCharacter{021E}{\v{H}}%
10913 \DeclareUnicodeCharacter{021F}{\v{h}}%
10915 \DeclareUnicodeCharacter{0226}{\dotaccent{A}}%
10916 \DeclareUnicodeCharacter{0227}{\dotaccent{a}}%
10917 \DeclareUnicodeCharacter{0228}{\cedilla{E}}%
10918 \DeclareUnicodeCharacter{0229}{\cedilla{e}}%
10919 \DeclareUnicodeCharacter{022E}{\dotaccent{O}}%
10920 \DeclareUnicodeCharacter{022F}{\dotaccent{o}}%
10922 \DeclareUnicodeCharacter{0232}{\=Y}%
10923 \DeclareUnicodeCharacter{0233}{\=y}%
10924 \DeclareUnicodeCharacter{0237}{\dotless{j}}%
10926 \DeclareUnicodeCharacter{02BC}{'}%
10928 \DeclareUnicodeCharacter{02DB}{\ogonek{ }}%
10930 % Greek letters upper case
10931 \DeclareUnicodeCharacter{0391}{{\it A}}%
10932 \DeclareUnicodeCharacter{0392}{{\it B}}%
10933 \DeclareUnicodeCharacter{0393}{\ensuremath{\mit\Gamma}}%
10934 \DeclareUnicodeCharacter{0394}{\ensuremath{\mit\Delta}}%
10935 \DeclareUnicodeCharacter{0395}{{\it E}}%
10936 \DeclareUnicodeCharacter{0396}{{\it Z}}%
10937 \DeclareUnicodeCharacter{0397}{{\it H}}%
10938 \DeclareUnicodeCharacter{0398}{\ensuremath{\mit\Theta}}%
10939 \DeclareUnicodeCharacter{0399}{{\it I}}%
10940 \DeclareUnicodeCharacter{039A}{{\it K}}%
10941 \DeclareUnicodeCharacter{039B}{\ensuremath{\mit\Lambda}}%
10942 \DeclareUnicodeCharacter{039C}{{\it M}}%
10943 \DeclareUnicodeCharacter{039D}{{\it N}}%
10944 \DeclareUnicodeCharacter{039E}{\ensuremath{\mit\Xi}}%
10945 \DeclareUnicodeCharacter{039F}{{\it O}}%
10946 \DeclareUnicodeCharacter{03A0}{\ensuremath{\mit\Pi}}%
10947 \DeclareUnicodeCharacter{03A1}{{\it P}}%
10948 %\DeclareUnicodeCharacter{03A2}{} % none - corresponds to final sigma
10949 \DeclareUnicodeCharacter{03A3}{\ensuremath{\mit\Sigma}}%
10950 \DeclareUnicodeCharacter{03A4}{{\it T}}%
10951 \DeclareUnicodeCharacter{03A5}{\ensuremath{\mit\Upsilon}}%
10952 \DeclareUnicodeCharacter{03A6}{\ensuremath{\mit\Phi}}%
10953 \DeclareUnicodeCharacter{03A7}{{\it X}}%
10954 \DeclareUnicodeCharacter{03A8}{\ensuremath{\mit\Psi}}%
10955 \DeclareUnicodeCharacter{03A9}{\ensuremath{\mit\Omega}}%
10957 % Vowels with accents
10958 \DeclareUnicodeCharacter{0390}{\ensuremath{\ddot{\acute\iota}}}%
10959 \DeclareUnicodeCharacter{03AC}{\ensuremath{\acute\alpha}}%
10960 \DeclareUnicodeCharacter{03AD}{\ensuremath{\acute\epsilon}}%
10961 \DeclareUnicodeCharacter{03AE}{\ensuremath{\acute\eta}}%
10962 \DeclareUnicodeCharacter{03AF}{\ensuremath{\acute\iota}}%
10963 \DeclareUnicodeCharacter{03B0}{\ensuremath{\acute{\ddot\upsilon}}}%
10965 % Standalone accent
10966 \DeclareUnicodeCharacter{0384}{\ensuremath{\acute{\ }}}%
10968 % Greek letters lower case
10969 \DeclareUnicodeCharacter{03B1}{\ensuremath\alpha}%
10970 \DeclareUnicodeCharacter{03B2}{\ensuremath\beta}%
10971 \DeclareUnicodeCharacter{03B3}{\ensuremath\gamma}%
10972 \DeclareUnicodeCharacter{03B4}{\ensuremath\delta}%
10973 \DeclareUnicodeCharacter{03B5}{\ensuremath\epsilon}%
10974 \DeclareUnicodeCharacter{03B6}{\ensuremath\zeta}%
10975 \DeclareUnicodeCharacter{03B7}{\ensuremath\eta}%
10976 \DeclareUnicodeCharacter{03B8}{\ensuremath\theta}%
10977 \DeclareUnicodeCharacter{03B9}{\ensuremath\iota}%
10978 \DeclareUnicodeCharacter{03BA}{\ensuremath\kappa}%
10979 \DeclareUnicodeCharacter{03BB}{\ensuremath\lambda}%
10980 \DeclareUnicodeCharacter{03BC}{\ensuremath\mu}%
10981 \DeclareUnicodeCharacter{03BD}{\ensuremath\nu}%
10982 \DeclareUnicodeCharacter{03BE}{\ensuremath\xi}%
10983 \DeclareUnicodeCharacter{03BF}{{\it o}}% omicron
10984 \DeclareUnicodeCharacter{03C0}{\ensuremath\pi}%
10985 \DeclareUnicodeCharacter{03C1}{\ensuremath\rho}%
10986 \DeclareUnicodeCharacter{03C2}{\ensuremath\varsigma}%
10987 \DeclareUnicodeCharacter{03C3}{\ensuremath\sigma}%
10988 \DeclareUnicodeCharacter{03C4}{\ensuremath\tau}%
10989 \DeclareUnicodeCharacter{03C5}{\ensuremath\upsilon}%
10990 \DeclareUnicodeCharacter{03C6}{\ensuremath\phi}%
10991 \DeclareUnicodeCharacter{03C7}{\ensuremath\chi}%
10992 \DeclareUnicodeCharacter{03C8}{\ensuremath\psi}%
10993 \DeclareUnicodeCharacter{03C9}{\ensuremath\omega}%
10995 % More Greek vowels with accents
10996 \DeclareUnicodeCharacter{03CA}{\ensuremath{\ddot\iota}}%
10997 \DeclareUnicodeCharacter{03CB}{\ensuremath{\ddot\upsilon}}%
10998 \DeclareUnicodeCharacter{03CC}{\ensuremath{\acute o}}%
10999 \DeclareUnicodeCharacter{03CD}{\ensuremath{\acute\upsilon}}%
11000 \DeclareUnicodeCharacter{03CE}{\ensuremath{\acute\omega}}%
11002 % Variant Greek letters
11003 \DeclareUnicodeCharacter{03D1}{\ensuremath\vartheta}%
11004 \DeclareUnicodeCharacter{03D6}{\ensuremath\varpi}%
11005 \DeclareUnicodeCharacter{03F1}{\ensuremath\varrho}%
11007 \DeclareUnicodeCharacter{1E02}{\dotaccent{B}}%
11008 \DeclareUnicodeCharacter{1E03}{\dotaccent{b}}%
11009 \DeclareUnicodeCharacter{1E04}{\udotaccent{B}}%
11010 \DeclareUnicodeCharacter{1E05}{\udotaccent{b}}%
11011 \DeclareUnicodeCharacter{1E06}{\ubaraccent{B}}%
11012 \DeclareUnicodeCharacter{1E07}{\ubaraccent{b}}%
11013 \DeclareUnicodeCharacter{1E0A}{\dotaccent{D}}%
11014 \DeclareUnicodeCharacter{1E0B}{\dotaccent{d}}%
11015 \DeclareUnicodeCharacter{1E0C}{\udotaccent{D}}%
11016 \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}}%
11017 \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}}%
11018 \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}}%
11020 \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}}%
11021 \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}}%
11023 \DeclareUnicodeCharacter{1E20}{\=G}%
11024 \DeclareUnicodeCharacter{1E21}{\=g}%
11025 \DeclareUnicodeCharacter{1E22}{\dotaccent{H}}%
11026 \DeclareUnicodeCharacter{1E23}{\dotaccent{h}}%
11027 \DeclareUnicodeCharacter{1E24}{\udotaccent{H}}%
11028 \DeclareUnicodeCharacter{1E25}{\udotaccent{h}}%
11029 \DeclareUnicodeCharacter{1E26}{\"H}%
11030 \DeclareUnicodeCharacter{1E27}{\"h}%
11032 \DeclareUnicodeCharacter{1E30}{\'K}%
11033 \DeclareUnicodeCharacter{1E31}{\'k}%
11034 \DeclareUnicodeCharacter{1E32}{\udotaccent{K}}%
11035 \DeclareUnicodeCharacter{1E33}{\udotaccent{k}}%
11036 \DeclareUnicodeCharacter{1E34}{\ubaraccent{K}}%
11037 \DeclareUnicodeCharacter{1E35}{\ubaraccent{k}}%
11038 \DeclareUnicodeCharacter{1E36}{\udotaccent{L}}%
11039 \DeclareUnicodeCharacter{1E37}{\udotaccent{l}}%
11040 \DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}}%
11041 \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}}%
11042 \DeclareUnicodeCharacter{1E3E}{\'M}%
11043 \DeclareUnicodeCharacter{1E3F}{\'m}%
11045 \DeclareUnicodeCharacter{1E40}{\dotaccent{M}}%
11046 \DeclareUnicodeCharacter{1E41}{\dotaccent{m}}%
11047 \DeclareUnicodeCharacter{1E42}{\udotaccent{M}}%
11048 \DeclareUnicodeCharacter{1E43}{\udotaccent{m}}%
11049 \DeclareUnicodeCharacter{1E44}{\dotaccent{N}}%
11050 \DeclareUnicodeCharacter{1E45}{\dotaccent{n}}%
11051 \DeclareUnicodeCharacter{1E46}{\udotaccent{N}}%
11052 \DeclareUnicodeCharacter{1E47}{\udotaccent{n}}%
11053 \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}}%
11054 \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}}%
11056 \DeclareUnicodeCharacter{1E54}{\'P}%
11057 \DeclareUnicodeCharacter{1E55}{\'p}%
11058 \DeclareUnicodeCharacter{1E56}{\dotaccent{P}}%
11059 \DeclareUnicodeCharacter{1E57}{\dotaccent{p}}%
11060 \DeclareUnicodeCharacter{1E58}{\dotaccent{R}}%
11061 \DeclareUnicodeCharacter{1E59}{\dotaccent{r}}%
11062 \DeclareUnicodeCharacter{1E5A}{\udotaccent{R}}%
11063 \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}}%
11064 \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}}%
11065 \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}}%
11067 \DeclareUnicodeCharacter{1E60}{\dotaccent{S}}%
11068 \DeclareUnicodeCharacter{1E61}{\dotaccent{s}}%
11069 \DeclareUnicodeCharacter{1E62}{\udotaccent{S}}%
11070 \DeclareUnicodeCharacter{1E63}{\udotaccent{s}}%
11071 \DeclareUnicodeCharacter{1E6A}{\dotaccent{T}}%
11072 \DeclareUnicodeCharacter{1E6B}{\dotaccent{t}}%
11073 \DeclareUnicodeCharacter{1E6C}{\udotaccent{T}}%
11074 \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}}%
11075 \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}}%
11076 \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}}%
11078 \DeclareUnicodeCharacter{1E7C}{\~V}%
11079 \DeclareUnicodeCharacter{1E7D}{\~v}%
11080 \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}}%
11081 \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}}%
11083 \DeclareUnicodeCharacter{1E80}{\`W}%
11084 \DeclareUnicodeCharacter{1E81}{\`w}%
11085 \DeclareUnicodeCharacter{1E82}{\'W}%
11086 \DeclareUnicodeCharacter{1E83}{\'w}%
11087 \DeclareUnicodeCharacter{1E84}{\"W}%
11088 \DeclareUnicodeCharacter{1E85}{\"w}%
11089 \DeclareUnicodeCharacter{1E86}{\dotaccent{W}}%
11090 \DeclareUnicodeCharacter{1E87}{\dotaccent{w}}%
11091 \DeclareUnicodeCharacter{1E88}{\udotaccent{W}}%
11092 \DeclareUnicodeCharacter{1E89}{\udotaccent{w}}%
11093 \DeclareUnicodeCharacter{1E8A}{\dotaccent{X}}%
11094 \DeclareUnicodeCharacter{1E8B}{\dotaccent{x}}%
11095 \DeclareUnicodeCharacter{1E8C}{\"X}%
11096 \DeclareUnicodeCharacter{1E8D}{\"x}%
11097 \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}}%
11098 \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}}%
11100 \DeclareUnicodeCharacter{1E90}{\^Z}%
11101 \DeclareUnicodeCharacter{1E91}{\^z}%
11102 \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}}%
11103 \DeclareUnicodeCharacter{1E93}{\udotaccent{z}}%
11104 \DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}}%
11105 \DeclareUnicodeCharacter{1E95}{\ubaraccent{z}}%
11106 \DeclareUnicodeCharacter{1E96}{\ubaraccent{h}}%
11107 \DeclareUnicodeCharacter{1E97}{\"t}%
11108 \DeclareUnicodeCharacter{1E98}{\ringaccent{w}}%
11109 \DeclareUnicodeCharacter{1E99}{\ringaccent{y}}%
11111 \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}}%
11112 \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}}%
11114 \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}}%
11115 \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}}%
11116 \DeclareUnicodeCharacter{1EBC}{\~E}%
11117 \DeclareUnicodeCharacter{1EBD}{\~e}%
11119 \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}}%
11120 \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}}%
11121 \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}}%
11122 \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}}%
11124 \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}}%
11125 \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}}%
11127 \DeclareUnicodeCharacter{1EF2}{\`Y}%
11128 \DeclareUnicodeCharacter{1EF3}{\`y}%
11129 \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}}%
11131 \DeclareUnicodeCharacter{1EF8}{\~Y}%
11132 \DeclareUnicodeCharacter{1EF9}{\~y}%
11134 % Exotic spaces
11135 \DeclareUnicodeCharacter{2007}{\hphantom{0}}%
11137 % Punctuation
11138 \DeclareUnicodeCharacter{2013}{--}%
11139 \DeclareUnicodeCharacter{2014}{---}%
11140 \DeclareUnicodeCharacter{2018}{\quoteleft{}}%
11141 \DeclareUnicodeCharacter{2019}{\quoteright{}}%
11142 \DeclareUnicodeCharacter{201A}{\quotesinglbase{}}%
11143 \DeclareUnicodeCharacter{201C}{\quotedblleft{}}%
11144 \DeclareUnicodeCharacter{201D}{\quotedblright{}}%
11145 \DeclareUnicodeCharacter{201E}{\quotedblbase{}}%
11146 \DeclareUnicodeCharacter{2020}{\ensuremath\dagger}%
11147 \DeclareUnicodeCharacter{2021}{\ensuremath\ddagger}%
11148 \DeclareUnicodeCharacter{2022}{\bullet{}}%
11149 \DeclareUnicodeCharacter{202F}{\thinspace}%
11150 \DeclareUnicodeCharacter{2026}{\dots{}}%
11151 \DeclareUnicodeCharacter{2039}{\guilsinglleft{}}%
11152 \DeclareUnicodeCharacter{203A}{\guilsinglright{}}%
11154 \DeclareUnicodeCharacter{20AC}{\euro{}}%
11156 \DeclareUnicodeCharacter{2192}{\arrow}%
11157 \DeclareUnicodeCharacter{21D2}{\result{}}%
11159 % Mathematical symbols
11160 \DeclareUnicodeCharacter{2200}{\ensuremath\forall}%
11161 \DeclareUnicodeCharacter{2203}{\ensuremath\exists}%
11162 \DeclareUnicodeCharacter{2208}{\ensuremath\in}%
11163 \DeclareUnicodeCharacter{2212}{\minus{}}%
11164 \DeclareUnicodeCharacter{2217}{\ast}%
11165 \DeclareUnicodeCharacter{221E}{\ensuremath\infty}%
11166 \DeclareUnicodeCharacter{2225}{\ensuremath\parallel}%
11167 \DeclareUnicodeCharacter{2227}{\ensuremath\wedge}%
11168 \DeclareUnicodeCharacter{2229}{\ensuremath\cap}%
11169 \DeclareUnicodeCharacter{2261}{\equiv{}}%
11170 \DeclareUnicodeCharacter{2264}{\ensuremath\leq}%
11171 \DeclareUnicodeCharacter{2265}{\ensuremath\geq}%
11172 \DeclareUnicodeCharacter{2282}{\ensuremath\subset}%
11173 \DeclareUnicodeCharacter{2287}{\ensuremath\supseteq}%
11175 \DeclareUnicodeCharacter{2016}{\ensuremath\Vert}%
11176 \DeclareUnicodeCharacter{2032}{\ensuremath\prime}%
11177 \DeclareUnicodeCharacter{210F}{\ensuremath\hbar}%
11178 \DeclareUnicodeCharacter{2111}{\ensuremath\Im}%
11179 \DeclareUnicodeCharacter{2113}{\ensuremath\ell}%
11180 \DeclareUnicodeCharacter{2118}{\ensuremath\wp}%
11181 \DeclareUnicodeCharacter{211C}{\ensuremath\Re}%
11182 \DeclareUnicodeCharacter{2135}{\ensuremath\aleph}%
11183 \DeclareUnicodeCharacter{2190}{\ensuremath\leftarrow}%
11184 \DeclareUnicodeCharacter{2191}{\ensuremath\uparrow}%
11185 \DeclareUnicodeCharacter{2193}{\ensuremath\downarrow}%
11186 \DeclareUnicodeCharacter{2194}{\ensuremath\leftrightarrow}%
11187 \DeclareUnicodeCharacter{2195}{\ensuremath\updownarrow}%
11188 \DeclareUnicodeCharacter{2196}{\ensuremath\nwarrow}%
11189 \DeclareUnicodeCharacter{2197}{\ensuremath\nearrow}%
11190 \DeclareUnicodeCharacter{2198}{\ensuremath\searrow}%
11191 \DeclareUnicodeCharacter{2199}{\ensuremath\swarrow}%
11192 \DeclareUnicodeCharacter{21A6}{\ensuremath\mapsto}%
11193 \DeclareUnicodeCharacter{21A9}{\ensuremath\hookleftarrow}%
11194 \DeclareUnicodeCharacter{21AA}{\ensuremath\hookrightarrow}%
11195 \DeclareUnicodeCharacter{21BC}{\ensuremath\leftharpoonup}%
11196 \DeclareUnicodeCharacter{21BD}{\ensuremath\leftharpoondown}%
11197 \DeclareUnicodeCharacter{21C0}{\ensuremath\rightharpoonup}%
11198 \DeclareUnicodeCharacter{21C1}{\ensuremath\rightharpoondown}%
11199 \DeclareUnicodeCharacter{21CC}{\ensuremath\rightleftharpoons}%
11200 \DeclareUnicodeCharacter{21D0}{\ensuremath\Leftarrow}%
11201 \DeclareUnicodeCharacter{21D1}{\ensuremath\Uparrow}%
11202 \DeclareUnicodeCharacter{21D3}{\ensuremath\Downarrow}%
11203 \DeclareUnicodeCharacter{21D4}{\ensuremath\Leftrightarrow}%
11204 \DeclareUnicodeCharacter{21D5}{\ensuremath\Updownarrow}%
11205 \DeclareUnicodeCharacter{2202}{\ensuremath\partial}%
11206 \DeclareUnicodeCharacter{2205}{\ensuremath\emptyset}%
11207 \DeclareUnicodeCharacter{2207}{\ensuremath\nabla}%
11208 \DeclareUnicodeCharacter{2209}{\ensuremath\notin}%
11209 \DeclareUnicodeCharacter{220B}{\ensuremath\owns}%
11210 \DeclareUnicodeCharacter{220F}{\ensuremath\prod}%
11211 \DeclareUnicodeCharacter{2210}{\ensuremath\coprod}%
11212 \DeclareUnicodeCharacter{2211}{\ensuremath\sum}%
11213 \DeclareUnicodeCharacter{2213}{\ensuremath\mp}%
11214 \DeclareUnicodeCharacter{2218}{\ensuremath\circ}%
11215 \DeclareUnicodeCharacter{221A}{\ensuremath\surd}%
11216 \DeclareUnicodeCharacter{221D}{\ensuremath\propto}%
11217 \DeclareUnicodeCharacter{2220}{\ensuremath\angle}%
11218 \DeclareUnicodeCharacter{2223}{\ensuremath\mid}%
11219 \DeclareUnicodeCharacter{2228}{\ensuremath\vee}%
11220 \DeclareUnicodeCharacter{222A}{\ensuremath\cup}%
11221 \DeclareUnicodeCharacter{222B}{\ensuremath\smallint}%
11222 \DeclareUnicodeCharacter{222E}{\ensuremath\oint}%
11223 \DeclareUnicodeCharacter{223C}{\ensuremath\sim}%
11224 \DeclareUnicodeCharacter{2240}{\ensuremath\wr}%
11225 \DeclareUnicodeCharacter{2243}{\ensuremath\simeq}%
11226 \DeclareUnicodeCharacter{2245}{\ensuremath\cong}%
11227 \DeclareUnicodeCharacter{2248}{\ensuremath\approx}%
11228 \DeclareUnicodeCharacter{224D}{\ensuremath\asymp}%
11229 \DeclareUnicodeCharacter{2250}{\ensuremath\doteq}%
11230 \DeclareUnicodeCharacter{2260}{\ensuremath\neq}%
11231 \DeclareUnicodeCharacter{226A}{\ensuremath\ll}%
11232 \DeclareUnicodeCharacter{226B}{\ensuremath\gg}%
11233 \DeclareUnicodeCharacter{227A}{\ensuremath\prec}%
11234 \DeclareUnicodeCharacter{227B}{\ensuremath\succ}%
11235 \DeclareUnicodeCharacter{2283}{\ensuremath\supset}%
11236 \DeclareUnicodeCharacter{2286}{\ensuremath\subseteq}%
11237 \DeclareUnicodeCharacter{228E}{\ensuremath\uplus}%
11238 \DeclareUnicodeCharacter{2291}{\ensuremath\sqsubseteq}%
11239 \DeclareUnicodeCharacter{2292}{\ensuremath\sqsupseteq}%
11240 \DeclareUnicodeCharacter{2293}{\ensuremath\sqcap}%
11241 \DeclareUnicodeCharacter{2294}{\ensuremath\sqcup}%
11242 \DeclareUnicodeCharacter{2295}{\ensuremath\oplus}%
11243 \DeclareUnicodeCharacter{2296}{\ensuremath\ominus}%
11244 \DeclareUnicodeCharacter{2297}{\ensuremath\otimes}%
11245 \DeclareUnicodeCharacter{2298}{\ensuremath\oslash}%
11246 \DeclareUnicodeCharacter{2299}{\ensuremath\odot}%
11247 \DeclareUnicodeCharacter{22A2}{\ensuremath\vdash}%
11248 \DeclareUnicodeCharacter{22A3}{\ensuremath\dashv}%
11249 \DeclareUnicodeCharacter{22A4}{\ensuremath\ptextop}%
11250 \DeclareUnicodeCharacter{22A5}{\ensuremath\bot}%
11251 \DeclareUnicodeCharacter{22A8}{\ensuremath\models}%
11252 \DeclareUnicodeCharacter{22C0}{\ensuremath\bigwedge}%
11253 \DeclareUnicodeCharacter{22C1}{\ensuremath\bigvee}%
11254 \DeclareUnicodeCharacter{22C2}{\ensuremath\bigcap}%
11255 \DeclareUnicodeCharacter{22C3}{\ensuremath\bigcup}%
11256 \DeclareUnicodeCharacter{22C4}{\ensuremath\diamond}%
11257 \DeclareUnicodeCharacter{22C5}{\ensuremath\cdot}%
11258 \DeclareUnicodeCharacter{22C6}{\ensuremath\star}%
11259 \DeclareUnicodeCharacter{22C8}{\ensuremath\bowtie}%
11260 \DeclareUnicodeCharacter{2308}{\ensuremath\lceil}%
11261 \DeclareUnicodeCharacter{2309}{\ensuremath\rceil}%
11262 \DeclareUnicodeCharacter{230A}{\ensuremath\lfloor}%
11263 \DeclareUnicodeCharacter{230B}{\ensuremath\rfloor}%
11264 \DeclareUnicodeCharacter{2322}{\ensuremath\frown}%
11265 \DeclareUnicodeCharacter{2323}{\ensuremath\smile}%
11267 \DeclareUnicodeCharacter{25B3}{\ensuremath\triangle}%
11268 \DeclareUnicodeCharacter{25B7}{\ensuremath\triangleright}%
11269 \DeclareUnicodeCharacter{25BD}{\ensuremath\bigtriangledown}%
11270 \DeclareUnicodeCharacter{25C1}{\ensuremath\triangleleft}%
11271 \DeclareUnicodeCharacter{25C7}{\ensuremath\diamond}%
11272 \DeclareUnicodeCharacter{2660}{\ensuremath\spadesuit}%
11273 \DeclareUnicodeCharacter{2661}{\ensuremath\heartsuit}%
11274 \DeclareUnicodeCharacter{2662}{\ensuremath\diamondsuit}%
11275 \DeclareUnicodeCharacter{2663}{\ensuremath\clubsuit}%
11276 \DeclareUnicodeCharacter{266D}{\ensuremath\flat}%
11277 \DeclareUnicodeCharacter{266E}{\ensuremath\natural}%
11278 \DeclareUnicodeCharacter{266F}{\ensuremath\sharp}%
11279 \DeclareUnicodeCharacter{26AA}{\ensuremath\bigcirc}%
11280 \DeclareUnicodeCharacter{27B9}{\ensuremath\rangle}%
11281 \DeclareUnicodeCharacter{27C2}{\ensuremath\perp}%
11282 \DeclareUnicodeCharacter{27E8}{\ensuremath\langle}%
11283 \DeclareUnicodeCharacter{27F5}{\ensuremath\longleftarrow}%
11284 \DeclareUnicodeCharacter{27F6}{\ensuremath\longrightarrow}%
11285 \DeclareUnicodeCharacter{27F7}{\ensuremath\longleftrightarrow}%
11286 \DeclareUnicodeCharacter{27FC}{\ensuremath\longmapsto}%
11287 \DeclareUnicodeCharacter{29F5}{\ensuremath\setminus}%
11288 \DeclareUnicodeCharacter{2A00}{\ensuremath\bigodot}%
11289 \DeclareUnicodeCharacter{2A01}{\ensuremath\bigoplus}%
11290 \DeclareUnicodeCharacter{2A02}{\ensuremath\bigotimes}%
11291 \DeclareUnicodeCharacter{2A04}{\ensuremath\biguplus}%
11292 \DeclareUnicodeCharacter{2A06}{\ensuremath\bigsqcup}%
11293 \DeclareUnicodeCharacter{2A3F}{\ensuremath\amalg}%
11294 \DeclareUnicodeCharacter{2AAF}{\ensuremath\preceq}%
11295 \DeclareUnicodeCharacter{2AB0}{\ensuremath\succeq}%
11297 \global\mathchardef\checkmark="1370% actually the square root sign
11298 \DeclareUnicodeCharacter{2713}{\ensuremath\checkmark}%
11299 }% end of \unicodechardefs
11301 % UTF-8 byte sequence (pdfTeX) definitions (replacing and @U command)
11302 % It makes the setting that replace UTF-8 byte sequence.
11303 \def\utfeightchardefs{%
11304 \let\DeclareUnicodeCharacter\DeclareUnicodeCharacterUTFviii
11305 \unicodechardefs
11308 % Whether the active definitions of non-ASCII characters expand to
11309 % non-active tokens with the same character code. This is used to
11310 % write characters literally, instead of using active definitions for
11311 % printing the correct glyphs.
11312 \newif\ifpassthroughchars
11313 \passthroughcharsfalse
11315 % For native Unicode handling (XeTeX and LuaTeX),
11316 % provide a definition macro to replace/pass-through a Unicode character
11318 \def\DeclareUnicodeCharacterNative#1#2{%
11319 \ifnum"#1>"7F % only make non-ASCII chars active
11320 \catcode"#1=\active
11321 \def\dodeclareunicodecharacternative##1##2##3{%
11322 \begingroup
11323 \uccode`\~="##2\relax
11324 \uppercase{\gdef~}{%
11325 \ifpassthroughchars
11326 ##1%
11327 \else
11328 ##3%
11331 \endgroup
11333 \begingroup
11334 \uccode`\.="#1\relax
11335 \uppercase{\def\UTFNativeTmp{.}}%
11336 \expandafter\dodeclareunicodecharacternative\UTFNativeTmp{#1}{#2}%
11337 \endgroup
11341 % Native Unicode handling (XeTeX and LuaTeX) character replacing definition.
11342 % It activates the setting that replaces Unicode characters.
11343 \def\nativeunicodechardefs{%
11344 \let\DeclareUnicodeCharacter\DeclareUnicodeCharacterNative
11345 \unicodechardefs
11348 % For native Unicode handling (XeTeX and LuaTeX),
11349 % make the character token expand
11350 % to the sequences given in \unicodechardefs for printing.
11351 \def\DeclareUnicodeCharacterNativeAtU#1#2{%
11352 \def\UTFAtUTmp{#2}
11353 \expandafter\globallet\csname uni:#1\endcsname \UTFAtUTmp
11356 % @U command definitions for native Unicode handling (XeTeX and LuaTeX).
11357 \def\nativeunicodechardefsatu{%
11358 \let\DeclareUnicodeCharacter\DeclareUnicodeCharacterNativeAtU
11359 \unicodechardefs
11362 % US-ASCII character definitions.
11363 \def\asciichardefs{% nothing need be done
11364 \relax
11367 % Define all Unicode characters we know about
11368 \iftxinativeunicodecapable
11369 \nativeunicodechardefsatu
11370 \else
11371 \utfeightchardefs
11375 \message{formatting,}
11377 \newdimen\defaultparindent \defaultparindent = 15pt
11379 \chapheadingskip = 15pt plus 4pt minus 2pt
11380 \secheadingskip = 12pt plus 3pt minus 2pt
11381 \subsecheadingskip = 9pt plus 2pt minus 2pt
11383 % Prevent underfull vbox error messages.
11384 \vbadness = 10000
11386 % Don't be very finicky about underfull hboxes, either.
11387 \hbadness = 6666
11389 % Following George Bush, get rid of widows and orphans.
11390 \widowpenalty=10000
11391 \clubpenalty=10000
11393 % Use TeX 3.0's \emergencystretch to help line breaking, but if we're
11394 % using an old version of TeX, don't do anything. We want the amount of
11395 % stretch added to depend on the line length, hence the dependence on
11396 % \hsize. We call this whenever the paper size is set.
11398 \def\setemergencystretch{%
11399 \ifx\emergencystretch\thisisundefined
11400 % Allow us to assign to \emergencystretch anyway.
11401 \def\emergencystretch{\dimen0}%
11402 \else
11403 \emergencystretch = .15\hsize
11407 % Parameters in order: 1) textheight; 2) textwidth;
11408 % 3) voffset; 4) hoffset; 5) binding offset; 6) topskip;
11409 % 7) physical page height; 8) physical page width.
11411 % We also call \setleading{\textleading}, so the caller should define
11412 % \textleading. The caller should also set \parskip.
11414 \def\internalpagesizes#1#2#3#4#5#6#7#8{%
11415 \voffset = #3\relax
11416 \topskip = #6\relax
11417 \splittopskip = \topskip
11419 \vsize = #1\relax
11420 \advance\vsize by \topskip
11421 \txipageheight = \vsize
11423 \hsize = #2\relax
11424 \txipagewidth = \hsize
11426 \normaloffset = #4\relax
11427 \bindingoffset = #5\relax
11429 \ifpdf
11430 \pdfpageheight #7\relax
11431 \pdfpagewidth #8\relax
11432 % if we don't reset these, they will remain at "1 true in" of
11433 % whatever layout pdftex was dumped with.
11434 \pdfhorigin = 1 true in
11435 \pdfvorigin = 1 true in
11436 \else
11437 \ifx\XeTeXrevision\thisisundefined
11438 \special{papersize=#8,#7}%
11439 \else
11440 \pdfpageheight #7\relax
11441 \pdfpagewidth #8\relax
11442 % XeTeX does not have \pdfhorigin and \pdfvorigin.
11446 \setleading{\textleading}
11448 \parindent = \defaultparindent
11449 \setemergencystretch
11452 % @letterpaper (the default).
11453 \def\letterpaper{{\globaldefs = 1
11454 \parskip = 3pt plus 2pt minus 1pt
11455 \textleading = 13.2pt
11457 % If page is nothing but text, make it come out even.
11458 \internalpagesizes{607.2pt}{6in}% that's 46 lines
11459 {\voffset}{.25in}%
11460 {\bindingoffset}{36pt}%
11461 {11in}{8.5in}%
11464 % Use @smallbook to reset parameters for 7x9.25 trim size.
11465 \def\smallbook{{\globaldefs = 1
11466 \parskip = 2pt plus 1pt
11467 \textleading = 12pt
11469 \internalpagesizes{7.5in}{5in}%
11470 {-.2in}{0in}%
11471 {\bindingoffset}{16pt}%
11472 {9.25in}{7in}%
11474 \lispnarrowing = 0.3in
11475 \tolerance = 700
11476 \contentsrightmargin = 0pt
11477 \defbodyindent = .5cm
11480 % Use @afourpaper to print on European A4 paper.
11481 \def\afourpaper{{\globaldefs = 1
11482 \parskip = 3pt plus 2pt minus 1pt
11483 \textleading = 13.2pt
11485 % Double-side printing via postscript on Laserjet 4050
11486 % prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm.
11487 % To change the settings for a different printer or situation, adjust
11488 % \normaloffset until the front-side and back-side texts align. Then
11489 % do the same for \bindingoffset. You can set these for testing in
11490 % your texinfo source file like this:
11491 % @tex
11492 % \global\normaloffset = -6mm
11493 % \global\bindingoffset = 10mm
11494 % @end tex
11495 \internalpagesizes{673.2pt}{160mm}% that's 51 lines
11496 {\voffset}{\hoffset}%
11497 {\bindingoffset}{44pt}%
11498 {297mm}{210mm}%
11500 \tolerance = 700
11501 \contentsrightmargin = 0pt
11502 \defbodyindent = 5mm
11505 % Use @afivepaper to print on European A5 paper.
11506 % From romildo@urano.iceb.ufop.br, 2 July 2000.
11507 % He also recommends making @example and @lisp be small.
11508 \def\afivepaper{{\globaldefs = 1
11509 \parskip = 2pt plus 1pt minus 0.1pt
11510 \textleading = 12.5pt
11512 \internalpagesizes{160mm}{120mm}%
11513 {\voffset}{-11.4mm}%
11514 {\bindingoffset}{8pt}%
11515 {210mm}{148mm}%
11517 \lispnarrowing = 0.2in
11518 \tolerance = 800
11519 \contentsrightmargin = 0pt
11520 \defbodyindent = 2mm
11521 \tableindent = 12mm
11524 % A specific text layout, 24x15cm overall, intended for A4 paper.
11525 \def\afourlatex{{\globaldefs = 1
11526 \afourpaper
11527 \internalpagesizes{237mm}{150mm}%
11528 {\voffset}{4.6mm}%
11529 {\bindingoffset}{7mm}%
11530 {297mm}{210mm}%
11532 % Must explicitly reset to 0 because we call \afourpaper.
11533 \globaldefs = 0
11536 % Use @afourwide to print on A4 paper in landscape format.
11537 \def\afourwide{{\globaldefs = 1
11538 \afourpaper
11539 \internalpagesizes{241mm}{165mm}%
11540 {\voffset}{-2.95mm}%
11541 {\bindingoffset}{7mm}%
11542 {297mm}{210mm}%
11543 \globaldefs = 0
11546 \def\bsixpaper{{\globaldefs = 1
11547 \afourpaper
11548 \internalpagesizes{140mm}{100mm}%
11549 {-6.35mm}{-12.7mm}%
11550 {\bindingoffset}{14pt}%
11551 {176mm}{125mm}%
11552 \let\SETdispenvsize=\smallword
11553 \lispnarrowing = 0.2in
11554 \globaldefs = 0
11558 % @pagesizes TEXTHEIGHT[,TEXTWIDTH]
11559 % Perhaps we should allow setting the margins, \topskip, \parskip,
11560 % and/or leading, also. Or perhaps we should compute them somehow.
11562 \parseargdef\pagesizes{\pagesizesyyy #1,,\finish}
11563 \def\pagesizesyyy#1,#2,#3\finish{{%
11564 \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi
11565 \globaldefs = 1
11567 \parskip = 3pt plus 2pt minus 1pt
11568 \setleading{\textleading}%
11570 \dimen0 = #1\relax
11571 \advance\dimen0 by 2.5in % default 1in margin above heading line
11572 % and 1.5in to include heading, footing and
11573 % bottom margin
11575 \dimen2 = \hsize
11576 \advance\dimen2 by 2in % default to 1 inch margin on each side
11578 \internalpagesizes{#1}{\hsize}%
11579 {\voffset}{\normaloffset}%
11580 {\bindingoffset}{44pt}%
11581 {\dimen0}{\dimen2}%
11584 % Set default to letter.
11586 \letterpaper
11588 % Default value of \hfuzz, for suppressing warnings about overfull hboxes.
11589 \hfuzz = 1pt
11592 \message{microtype,}
11594 % protrusion, from Thanh's protcode.tex.
11595 \def\mtsetprotcode#1{%
11596 \rpcode#1`\!=200 \rpcode#1`\,=700 \rpcode#1`\-=700 \rpcode#1`\.=700
11597 \rpcode#1`\;=500 \rpcode#1`\:=500 \rpcode#1`\?=200
11598 \rpcode#1`\'=700
11599 \rpcode#1 34=500 % ''
11600 \rpcode#1 123=300 % --
11601 \rpcode#1 124=200 % ---
11602 \rpcode#1`\)=50 \rpcode#1`\A=50 \rpcode#1`\F=50 \rpcode#1`\K=50
11603 \rpcode#1`\L=50 \rpcode#1`\T=50 \rpcode#1`\V=50 \rpcode#1`\W=50
11604 \rpcode#1`\X=50 \rpcode#1`\Y=50 \rpcode#1`\k=50 \rpcode#1`\r=50
11605 \rpcode#1`\t=50 \rpcode#1`\v=50 \rpcode#1`\w=50 \rpcode#1`\x=50
11606 \rpcode#1`\y=50
11608 \lpcode#1`\`=700
11609 \lpcode#1 92=500 % ``
11610 \lpcode#1`\(=50 \lpcode#1`\A=50 \lpcode#1`\J=50 \lpcode#1`\T=50
11611 \lpcode#1`\V=50 \lpcode#1`\W=50 \lpcode#1`\X=50 \lpcode#1`\Y=50
11612 \lpcode#1`\v=50 \lpcode#1`\w=50 \lpcode#1`\x=50 \lpcode#1`\y=0
11614 \mtadjustprotcode#1\relax
11617 \newcount\countC
11618 \def\mtadjustprotcode#1{%
11619 \countC=0
11620 \loop
11621 \ifcase\lpcode#1\countC\else
11622 \mtadjustcp\lpcode#1\countC
11624 \ifcase\rpcode#1\countC\else
11625 \mtadjustcp\rpcode#1\countC
11627 \advance\countC 1
11628 \ifnum\countC < 256 \repeat
11631 \newcount\countB
11632 \def\mtadjustcp#1#2#3{%
11633 \setbox\boxA=\hbox{%
11634 \ifx#2\font\else#2\fi
11635 \char#3}%
11636 \countB=\wd\boxA
11637 \multiply\countB #1#2#3\relax
11638 \divide\countB \fontdimen6 #2\relax
11639 #1#2#3=\countB\relax
11642 \ifx\XeTeXrevision\thisisundefined
11643 \ifx\luatexversion\thisisundefined
11644 \ifpdf % pdfTeX
11645 \mtsetprotcode\textrm
11646 \def\mtfontexpand#1{\pdffontexpand#1 20 20 1 autoexpand\relax}
11647 \else % TeX
11648 \def\mtfontexpand#1{}
11650 \else % LuaTeX
11651 \mtsetprotcode\textrm
11652 \def\mtfontexpand#1{\expandglyphsinfont#1 20 20 1\relax}
11654 \else % XeTeX
11655 \mtsetprotcode\textrm
11656 \def\mtfontexpand#1{}
11660 \newif\ifmicrotype
11662 \def\microtypeON{%
11663 \microtypetrue
11665 \ifx\XeTeXrevision\thisisundefined
11666 \ifx\luatexversion\thisisundefined
11667 \ifpdf % pdfTeX
11668 \pdfadjustspacing=2
11669 \pdfprotrudechars=2
11671 \else % LuaTeX
11672 \adjustspacing=2
11673 \protrudechars=2
11675 \else % XeTeX
11676 \XeTeXprotrudechars=2
11679 \mtfontexpand\textrm
11680 \mtfontexpand\textsl
11681 \mtfontexpand\textbf
11684 \def\microtypeOFF{%
11685 \microtypefalse
11687 \ifx\XeTeXrevision\thisisundefined
11688 \ifx\luatexversion\thisisundefined
11689 \ifpdf % pdfTeX
11690 \pdfadjustspacing=0
11691 \pdfprotrudechars=0
11693 \else % LuaTeX
11694 \adjustspacing=0
11695 \protrudechars=0
11697 \else % XeTeX
11698 \XeTeXprotrudechars=0
11702 \microtypeOFF
11704 \parseargdef\microtype{%
11705 \def\txiarg{#1}%
11706 \ifx\txiarg\onword
11707 \microtypeON
11708 \else\ifx\txiarg\offword
11709 \microtypeOFF
11710 \else
11711 \errhelp = \EMsimple
11712 \errmessage{Unknown @microtype option `\txiarg', must be on|off}%
11713 \fi\fi
11717 \message{and turning on texinfo input format.}
11719 % Make UTF-8 the default encoding.
11720 \documentencodingzzz{UTF-8}
11722 \def^^L{\par} % remove \outer, so ^L can appear in an @comment
11723 \catcode`\^^K = 10 % treat vertical tab as whitespace
11725 % DEL is a comment character, in case @c does not suffice.
11726 \catcode`\^^? = 14
11728 % Define macros to output various characters with catcode for normal text.
11729 \catcode`\"=\other \def\normaldoublequote{"}
11730 \catcode`\$=\other \def\normaldollar{$}%$ font-lock fix
11731 \catcode`\+=\other \def\normalplus{+}
11732 \catcode`\<=\other \def\normalless{<}
11733 \catcode`\>=\other \def\normalgreater{>}
11734 \catcode`\^=\other \def\normalcaret{^}
11735 \catcode`\_=\other \def\normalunderscore{_}
11736 \catcode`\|=\other \def\normalverticalbar{|}
11737 \catcode`\~=\other \def\normaltilde{~}
11739 % Set catcodes for Texinfo file
11741 % Active characters for printing the wanted glyph.
11742 % Most of these we simply print from the \tt font, but for some, we can
11743 % use math or other variants that look better in normal text.
11745 \catcode`\"=\active
11746 \def\activedoublequote{{\tt\char34}}
11747 \let"=\activedoublequote
11748 \catcode`\~=\active \def\activetilde{{\tt\char126}} \let~ = \activetilde
11749 \chardef\hatchar=`\^
11750 \catcode`\^=\active \def\activehat{{\tt \hatchar}} \let^ = \activehat
11752 \catcode`\_=\active
11753 \def_{\ifusingtt\normalunderscore\_}
11754 \def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em }
11755 \let\realunder=_
11757 \catcode`\|=\active \def|{{\tt\char124}}
11759 \chardef \less=`\<
11760 \catcode`\<=\active \def\activeless{{\tt \less}}\let< = \activeless
11761 \chardef \gtr=`\>
11762 \catcode`\>=\active \def\activegtr{{\tt \gtr}}\let> = \activegtr
11763 \catcode`\+=\active \def+{{\tt \char 43}}
11764 \catcode`\$=\active \def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix
11765 \catcode`\-=\active \let-=\normaldash
11768 % used for headline/footline in the output routine, in case the page
11769 % breaks in the middle of an @tex block.
11770 \def\texinfochars{%
11771 \let< = \activeless
11772 \let> = \activegtr
11773 \let~ = \activetilde
11774 \let^ = \activehat
11775 \setregularquotes
11776 \let\b = \strong
11777 \let\i = \smartitalic
11778 % in principle, all other definitions in \tex have to be undone too.
11781 % Used sometimes to turn off (effectively) the active characters even after
11782 % parsing them.
11783 \def\turnoffactive{%
11784 \passthroughcharstrue
11785 \let-=\normaldash
11786 \let"=\normaldoublequote
11787 \let$=\normaldollar %$ font-lock fix
11788 \let+=\normalplus
11789 \let<=\normalless
11790 \let>=\normalgreater
11791 \let^=\normalcaret
11792 \let_=\normalunderscore
11793 \let|=\normalverticalbar
11794 \let~=\normaltilde
11795 \otherbackslash
11796 \setregularquotes
11797 \unsepspaces
11800 % If a .fmt file is being used, characters that might appear in a file
11801 % name cannot be active until we have parsed the command line.
11802 % So turn them off again, and have \loadconf turn them back on.
11803 \catcode`+=\other \catcode`\_=\other
11806 % \backslashcurfont outputs one backslash character in current font,
11807 % as in \char`\\.
11808 \global\chardef\backslashcurfont=`\\
11810 % Print a typewriter backslash. For math mode, we can't simply use
11811 % \backslashcurfont: the story here is that in math mode, the \char
11812 % of \backslashcurfont ends up printing the roman \ from the math symbol
11813 % font (because \char in math mode uses the \mathcode, and plain.tex
11814 % sets \mathcode`\\="026E). Hence we use an explicit \mathchar,
11815 % which is the decimal equivalent of "715c (class 7, e.g., use \fam;
11816 % ignored family value; char position "5C). We can't use " for the
11817 % usual hex value because it has already been made active.
11819 \def\ttbackslash{{\tt \ifmmode \mathchar29020 \else \backslashcurfont \fi}}
11820 \let\backslashchar = \ttbackslash % \backslashchar{} is for user documents.
11822 % These are made active for url-breaking, so need
11823 % active definitions as the normal characters.
11824 \def\normaldot{.}
11825 \def\normalquest{?}
11826 \def\normalslash{/}
11828 % \newlinesloadsconf - call \loadconf as soon as possible in the
11829 % file, e.g. at the first newline.
11831 {\catcode`\^=7
11832 \catcode`\^^M=13
11833 \gdef\newlineloadsconf{%
11834 \catcode`\^^M=13 %
11835 \newlineloadsconfzz%
11837 \gdef\newlineloadsconfzz#1^^M{%
11838 \def\c{\loadconf\c}%
11839 % Definition for the first newline read in the file
11840 \def ^^M{\loadconf}%
11841 % In case the first line has a whole-line or environment command on it
11842 \let\originalparsearg\parsearg%
11843 \def\parsearg{\loadconf\originalparsearg}%
11845 % \startenvironment is in the expansion of commands defined with \envdef
11846 \let\originalstartenvironment\startenvironment%
11847 \def\startenvironment{\loadconf\startenvironment}%
11851 % Emergency active definition of newline, in case an active newline token
11852 % appears by mistake.
11853 {\catcode`\^=7 \catcode13=13%
11854 \gdef\enableemergencynewline{%
11855 \gdef^^M{%
11856 \par%
11857 %<warning: active newline>\par%
11861 % \loadconf gets called at the beginning of every Texinfo file.
11862 % If texinfo.cnf is present on the system, read it. Useful for site-wide
11863 % @afourpaper, etc. Not opening texinfo.cnf directly in texinfo.tex
11864 % makes it possible to make a format file for Texinfo.
11866 \gdef\loadconf{%
11867 \relax % Terminate the filename if running as "tex '&texinfo' FILE.texi".
11869 % Turn off the definitions that trigger \loadconf
11870 \everyjobreset
11871 \catcode13=5 % regular end of line
11872 \enableemergencynewline
11873 \let\c=\comment
11874 \let\parsearg\originalparsearg
11875 \let\startenvironment\originalstartenvironment
11877 % Also turn back on active characters that might appear in the input
11878 % file name, in case not using a pre-dumped format.
11879 \catcode`+=\active
11880 \catcode`\_=\active
11882 \openin 1 texinfo.cnf
11883 \ifeof 1 \else \input texinfo.cnf \fi
11884 \closein 1
11887 % Redefine some control sequences to be controlled by the \ifdummies
11888 % and \ifindexnofonts switches. Do this at the end so that the control
11889 % sequences are all defined.
11890 \definedummies
11895 \catcode`\@=0
11897 % \realbackslash is an actual character `\' with catcode other.
11898 {\catcode`\\=\other @gdef@realbackslash{\}}
11900 % In Texinfo, backslash is an active character; it prints the backslash
11901 % in fixed width font.
11902 \catcode`\\=\active % @ for escape char from now on.
11904 @let\ = @ttbackslash
11906 % If in a .fmt file, print the version number.
11907 % \eatinput stops the `\input texinfo' from showing up.
11908 % After that, `\' should revert to printing a backslash.
11909 % Turn on active characters that we couldn't do earlier because
11910 % they might have appeared in the input file name.
11912 @everyjob{@message{[Texinfo version @texinfoversion]}%
11913 @global@let\ = @eatinput
11914 @catcode`+=@active @catcode`@_=@active}
11916 {@catcode`@^=7 @catcode`@^^M=13%
11917 @gdef@eatinput input texinfo#1^^M{@loadconf}}
11919 @def@everyjobreset{@ifx\@eatinput @let\ = @ttbackslash @fi}
11921 % \otherbackslash defines an active \ to be a literal `\' character with
11922 % catcode other.
11923 @gdef@otherbackslash{@let\=@realbackslash}
11925 % Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
11926 % the literal character `\'.
11928 {@catcode`- = @active
11929 @gdef@normalturnoffactive{%
11930 @turnoffactive
11931 @let\=@ttbackslash
11935 % Say @foo, not \foo, in error messages.
11936 @escapechar = `@@
11938 % These look ok in all fonts, so just make them not special.
11939 % @hashchar{} gets its own user-level command, because of #line.
11940 @catcode`@& = @other @def@normalamp{&}
11941 @catcode`@# = @other @def@normalhash{#}
11942 @catcode`@% = @other @def@normalpercent{%}
11944 @let @hashchar = @normalhash
11946 @c Finally, make ` and ' active, so that txicodequoteundirected and
11947 @c txicodequotebacktick work right in, e.g., @w{@code{`foo'}}. If we
11948 @c don't make ` and ' active, @code will not get them as active chars.
11949 @c Do this last of all since we use ` in the previous @catcode assignments.
11950 @catcode`@'=@active
11951 @catcode`@`=@active
11953 @c Local variables:
11954 @c eval: (add-hook 'before-save-hook 'time-stamp nil t)
11955 @c time-stamp-pattern: "texinfoversion{%Y-%02m-%02d.%02H}"
11956 @c page-delimiter: "^\\\\message"
11957 @c End:
11959 @newlineloadsconf