sync with experimental
[luatex.git] / source / build-aux / texinfo.tex
blob8416bbaed626326ea363d18608ea0a4d47b2d318
1 % texinfo.tex -- TeX macros to handle Texinfo files.
2 %
3 % Load plain if necessary, i.e., if running under initex.
4 \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
6 \def\texinfoversion{2016-02-22.15}
8 % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
9 % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
10 % 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
11 % Free Software Foundation, Inc.
13 % This texinfo.tex file is free software: you can redistribute it and/or
14 % modify it under the terms of the GNU General Public License as
15 % published by the Free Software Foundation, either version 3 of the
16 % License, or (at your option) any later version.
18 % This texinfo.tex file is distributed in the hope that it will be
19 % useful, but WITHOUT ANY WARRANTY; without even the implied warranty
20 % of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 % General Public License for more details.
23 % You should have received a copy of the GNU General Public License
24 % along with this program. If not, see <http://www.gnu.org/licenses/>.
26 % As a special exception, when this file is read by TeX when processing
27 % a Texinfo source document, you may use the result without
28 % restriction. This Exception is an additional permission under section 7
29 % of the GNU General Public License, version 3 ("GPLv3").
31 % Please try the latest version of texinfo.tex before submitting bug
32 % reports; you can get the latest version from:
33 % http://ftp.gnu.org/gnu/texinfo/ (the Texinfo release area), or
34 % http://ftpmirror.gnu.org/texinfo/ (same, via a mirror), or
35 % http://www.gnu.org/software/texinfo/ (the Texinfo home page)
36 % The texinfo.tex in any given distribution could well be out
37 % of date, so if that's what you're using, please check.
39 % Send bug reports to bug-texinfo@gnu.org. Please include including a
40 % complete document in each bug report with which we can reproduce the
41 % problem. Patches are, of course, greatly appreciated.
43 % To process a Texinfo manual with TeX, it's most reliable to use the
44 % texi2dvi shell script that comes with the distribution. For a simple
45 % manual foo.texi, however, you can get away with this:
46 % tex foo.texi
47 % texindex foo.??
48 % tex foo.texi
49 % tex foo.texi
50 % dvips foo.dvi -o # or whatever; this makes foo.ps.
51 % The extra TeX runs get the cross-reference information correct.
52 % Sometimes one run after texindex suffices, and sometimes you need more
53 % than two; texi2dvi does it as many times as necessary.
55 % It is possible to adapt texinfo.tex for other languages, to some
56 % extent. You can get the existing language-specific files from the
57 % full Texinfo distribution.
59 % The GNU Texinfo home page is http://www.gnu.org/software/texinfo.
62 \message{Loading texinfo [version \texinfoversion]:}
64 % If in a .fmt file, print the version number
65 % and turn on active characters that we couldn't do earlier because
66 % they might have appeared in the input file name.
67 \everyjob{\message{[Texinfo version \texinfoversion]}%
68 \catcode`+=\active \catcode`\_=\active}
70 \chardef\other=12
72 % We never want plain's \outer definition of \+ in Texinfo.
73 % For @tex, we can use \tabalign.
74 \let\+ = \relax
76 % Save some plain tex macros whose names we will redefine.
77 \let\ptexb=\b
78 \let\ptexbullet=\bullet
79 \let\ptexc=\c
80 \let\ptexcomma=\,
81 \let\ptexdot=\.
82 \let\ptexdots=\dots
83 \let\ptexend=\end
84 \let\ptexequiv=\equiv
85 \let\ptexexclam=\!
86 \let\ptexfootnote=\footnote
87 \let\ptexgtr=>
88 \let\ptexhat=^
89 \let\ptexi=\i
90 \let\ptexindent=\indent
91 \let\ptexinsert=\insert
92 \let\ptexlbrace=\{
93 \let\ptexless=<
94 \let\ptexnewwrite\newwrite
95 \let\ptexnoindent=\noindent
96 \let\ptexplus=+
97 \let\ptexraggedright=\raggedright
98 \let\ptexrbrace=\}
99 \let\ptexslash=\/
100 \let\ptexsp=\sp
101 \let\ptexstar=\*
102 \let\ptexsup=\sup
103 \let\ptext=\t
104 \let\ptextop=\top
105 {\catcode`\'=\active \global\let\ptexquoteright'}% active in plain's math mode
107 % If this character appears in an error message or help string, it
108 % starts a new line in the output.
109 \newlinechar = `^^J
111 % Use TeX 3.0's \inputlineno to get the line number, for better error
112 % messages, but if we're using an old version of TeX, don't do anything.
114 \ifx\inputlineno\thisisundefined
115 \let\linenumber = \empty % Pre-3.0.
116 \else
117 \def\linenumber{l.\the\inputlineno:\space}
120 % Set up fixed words for English if not already set.
121 \ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi
122 \ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi
123 \ifx\putworderror\undefined \gdef\putworderror{error}\fi
124 \ifx\putwordfile\undefined \gdef\putwordfile{file}\fi
125 \ifx\putwordin\undefined \gdef\putwordin{in}\fi
126 \ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi
127 \ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi
128 \ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi
129 \ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi
130 \ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi
131 \ifx\putwordNoTitle\undefined \gdef\putwordNoTitle{No Title}\fi
132 \ifx\putwordof\undefined \gdef\putwordof{of}\fi
133 \ifx\putwordon\undefined \gdef\putwordon{on}\fi
134 \ifx\putwordpage\undefined \gdef\putwordpage{page}\fi
135 \ifx\putwordsection\undefined \gdef\putwordsection{section}\fi
136 \ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi
137 \ifx\putwordsee\undefined \gdef\putwordsee{see}\fi
138 \ifx\putwordSee\undefined \gdef\putwordSee{See}\fi
139 \ifx\putwordShortTOC\undefined \gdef\putwordShortTOC{Short Contents}\fi
140 \ifx\putwordTOC\undefined \gdef\putwordTOC{Table of Contents}\fi
142 \ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi
143 \ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi
144 \ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi
145 \ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi
146 \ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi
147 \ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi
148 \ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi
149 \ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi
150 \ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi
151 \ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi
152 \ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi
153 \ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi
155 \ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro}\fi
156 \ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi
157 \ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi
158 \ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi
159 \ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi
161 % Give the space character the catcode for a space.
162 \def\spaceisspace{\catcode`\ =10\relax}
164 \chardef\dashChar = `\-
165 \chardef\slashChar = `\/
166 \chardef\underChar = `\_
168 % Ignore a token.
170 \def\gobble#1{}
172 % The following is used inside several \edef's.
173 \def\makecsname#1{\expandafter\noexpand\csname#1\endcsname}
175 % Hyphenation fixes.
176 \hyphenation{
177 Flor-i-da Ghost-script Ghost-view Mac-OS Post-Script
178 ap-pen-dix bit-map bit-maps
179 data-base data-bases eshell fall-ing half-way long-est man-u-script
180 man-u-scripts mini-buf-fer mini-buf-fers over-view par-a-digm
181 par-a-digms rath-er rec-tan-gu-lar ro-bot-ics se-vere-ly set-up spa-ces
182 spell-ing spell-ings
183 stand-alone strong-est time-stamp time-stamps which-ever white-space
184 wide-spread wrap-around
187 % Sometimes it is convenient to have everything in the transcript file
188 % and nothing on the terminal. We don't just call \tracingall here,
189 % since that produces some useless output on the terminal. We also make
190 % some effort to order the tracing commands to reduce output in the log
191 % file; cf. trace.sty in LaTeX.
193 \def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%
194 \def\loggingall{%
195 \tracingstats2
196 \tracingpages1
197 \tracinglostchars2 % 2 gives us more in etex
198 \tracingparagraphs1
199 \tracingoutput1
200 \tracingmacros2
201 \tracingrestores1
202 \showboxbreadth\maxdimen \showboxdepth\maxdimen
203 \ifx\eTeXversion\thisisundefined\else % etex gives us more logging
204 \tracingscantokens1
205 \tracingifs1
206 \tracinggroups1
207 \tracingnesting2
208 \tracingassigns1
210 \tracingcommands3 % 3 gives us more in etex
211 \errorcontextlines16
214 % @errormsg{MSG}. Do the index-like expansions on MSG, but if things
215 % aren't perfect, it's not the end of the world, being an error message,
216 % after all.
218 \def\errormsg{\begingroup \indexnofonts \doerrormsg}
219 \def\doerrormsg#1{\errmessage{#1}}
221 % add check for \lastpenalty to plain's definitions. If the last thing
222 % we did was a \nobreak, we don't want to insert more space.
224 \def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount
225 \removelastskip\penalty-50\smallskip\fi\fi}
226 \def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount
227 \removelastskip\penalty-100\medskip\fi\fi}
228 \def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount
229 \removelastskip\penalty-200\bigskip\fi\fi}
231 %\f Output routine
234 % For a final copy, take out the rectangles
235 % that mark overfull boxes (in case you have decided
236 % that the text looks ok even though it passes the margin).
238 \def\finalout{\overfullrule=0pt }
240 % Do @cropmarks to get crop marks.
242 \newif\ifcropmarks
243 \let\cropmarks = \cropmarkstrue
245 % Dimensions to add cropmarks at corners.
246 % Added by P. A. MacKay, 12 Nov. 1986
248 \newdimen\outerhsize \newdimen\outervsize % set by the paper size routines
249 \newdimen\cornerlong \cornerlong=1pc
250 \newdimen\cornerthick \cornerthick=.3pt
251 \newdimen\topandbottommargin \topandbottommargin=.75in
253 % Output a mark which sets \thischapter, \thissection and \thiscolor.
254 % We dump everything together because we only have one kind of mark.
255 % This works because we only use \botmark / \topmark, not \firstmark.
257 % A mark contains a subexpression of the \ifcase ... \fi construct.
258 % \get*marks macros below extract the needed part using \ifcase.
260 % Another complication is to let the user choose whether \thischapter
261 % (\thissection) refers to the chapter (section) in effect at the top
262 % of a page, or that at the bottom of a page.
264 % \domark is called twice inside \chapmacro, to add one
265 % mark before the section break, and one after.
266 % In the second call \prevchapterdefs is the same as \lastchapterdefs,
267 % and \prevsectiondefs is the same as \lastsectiondefs.
268 % Then if the page is not broken at the mark, some of the previous
269 % section appears on the page, and we can get the name of this section
270 % from \firstmark for @everyheadingmarks top.
271 % @everyheadingmarks bottom uses \botmark.
273 % See page 260 of The TeXbook.
274 \def\domark{%
275 \toks0=\expandafter{\lastchapterdefs}%
276 \toks2=\expandafter{\lastsectiondefs}%
277 \toks4=\expandafter{\prevchapterdefs}%
278 \toks6=\expandafter{\prevsectiondefs}%
279 \toks8=\expandafter{\lastcolordefs}%
280 \mark{%
281 \the\toks0 \the\toks2 % 0: marks for @everyheadingmarks top
282 \noexpand\or \the\toks4 \the\toks6 % 1: for @everyheadingmarks bottom
283 \noexpand\else \the\toks8 % 2: color marks
287 % \gettopheadingmarks, \getbottomheadingmarks,
288 % \getcolormarks - extract needed part of mark.
290 % \topmark doesn't work for the very first chapter (after the title
291 % page or the contents), so we use \firstmark there -- this gets us
292 % the mark with the chapter defs, unless the user sneaks in, e.g.,
293 % @setcolor (or @url, or @link, etc.) between @contents and the very
294 % first @chapter.
295 \def\gettopheadingmarks{%
296 \ifcase0\topmark\fi
297 \ifx\thischapter\empty \ifcase0\firstmark\fi \fi
299 \def\getbottomheadingmarks{\ifcase1\botmark\fi}
300 \def\getcolormarks{\ifcase2\topmark\fi}
302 % Avoid "undefined control sequence" errors.
303 \def\lastchapterdefs{}
304 \def\lastsectiondefs{}
305 \def\lastsection{}
306 \def\prevchapterdefs{}
307 \def\prevsectiondefs{}
308 \def\lastcolordefs{}
310 % Margin to add to right of even pages, to left of odd pages.
311 \newdimen\bindingoffset
312 \newdimen\normaloffset
313 \newdimen\txipagewidth \newdimen\txipageheight
315 % Main output routine.
317 \chardef\PAGE = 255
318 \output = {\onepageout{\pagecontents\PAGE}}
320 \newbox\headlinebox
321 \newbox\footlinebox
323 % \onepageout takes a vbox as an argument.
324 % \shipout a vbox for a single page, adding an optional header, footer,
325 % cropmarks, and footnote. This also causes index entries for this page
326 % to be written to the auxiliary files.
328 \def\onepageout#1{%
329 \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi
331 \ifodd\pageno \advance\hoffset by \bindingoffset
332 \else \advance\hoffset by -\bindingoffset\fi
334 % Common context changes for both heading and footing.
335 % Do this outside of the \shipout so @code etc. will be expanded in
336 % the headline as they should be, not taken literally (outputting ''code).
337 \def\commmonheadfootline{\let\hsize=\txipagewidth \texinfochars}
339 % Retrieve the information for the headings from the marks in the page,
340 % and call Plain TeX's \makeheadline and \makefootline, which use the
341 % values in \headline and \footline.
343 % This is used to check if we are on the first page of a chapter.
344 \ifcase1\topmark\fi
345 \let\prevchaptername\thischaptername
346 \ifcase0\firstmark\fi
347 \let\curchaptername\thischaptername
349 \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi
350 \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi
352 \ifx\curchaptername\prevchaptername
353 \let\thischapterheading\thischapter
354 \else
355 % \thischapterheading is the same as \thischapter except it is blank
356 % for the first page of a chapter. This is to prevent the chapter name
357 % being shown twice.
358 \def\thischapterheading{}%
361 \global\setbox\headlinebox = \vbox{\commmonheadfootline \makeheadline}%
362 \global\setbox\footlinebox = \vbox{\commmonheadfootline \makefootline}%
365 % Set context for writing to auxiliary files like index files.
366 % Have to do this stuff outside the \shipout because we want it to
367 % take effect in \write's, yet the group defined by the \vbox ends
368 % before the \shipout runs.
370 \indexdummies % don't expand commands in the output.
371 \normalturnoffactive % \ in index entries must not stay \, e.g., if
372 % the page break happens to be in the middle of an example.
373 % We don't want .vr (or whatever) entries like this:
374 % \entry{{\indexbackslash }acronym}{32}{\code {\acronym}}
375 % "\acronym" won't work when it's read back in;
376 % it needs to be
377 % {\code {{\backslashcurfont }acronym}
378 \shipout\vbox{%
379 % Do this early so pdf references go to the beginning of the page.
380 \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi
382 \ifcropmarks \vbox to \outervsize\bgroup
383 \hsize = \outerhsize
384 \vskip-\topandbottommargin
385 \vtop to0pt{%
386 \line{\ewtop\hfil\ewtop}%
387 \nointerlineskip
388 \line{%
389 \vbox{\moveleft\cornerthick\nstop}%
390 \hfill
391 \vbox{\moveright\cornerthick\nstop}%
393 \vss}%
394 \vskip\topandbottommargin
395 \line\bgroup
396 \hfil % center the page within the outer (page) hsize.
397 \ifodd\pageno\hskip\bindingoffset\fi
398 \vbox\bgroup
401 \unvbox\headlinebox
402 \pagebody{#1}%
403 \ifdim\ht\footlinebox > 0pt
404 % Only leave this space if the footline is nonempty.
405 % (We lessened \vsize for it in \oddfootingyyy.)
406 % The \baselineskip=24pt in plain's \makefootline has no effect.
407 \vskip 24pt
408 \unvbox\footlinebox
411 \ifcropmarks
412 \egroup % end of \vbox\bgroup
413 \hfil\egroup % end of (centering) \line\bgroup
414 \vskip\topandbottommargin plus1fill minus1fill
415 \boxmaxdepth = \cornerthick
416 \vbox to0pt{\vss
417 \line{%
418 \vbox{\moveleft\cornerthick\nsbot}%
419 \hfill
420 \vbox{\moveright\cornerthick\nsbot}%
422 \nointerlineskip
423 \line{\ewbot\hfil\ewbot}%
425 \egroup % \vbox from first cropmarks clause
427 }% end of \shipout\vbox
428 }% end of group with \indexdummies
429 \advancepageno
430 \ifnum\outputpenalty>-20000 \else\dosupereject\fi
433 \newinsert\margin \dimen\margin=\maxdimen
435 % Main part of page, including any footnotes
436 \def\pagebody#1{\vbox to\txipageheight{\boxmaxdepth=\maxdepth #1}}
437 {\catcode`\@ =11
438 \gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi
439 % marginal hacks, juha@viisa.uucp (Juha Takala)
440 \ifvoid\margin\else % marginal info is present
441 \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi
442 \dimen@=\dp#1\relax \unvbox#1\relax
443 \ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
444 \ifr@ggedbottom \kern-\dimen@ \vfil \fi}
447 % Here are the rules for the cropmarks. Note that they are
448 % offset so that the space between them is truly \outerhsize or \outervsize
449 % (P. A. MacKay, 12 November, 1986)
451 \def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong}
452 \def\nstop{\vbox
453 {\hrule height\cornerthick depth\cornerlong width\cornerthick}}
454 \def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong}
455 \def\nsbot{\vbox
456 {\hrule height\cornerlong depth\cornerthick width\cornerthick}}
459 % Argument parsing
461 % Parse an argument, then pass it to #1. The argument is the rest of
462 % the input line (except we remove a trailing comment). #1 should be a
463 % macro which expects an ordinary undelimited TeX argument.
464 % For example, \def\foo{\parsearg\fooxxx}.
466 \def\parsearg{\parseargusing{}}
467 \def\parseargusing#1#2{%
468 \def\argtorun{#2}%
469 \begingroup
470 \obeylines
471 \spaceisspace
473 \parseargline\empty% Insert the \empty token, see \finishparsearg below.
476 {\obeylines %
477 \gdef\parseargline#1^^M{%
478 \endgroup % End of the group started in \parsearg.
479 \argremovecomment #1\comment\ArgTerm%
483 % First remove any @comment, then any @c comment. Also remove a @texinfoc
484 % comment (see \scanmacro for details). Pass the result on to \argcheckspaces.
485 \def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm}
486 \def\argremovec#1\c#2\ArgTerm{\argremovetexinfoc #1\texinfoc\ArgTerm}
487 \def\argremovetexinfoc#1\texinfoc#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm}
489 % Each occurrence of `\^^M' or `<space>\^^M' is replaced by a single space.
491 % \argremovec might leave us with trailing space, e.g.,
492 % @end itemize @c foo
493 % This space token undergoes the same procedure and is eventually removed
494 % by \finishparsearg.
496 \def\argcheckspaces#1\^^M{\argcheckspacesX#1\^^M \^^M}
497 \def\argcheckspacesX#1 \^^M{\argcheckspacesY#1\^^M}
498 \def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{%
499 \def\temp{#3}%
500 \ifx\temp\empty
501 % Do not use \next, perhaps the caller of \parsearg uses it; reuse \temp:
502 \let\temp\finishparsearg
503 \else
504 \let\temp\argcheckspaces
506 % Put the space token in:
507 \temp#1 #3\ArgTerm
510 % If a _delimited_ argument is enclosed in braces, they get stripped; so
511 % to get _exactly_ the rest of the line, we had to prevent such situation.
512 % We prepended an \empty token at the very beginning and we expand it now,
513 % just before passing the control to \argtorun.
514 % (Similarly, we have to think about #3 of \argcheckspacesY above: it is
515 % either the null string, or it ends with \^^M---thus there is no danger
516 % that a pair of braces would be stripped.
518 % But first, we have to remove the trailing space token.
520 \def\finishparsearg#1 \ArgTerm{\expandafter\argtorun\expandafter{#1}}
523 % \parseargdef - define a command taking an argument on the line
525 % \parseargdef\foo{...}
526 % is roughly equivalent to
527 % \def\foo{\parsearg\Xfoo}
528 % \def\Xfoo#1{...}
529 \def\parseargdef#1{%
530 \expandafter \doparseargdef \csname\string#1\endcsname #1%
532 \def\doparseargdef#1#2{%
533 \def#2{\parsearg#1}%
534 \def#1##1%
537 % Several utility definitions with active space:
539 \obeyspaces
540 \gdef\obeyedspace{ }
542 % Make each space character in the input produce a normal interword
543 % space in the output. Don't allow a line break at this space, as this
544 % is used only in environments like @example, where each line of input
545 % should produce a line of output anyway.
547 \gdef\sepspaces{\obeyspaces\let =\tie}
549 % If an index command is used in an @example environment, any spaces
550 % therein should become regular spaces in the raw index file, not the
551 % expansion of \tie (\leavevmode \penalty \@M \ ).
552 \gdef\unsepspaces{\let =\space}
556 \def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}
558 % Define the framework for environments in texinfo.tex. It's used like this:
560 % \envdef\foo{...}
561 % \def\Efoo{...}
563 % It's the responsibility of \envdef to insert \begingroup before the
564 % actual body; @end closes the group after calling \Efoo. \envdef also
565 % defines \thisenv, so the current environment is known; @end checks
566 % whether the environment name matches. The \checkenv macro can also be
567 % used to check whether the current environment is the one expected.
569 % Non-false conditionals (@iftex, @ifset) don't fit into this, so they
570 % are not treated as environments; they don't open a group. (The
571 % implementation of @end takes care not to call \endgroup in this
572 % special case.)
575 % At run-time, environments start with this:
576 \def\startenvironment#1{\begingroup\def\thisenv{#1}}
577 % initialize
578 \let\thisenv\empty
580 % ... but they get defined via ``\envdef\foo{...}'':
581 \long\def\envdef#1#2{\def#1{\startenvironment#1#2}}
582 \def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}}
584 % Check whether we're in the right environment:
585 \def\checkenv#1{%
586 \def\temp{#1}%
587 \ifx\thisenv\temp
588 \else
589 \badenverr
593 % Environment mismatch, #1 expected:
594 \def\badenverr{%
595 \errhelp = \EMsimple
596 \errmessage{This command can appear only \inenvironment\temp,
597 not \inenvironment\thisenv}%
599 \def\inenvironment#1{%
600 \ifx#1\empty
601 outside of any environment%
602 \else
603 in environment \expandafter\string#1%
607 % @end foo executes the definition of \Efoo.
608 % But first, it executes a specialized version of \checkenv
610 \parseargdef\end{%
611 \if 1\csname iscond.#1\endcsname
612 \else
613 % The general wording of \badenverr may not be ideal.
614 \expandafter\checkenv\csname#1\endcsname
615 \csname E#1\endcsname
616 \endgroup
620 \newhelp\EMsimple{Press RETURN to continue.}
623 % Be sure we're in horizontal mode when doing a tie, since we make space
624 % equivalent to this in @example-like environments. Otherwise, a space
625 % at the beginning of a line will start with \penalty -- and
626 % since \penalty is valid in vertical mode, we'd end up putting the
627 % penalty on the vertical list instead of in the new paragraph.
628 {\catcode`@ = 11
629 % Avoid using \@M directly, because that causes trouble
630 % if the definition is written into an index file.
631 \global\let\tiepenalty = \@M
632 \gdef\tie{\leavevmode\penalty\tiepenalty\ }
635 % @: forces normal size whitespace following.
636 \def\:{\spacefactor=1000 }
638 % @* forces a line break.
639 \def\*{\unskip\hfil\break\hbox{}\ignorespaces}
641 % @/ allows a line break.
642 \let\/=\allowbreak
644 % @. is an end-of-sentence period.
645 \def\.{.\spacefactor=\endofsentencespacefactor\space}
647 % @! is an end-of-sentence bang.
648 \def\!{!\spacefactor=\endofsentencespacefactor\space}
650 % @? is an end-of-sentence query.
651 \def\?{?\spacefactor=\endofsentencespacefactor\space}
653 % @frenchspacing on|off says whether to put extra space after punctuation.
655 \def\onword{on}
656 \def\offword{off}
658 \parseargdef\frenchspacing{%
659 \def\temp{#1}%
660 \ifx\temp\onword \plainfrenchspacing
661 \else\ifx\temp\offword \plainnonfrenchspacing
662 \else
663 \errhelp = \EMsimple
664 \errmessage{Unknown @frenchspacing option `\temp', must be on|off}%
665 \fi\fi
668 % @w prevents a word break. Without the \leavevmode, @w at the
669 % beginning of a paragraph, when TeX is still in vertical mode, would
670 % produce a whole line of output instead of starting the paragraph.
671 \def\w#1{\leavevmode\hbox{#1}}
673 % @group ... @end group forces ... to be all on one page, by enclosing
674 % it in a TeX vbox. We use \vtop instead of \vbox to construct the box
675 % to keep its height that of a normal line. According to the rules for
676 % \topskip (p.114 of the TeXbook), the glue inserted is
677 % max (\topskip - \ht (first item), 0). If that height is large,
678 % therefore, no glue is inserted, and the space between the headline and
679 % the text is small, which looks bad.
681 % Another complication is that the group might be very large. This can
682 % cause the glue on the previous page to be unduly stretched, because it
683 % does not have much material. In this case, it's better to add an
684 % explicit \vfill so that the extra space is at the bottom. The
685 % threshold for doing this is if the group is more than \vfilllimit
686 % percent of a page (\vfilllimit can be changed inside of @tex).
688 \newbox\groupbox
689 \def\vfilllimit{0.7}
691 \envdef\group{%
692 \ifnum\catcode`\^^M=\active \else
693 \errhelp = \groupinvalidhelp
694 \errmessage{@group invalid in context where filling is enabled}%
696 \startsavinginserts
698 \setbox\groupbox = \vtop\bgroup
699 % Do @comment since we are called inside an environment such as
700 % @example, where each end-of-line in the input causes an
701 % end-of-line in the output. We don't want the end-of-line after
702 % the `@group' to put extra space in the output. Since @group
703 % should appear on a line by itself (according to the Texinfo
704 % manual), we don't worry about eating any user text.
705 \comment
708 % The \vtop produces a box with normal height and large depth; thus, TeX puts
709 % \baselineskip glue before it, and (when the next line of text is done)
710 % \lineskip glue after it. Thus, space below is not quite equal to space
711 % above. But it's pretty close.
712 \def\Egroup{%
713 % To get correct interline space between the last line of the group
714 % and the first line afterwards, we have to propagate \prevdepth.
715 \endgraf % Not \par, as it may have been set to \lisppar.
716 \global\dimen1 = \prevdepth
717 \egroup % End the \vtop.
718 \addgroupbox
719 \prevdepth = \dimen1
720 \checkinserts
723 \def\addgroupbox{
724 % \dimen0 is the vertical size of the group's box.
725 \dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox
726 % \dimen2 is how much space is left on the page (more or less).
727 \dimen2 = \txipageheight \advance\dimen2 by -\pagetotal
728 % if the group doesn't fit on the current page, and it's a big big
729 % group, force a page break.
730 \ifdim \dimen0 > \dimen2
731 \ifdim \pagetotal < \vfilllimit\txipageheight
732 \page
735 \box\groupbox
739 % TeX puts in an \escapechar (i.e., `@') at the beginning of the help
740 % message, so this ends up printing `@group can only ...'.
742 \newhelp\groupinvalidhelp{%
743 group can only be used in environments such as @example,^^J%
744 where each line of input produces a line of output.}
746 % @need space-in-mils
747 % forces a page break if there is not space-in-mils remaining.
749 \newdimen\mil \mil=0.001in
751 \parseargdef\need{%
752 % Ensure vertical mode, so we don't make a big box in the middle of a
753 % paragraph.
754 \par
756 % If the @need value is less than one line space, it's useless.
757 \dimen0 = #1\mil
758 \dimen2 = \ht\strutbox
759 \advance\dimen2 by \dp\strutbox
760 \ifdim\dimen0 > \dimen2
762 % Do a \strut just to make the height of this box be normal, so the
763 % normal leading is inserted relative to the preceding line.
764 % And a page break here is fine.
765 \vtop to #1\mil{\strut\vfil}%
767 % TeX does not even consider page breaks if a penalty added to the
768 % main vertical list is 10000 or more. But in order to see if the
769 % empty box we just added fits on the page, we must make it consider
770 % page breaks. On the other hand, we don't want to actually break the
771 % page after the empty box. So we use a penalty of 9999.
773 % There is an extremely small chance that TeX will actually break the
774 % page at this \penalty, if there are no other feasible breakpoints in
775 % sight. (If the user is using lots of big @group commands, which
776 % almost-but-not-quite fill up a page, TeX will have a hard time doing
777 % good page breaking, for example.) However, I could not construct an
778 % example where a page broke at this \penalty; if it happens in a real
779 % document, then we can reconsider our strategy.
780 \penalty9999
782 % Back up by the size of the box, whether we did a page break or not.
783 \kern -#1\mil
785 % Do not allow a page break right after this kern.
786 \nobreak
790 % @br forces paragraph break (and is undocumented).
792 \let\br = \par
794 % @page forces the start of a new page.
796 \def\page{\par\vfill\supereject}
798 % @exdent text....
799 % outputs text on separate line in roman font, starting at standard page margin
801 % This records the amount of indent in the innermost environment.
802 % That's how much \exdent should take out.
803 \newskip\exdentamount
805 % This defn is used inside fill environments such as @defun.
806 \parseargdef\exdent{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}
808 % This defn is used inside nofill environments such as @example.
809 \parseargdef\nofillexdent{{\advance \leftskip by -\exdentamount
810 \leftline{\hskip\leftskip{\rm#1}}}}
812 % @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current
813 % paragraph. For more general purposes, use the \margin insertion
814 % class. WHICH is `l' or `r'. Not documented, written for gawk manual.
816 \newskip\inmarginspacing \inmarginspacing=1cm
817 \def\strutdepth{\dp\strutbox}
819 \def\doinmargin#1#2{\strut\vadjust{%
820 \nobreak
821 \kern-\strutdepth
822 \vtop to \strutdepth{%
823 \baselineskip=\strutdepth
824 \vss
825 % if you have multiple lines of stuff to put here, you'll need to
826 % make the vbox yourself of the appropriate size.
827 \ifx#1l%
828 \llap{\ignorespaces #2\hskip\inmarginspacing}%
829 \else
830 \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}%
832 \null
835 \def\inleftmargin{\doinmargin l}
836 \def\inrightmargin{\doinmargin r}
838 % @inmargin{TEXT [, RIGHT-TEXT]}
839 % (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right;
840 % else use TEXT for both).
842 \def\inmargin#1{\parseinmargin #1,,\finish}
843 \def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing.
844 \setbox0 = \hbox{\ignorespaces #2}%
845 \ifdim\wd0 > 0pt
846 \def\lefttext{#1}% have both texts
847 \def\righttext{#2}%
848 \else
849 \def\lefttext{#1}% have only one text
850 \def\righttext{#1}%
853 \ifodd\pageno
854 \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin
855 \else
856 \def\temp{\inleftmargin\lefttext}%
858 \temp
861 % @| inserts a changebar to the left of the current line. It should
862 % surround any changed text. This approach does *not* work if the
863 % change spans more than two lines of output. To handle that, we would
864 % have adopt a much more difficult approach (putting marks into the main
865 % vertical list for the beginning and end of each change). This command
866 % is not documented, not supported, and doesn't work.
868 \def\|{%
869 % \vadjust can only be used in horizontal mode.
870 \leavevmode
872 % Append this vertical mode material after the current line in the output.
873 \vadjust{%
874 % We want to insert a rule with the height and depth of the current
875 % leading; that is exactly what \strutbox is supposed to record.
876 \vskip-\baselineskip
878 % \vadjust-items are inserted at the left edge of the type. So
879 % the \llap here moves out into the left-hand margin.
880 \llap{%
882 % For a thicker or thinner bar, change the `1pt'.
883 \vrule height\baselineskip width1pt
885 % This is the space between the bar and the text.
886 \hskip 12pt
891 % @include FILE -- \input text of FILE.
893 \def\include{\parseargusing\filenamecatcodes\includezzz}
894 \def\includezzz#1{%
895 \pushthisfilestack
896 \def\thisfile{#1}%
898 \makevalueexpandable % we want to expand any @value in FILE.
899 \turnoffactive % and allow special characters in the expansion
900 \indexnofonts % Allow `@@' and other weird things in file names.
901 \wlog{texinfo.tex: doing @include of #1^^J}%
902 \edef\temp{\noexpand\input #1 }%
904 % This trickery is to read FILE outside of a group, in case it makes
905 % definitions, etc.
906 \expandafter
907 }\temp
908 \popthisfilestack
910 \def\filenamecatcodes{%
911 \catcode`\\=\other
912 \catcode`~=\other
913 \catcode`^=\other
914 \catcode`_=\other
915 \catcode`|=\other
916 \catcode`<=\other
917 \catcode`>=\other
918 \catcode`+=\other
919 \catcode`-=\other
920 \catcode`\`=\other
921 \catcode`\'=\other
924 \def\pushthisfilestack{%
925 \expandafter\pushthisfilestackX\popthisfilestack\StackTerm
927 \def\pushthisfilestackX{%
928 \expandafter\pushthisfilestackY\thisfile\StackTerm
930 \def\pushthisfilestackY #1\StackTerm #2\StackTerm {%
931 \gdef\popthisfilestack{\gdef\thisfile{#1}\gdef\popthisfilestack{#2}}%
934 \def\popthisfilestack{\errthisfilestackempty}
935 \def\errthisfilestackempty{\errmessage{Internal error:
936 the stack of filenames is empty.}}
938 \def\thisfile{}
940 % @center line
941 % outputs that line, centered.
943 \parseargdef\center{%
944 \ifhmode
945 \let\centersub\centerH
946 \else
947 \let\centersub\centerV
949 \centersub{\hfil \ignorespaces#1\unskip \hfil}%
950 \let\centersub\relax % don't let the definition persist, just in case
952 \def\centerH#1{{%
953 \hfil\break
954 \advance\hsize by -\leftskip
955 \advance\hsize by -\rightskip
956 \line{#1}%
957 \break
960 \newcount\centerpenalty
961 \def\centerV#1{%
962 % The idea here is the same as in \startdefun, \cartouche, etc.: if
963 % @center is the first thing after a section heading, we need to wipe
964 % out the negative parskip inserted by \sectionheading, but still
965 % prevent a page break here.
966 \centerpenalty = \lastpenalty
967 \ifnum\centerpenalty>10000 \vskip\parskip \fi
968 \ifnum\centerpenalty>9999 \penalty\centerpenalty \fi
969 \line{\kern\leftskip #1\kern\rightskip}%
972 % @sp n outputs n lines of vertical space
974 \parseargdef\sp{\vskip #1\baselineskip}
976 % @comment ...line which is ignored...
977 % @c is the same as @comment
978 % @ignore ... @end ignore is another way to write a comment
980 \def\comment{\begingroup \catcode`\^^M=\active%
981 \catcode`\@=\other \catcode`\{=\other \catcode`\}=\other\commentxxx}%
983 {\catcode`\^^M=\active%
984 \gdef\commentxxx#1^^M{\endgroup%
985 \futurelet\nexttoken\commentxxxx}%
986 \gdef\commentxxxx{\ifx\nexttoken\aftermacro\expandafter\comment\fi}%
989 \def\c{\begingroup \catcode`\^^M=\active%
990 \catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%
991 \cxxx}
992 {\catcode`\^^M=\active \gdef\cxxx#1^^M{\endgroup}}
993 % See comment in \scanmacro about why the definitions of @c and @comment differ
995 % @paragraphindent NCHARS
996 % We'll use ems for NCHARS, close enough.
997 % NCHARS can also be the word `asis' or `none'.
998 % We cannot feasibly implement @paragraphindent asis, though.
1000 \def\asisword{asis} % no translation, these are keywords
1001 \def\noneword{none}
1003 \parseargdef\paragraphindent{%
1004 \def\temp{#1}%
1005 \ifx\temp\asisword
1006 \else
1007 \ifx\temp\noneword
1008 \defaultparindent = 0pt
1009 \else
1010 \defaultparindent = #1em
1013 \parindent = \defaultparindent
1016 % @exampleindent NCHARS
1017 % We'll use ems for NCHARS like @paragraphindent.
1018 % It seems @exampleindent asis isn't necessary, but
1019 % I preserve it to make it similar to @paragraphindent.
1020 \parseargdef\exampleindent{%
1021 \def\temp{#1}%
1022 \ifx\temp\asisword
1023 \else
1024 \ifx\temp\noneword
1025 \lispnarrowing = 0pt
1026 \else
1027 \lispnarrowing = #1em
1032 % @firstparagraphindent WORD
1033 % If WORD is `none', then suppress indentation of the first paragraph
1034 % after a section heading. If WORD is `insert', then do indent at such
1035 % paragraphs.
1037 % The paragraph indentation is suppressed or not by calling
1038 % \suppressfirstparagraphindent, which the sectioning commands do.
1039 % We switch the definition of this back and forth according to WORD.
1040 % By default, we suppress indentation.
1042 \def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent}
1043 \def\insertword{insert}
1045 \parseargdef\firstparagraphindent{%
1046 \def\temp{#1}%
1047 \ifx\temp\noneword
1048 \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent
1049 \else\ifx\temp\insertword
1050 \let\suppressfirstparagraphindent = \relax
1051 \else
1052 \errhelp = \EMsimple
1053 \errmessage{Unknown @firstparagraphindent option `\temp'}%
1054 \fi\fi
1057 % Here is how we actually suppress indentation. Redefine \everypar to
1058 % \kern backwards by \parindent, and then reset itself to empty.
1060 % We also make \indent itself not actually do anything until the next
1061 % paragraph.
1063 \gdef\dosuppressfirstparagraphindent{%
1064 \gdef\indent {\restorefirstparagraphindent \indent}%
1065 \gdef\noindent{\restorefirstparagraphindent \noindent}%
1066 \global\everypar = {\kern -\parindent \restorefirstparagraphindent}%
1069 \gdef\restorefirstparagraphindent{%
1070 \global\let\indent = \ptexindent
1071 \global\let\noindent = \ptexnoindent
1072 \global\everypar = {}%
1076 % @refill is a no-op.
1077 \let\refill=\relax
1079 % @setfilename INFO-FILENAME - ignored
1080 \let\setfilename=\comment
1082 % @bye.
1083 \outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
1086 \message{pdf,}
1087 % adobe `portable' document format
1088 \newcount\tempnum
1089 \newcount\lnkcount
1090 \newtoks\filename
1091 \newcount\filenamelength
1092 \newcount\pgn
1093 \newtoks\toksA
1094 \newtoks\toksB
1095 \newtoks\toksC
1096 \newtoks\toksD
1097 \newbox\boxA
1098 \newbox\boxB
1099 \newcount\countA
1100 \newif\ifpdf
1101 \newif\ifpdfmakepagedest
1104 % For LuaTeX
1107 \ifx\luatexversion\thisisundefined
1108 \else
1109 % Escape PDF strings UTF-8 to UTF-16
1110 \begingroup
1111 \catcode`\%=12
1112 \directlua{
1113 function UTF16oct(str)
1114 tex.sprint(string.char(0x5c) .. '376' .. string.char(0x5c) .. '377')
1115 for c in string.utfvalues(str) do
1116 if c < 0x10000 then
1117 tex.sprint(
1118 string.format(string.char(0x5c) .. string.char(0x25) .. '03o' ..
1119 string.char(0x5c) .. string.char(0x25) .. '03o',
1120 (c / 256), (c % 256)))
1121 else
1122 c = c - 0x10000
1123 local c_hi = c / 1024 + 0xd800
1124 local c_lo = c % 1024 + 0xdc00
1125 tex.sprint(
1126 string.format(string.char(0x5c) .. string.char(0x25) .. '03o' ..
1127 string.char(0x5c) .. string.char(0x25) .. '03o' ..
1128 string.char(0x5c) .. string.char(0x25) .. '03o' ..
1129 string.char(0x5c) .. string.char(0x25) .. '03o',
1130 (c_hi / 256), (c_hi % 256),
1131 (c_lo / 256), (c_lo % 256)))
1136 \endgroup
1137 \def\pdfescapestring#1{\directlua{UTF16oct('\luaescapestring{#1}')}}
1138 \ifnum\luatexversion>84
1139 % For LuaTeX >= 0.85
1140 \def\pdfdest{\pdfextension dest}
1141 \let\pdfoutput\outputmode
1142 \def\pdfliteral{\pdfextension literal}
1143 \def\pdfcatalog{\pdfextension catalog}
1144 \def\pdftexversion{\numexpr\pdffeedback version\relax}
1145 \let\pdfximage\saveimageresource
1146 \let\pdfrefximage\useimageresource
1147 \let\pdflastximage\lastsavedimageresourceindex
1148 \def\pdfendlink{\pdfextension endlink\relax}
1149 \def\pdfoutline{\pdfextension outline}
1150 \def\pdfstartlink{\pdfextension startlink}
1151 \def\pdffontattr{\pdfextension fontattr}
1152 \def\pdfobj{\pdfextension obj}
1153 \def\pdflastobj{\numexpr\pdffeedback lastobj\relax}
1154 \let\pdfpagewidth\pagewidth
1155 \let\pdfpageheight\pageheight
1156 \edef\pdfhorigin{\pdfvariable horigin}
1157 \edef\pdfvorigin{\pdfvariable vorigin}
1161 % when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1
1162 % can be set). So we test for \relax and 0 as well as being undefined.
1163 \ifx\pdfoutput\thisisundefined
1164 \else
1165 \ifx\pdfoutput\relax
1166 \else
1167 \ifcase\pdfoutput
1168 \else
1169 \pdftrue
1174 % PDF uses PostScript string constants for the names of xref targets,
1175 % for display in the outlines, and in other places. Thus, we have to
1176 % double any backslashes. Otherwise, a name like "\node" will be
1177 % interpreted as a newline (\n), followed by o, d, e. Not good.
1179 % See http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html and
1180 % related messages. The final outcome is that it is up to the TeX user
1181 % to double the backslashes and otherwise make the string valid, so
1182 % that's what we do. pdftex 1.30.0 (ca.2005) introduced a primitive to
1183 % do this reliably, so we use it.
1185 % #1 is a control sequence in which to do the replacements,
1186 % which we \xdef.
1187 \def\txiescapepdf#1{%
1188 \ifx\pdfescapestring\thisisundefined
1189 % No primitive available; should we give a warning or log?
1190 % Many times it won't matter.
1191 \else
1192 % The expandable \pdfescapestring primitive escapes parentheses,
1193 % backslashes, and other special chars.
1194 \xdef#1{\pdfescapestring{#1}}%
1198 \newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images
1199 with PDF output, and none of those formats could be found. (.eps cannot
1200 be supported due to the design of the PDF format; use regular TeX (DVI
1201 output) for that.)}
1203 \ifpdf
1205 % Color manipulation macros using ideas from pdfcolor.tex,
1206 % except using rgb instead of cmyk; the latter is said to render as a
1207 % very dark gray on-screen and a very dark halftone in print, instead
1208 % of actual black. The dark red here is dark enough to print on paper as
1209 % nearly black, but still distinguishable for online viewing. We use
1210 % black by default, though.
1211 \def\rgbDarkRed{0.50 0.09 0.12}
1212 \def\rgbBlack{0 0 0}
1214 % rg sets the color for filling (usual text, etc.);
1215 % RG sets the color for stroking (thin rules, e.g., normal _'s).
1216 \def\pdfsetcolor#1{\pdfliteral{#1 rg #1 RG}}
1218 % Set color, and create a mark which defines \thiscolor accordingly,
1219 % so that \makeheadline knows which color to restore.
1220 \def\setcolor#1{%
1221 \xdef\lastcolordefs{\gdef\noexpand\thiscolor{#1}}%
1222 \domark
1223 \pdfsetcolor{#1}%
1226 \def\maincolor{\rgbBlack}
1227 \pdfsetcolor{\maincolor}
1228 \edef\thiscolor{\maincolor}
1229 \def\lastcolordefs{}
1231 \def\makefootline{%
1232 \baselineskip24pt
1233 \line{\pdfsetcolor{\maincolor}\the\footline}%
1236 \def\makeheadline{%
1237 \vbox to 0pt{%
1238 \vskip-22.5pt
1239 \line{%
1240 \vbox to8.5pt{}%
1241 % Extract \thiscolor definition from the marks.
1242 \getcolormarks
1243 % Typeset the headline with \maincolor, then restore the color.
1244 \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}%
1246 \vss
1248 \nointerlineskip
1252 \pdfcatalog{/PageMode /UseOutlines}
1254 % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto).
1255 \def\dopdfimage#1#2#3{%
1256 \def\pdfimagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}%
1257 \def\pdfimageheight{#3}\setbox2 = \hbox{\ignorespaces #3}%
1259 % pdftex (and the PDF format) support .pdf, .png, .jpg (among
1260 % others). Let's try in that order, PDF first since if
1261 % someone has a scalable image, presumably better to use that than a
1262 % bitmap.
1263 \let\pdfimgext=\empty
1264 \begingroup
1265 \openin 1 #1.pdf \ifeof 1
1266 \openin 1 #1.PDF \ifeof 1
1267 \openin 1 #1.png \ifeof 1
1268 \openin 1 #1.jpg \ifeof 1
1269 \openin 1 #1.jpeg \ifeof 1
1270 \openin 1 #1.JPG \ifeof 1
1271 \errhelp = \nopdfimagehelp
1272 \errmessage{Could not find image file #1 for pdf}%
1273 \else \gdef\pdfimgext{JPG}%
1275 \else \gdef\pdfimgext{jpeg}%
1277 \else \gdef\pdfimgext{jpg}%
1279 \else \gdef\pdfimgext{png}%
1281 \else \gdef\pdfimgext{PDF}%
1283 \else \gdef\pdfimgext{pdf}%
1285 \closein 1
1286 \endgroup
1288 % without \immediate, ancient pdftex seg faults when the same image is
1289 % included twice. (Version 3.14159-pre-1.0-unofficial-20010704.)
1290 \ifnum\pdftexversion < 14
1291 \immediate\pdfimage
1292 \else
1293 \immediate\pdfximage
1295 \ifdim \wd0 >0pt width \pdfimagewidth \fi
1296 \ifdim \wd2 >0pt height \pdfimageheight \fi
1297 \ifnum\pdftexversion<13
1298 #1.\pdfimgext
1299 \else
1300 {#1.\pdfimgext}%
1302 \ifnum\pdftexversion < 14 \else
1303 \pdfrefximage \pdflastximage
1304 \fi}
1306 \def\pdfmkdest#1{{%
1307 % We have to set dummies so commands such as @code, and characters
1308 % such as \, aren't expanded when present in a section title.
1309 \indexnofonts
1310 \turnoffactive
1311 \makevalueexpandable
1312 \def\pdfdestname{#1}%
1313 \txiescapepdf\pdfdestname
1314 \safewhatsit{\pdfdest name{\pdfdestname} xyz}%
1317 % used to mark target names; must be expandable.
1318 \def\pdfmkpgn#1{#1}
1320 % by default, use black for everything.
1321 \def\urlcolor{\rgbBlack}
1322 \def\linkcolor{\rgbBlack}
1323 \def\endlink{\setcolor{\maincolor}\pdfendlink}
1325 % Adding outlines to PDF; macros for calculating structure of outlines
1326 % come from Petr Olsak
1327 \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0%
1328 \else \csname#1\endcsname \fi}
1329 \def\advancenumber#1{\tempnum=\expnumber{#1}\relax
1330 \advance\tempnum by 1
1331 \expandafter\xdef\csname#1\endcsname{\the\tempnum}}
1333 % #1 is the section text, which is what will be displayed in the
1334 % outline by the pdf viewer. #2 is the pdf expression for the number
1335 % of subentries (or empty, for subsubsections). #3 is the node text,
1336 % which might be empty if this toc entry had no corresponding node.
1337 % #4 is the page number
1339 \def\dopdfoutline#1#2#3#4{%
1340 % Generate a link to the node text if that exists; else, use the
1341 % page number. We could generate a destination for the section
1342 % text in the case where a section has no node, but it doesn't
1343 % seem worth the trouble, since most documents are normally structured.
1345 \ifx\luatexversion\thisisundefined \else
1346 \turnoffactive % LuaTeX can use Unicode strings for PDF
1348 \edef\pdfoutlinedest{#3}%
1349 \ifx\pdfoutlinedest\empty
1350 \def\pdfoutlinedest{#4}%
1351 \else
1352 \txiescapepdf\pdfoutlinedest
1355 % Also escape PDF chars in the display string.
1356 \edef\pdfoutlinetext{#1}%
1357 \txiescapepdf\pdfoutlinetext
1359 \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{\pdfoutlinetext}%
1363 \def\pdfmakeoutlines{%
1364 \begingroup
1365 % Read toc silently, to get counts of subentries for \pdfoutline.
1366 \def\partentry##1##2##3##4{}% ignore parts in the outlines
1367 \def\numchapentry##1##2##3##4{%
1368 \def\thischapnum{##2}%
1369 \def\thissecnum{0}%
1370 \def\thissubsecnum{0}%
1372 \def\numsecentry##1##2##3##4{%
1373 \advancenumber{chap\thischapnum}%
1374 \def\thissecnum{##2}%
1375 \def\thissubsecnum{0}%
1377 \def\numsubsecentry##1##2##3##4{%
1378 \advancenumber{sec\thissecnum}%
1379 \def\thissubsecnum{##2}%
1381 \def\numsubsubsecentry##1##2##3##4{%
1382 \advancenumber{subsec\thissubsecnum}%
1384 \def\thischapnum{0}%
1385 \def\thissecnum{0}%
1386 \def\thissubsecnum{0}%
1388 % use \def rather than \let here because we redefine \chapentry et
1389 % al. a second time, below.
1390 \def\appentry{\numchapentry}%
1391 \def\appsecentry{\numsecentry}%
1392 \def\appsubsecentry{\numsubsecentry}%
1393 \def\appsubsubsecentry{\numsubsubsecentry}%
1394 \def\unnchapentry{\numchapentry}%
1395 \def\unnsecentry{\numsecentry}%
1396 \def\unnsubsecentry{\numsubsecentry}%
1397 \def\unnsubsubsecentry{\numsubsubsecentry}%
1398 \readdatafile{toc}%
1400 % Read toc second time, this time actually producing the outlines.
1401 % The `-' means take the \expnumber as the absolute number of
1402 % subentries, which we calculated on our first read of the .toc above.
1404 % We use the node names as the destinations.
1405 \def\numchapentry##1##2##3##4{%
1406 \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}%
1407 \def\numsecentry##1##2##3##4{%
1408 \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}%
1409 \def\numsubsecentry##1##2##3##4{%
1410 \dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}%
1411 \def\numsubsubsecentry##1##2##3##4{% count is always zero
1412 \dopdfoutline{##1}{}{##3}{##4}}%
1414 % PDF outlines are displayed using system fonts, instead of
1415 % document fonts. Therefore we cannot use special characters,
1416 % since the encoding is unknown. For example, the eogonek from
1417 % Latin 2 (0xea) gets translated to a | character. Info from
1418 % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100.
1420 % TODO this right, we have to translate 8-bit characters to
1421 % their "best" equivalent, based on the @documentencoding. Too
1422 % much work for too little return. Just use the ASCII equivalents
1423 % we use for the index sort strings.
1425 \indexnofonts
1426 \setupdatafile
1427 % We can have normal brace characters in the PDF outlines, unlike
1428 % Texinfo index files. So set that up.
1429 \def\{{\lbracecharliteral}%
1430 \def\}{\rbracecharliteral}%
1431 \catcode`\\=\active \otherbackslash
1432 \input \tocreadfilename
1433 \endgroup
1435 {\catcode`[=1 \catcode`]=2
1436 \catcode`{=\other \catcode`}=\other
1437 \gdef\lbracecharliteral[{]%
1438 \gdef\rbracecharliteral[}]%
1441 \def\skipspaces#1{\def\PP{#1}\def\D{|}%
1442 \ifx\PP\D\let\nextsp\relax
1443 \else\let\nextsp\skipspaces
1444 \addtokens{\filename}{\PP}%
1445 \advance\filenamelength by 1
1447 \nextsp}
1448 \def\getfilename#1{%
1449 \filenamelength=0
1450 % If we don't expand the argument now, \skipspaces will get
1451 % snagged on things like "@value{foo}".
1452 \edef\temp{#1}%
1453 \expandafter\skipspaces\temp|\relax
1455 \ifnum\pdftexversion < 14
1456 \let \startlink \pdfannotlink
1457 \else
1458 \let \startlink \pdfstartlink
1460 % make a live url in pdf output.
1461 \def\pdfurl#1{%
1462 \begingroup
1463 % it seems we really need yet another set of dummies; have not
1464 % tried to figure out what each command should do in the context
1465 % of @url. for now, just make @/ a no-op, that's the only one
1466 % people have actually reported a problem with.
1468 \normalturnoffactive
1469 \def\@{@}%
1470 \let\/=\empty
1471 \makevalueexpandable
1472 % do we want to go so far as to use \indexnofonts instead of just
1473 % special-casing \var here?
1474 \def\var##1{##1}%
1476 \leavevmode\setcolor{\urlcolor}%
1477 \startlink attr{/Border [0 0 0]}%
1478 user{/Subtype /Link /A << /S /URI /URI (#1) >>}%
1479 \endgroup}
1480 \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}}
1481 \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
1482 \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks}
1483 \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}}
1484 \def\maketoks{%
1485 \expandafter\poptoks\the\toksA|ENDTOKS|\relax
1486 \ifx\first0\adn0
1487 \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3
1488 \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6
1489 \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9
1490 \else
1491 \ifnum0=\countA\else\makelink\fi
1492 \ifx\first.\let\next=\done\else
1493 \let\next=\maketoks
1494 \addtokens{\toksB}{\the\toksD}
1495 \ifx\first,\addtokens{\toksB}{\space}\fi
1497 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
1498 \next}
1499 \def\makelink{\addtokens{\toksB}%
1500 {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0}
1501 \def\pdflink#1{%
1502 \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}}
1503 \setcolor{\linkcolor}#1\endlink}
1504 \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
1505 \else
1506 % non-pdf mode
1507 \let\pdfmkdest = \gobble
1508 \let\pdfurl = \gobble
1509 \let\endlink = \relax
1510 \let\setcolor = \gobble
1511 \let\pdfsetcolor = \gobble
1512 \let\pdfmakeoutlines = \relax
1513 \fi % \ifx\pdfoutput
1516 % PDF outline support for XeTeX
1518 \ifx\XeTeXrevision\thisisundefined
1519 \else
1520 \pdfmakepagedesttrue \relax
1521 % Emulate the primitive of pdfTeX
1522 \def\pdfdest name#1 xyz{%
1523 \special{pdf:dest (name#1) [@thispage /XYZ @xpos @ypos]}%
1525 \def\pdfmkdest#1{{%
1526 % We have to set dummies so commands such as @code, and characters
1527 % such as \, aren't expanded when present in a section title.
1528 \indexnofonts % For avoiding UTF-16 convert issue of xdvipdfmx 20150315.
1529 \makevalueexpandable
1530 % In the case of XeTeX, xdvipdfmx converts strings to UTF-16.
1531 % Therefore \txiescapepdf is not necessary.
1532 \safewhatsit{\pdfdest name{#1} xyz}%
1535 \def\dopdfoutline#1#2#3#4{%
1536 \edef\pdfoutlinedest{#3}%
1537 \ifx\pdfoutlinedest\empty
1538 \def\pdfoutlinedest{#4}%
1541 \turnoffactive
1542 % In the case of XeTeX, xdvipdfmx converts strings to UTF-16.
1543 % Therefore \txiescapepdf is not necessary.
1544 \special{pdf:out [-] #2 << /Title (#1) /A << /S /GoTo /D (name\pdfoutlinedest) >> >> }%
1548 \def\pdfmakeoutlines{%
1549 \begingroup
1551 % In the case of XeTeX, counts of subentries is not necesary.
1552 % Therefore, read toc only once.
1554 % We use the node names as the destinations.
1555 \def\partentry##1##2##3##4{}% ignore parts in the outlines
1556 \def\numchapentry##1##2##3##4{%
1557 \dopdfoutline{##1}{1}{##3}{##4}}%
1558 \def\numsecentry##1##2##3##4{%
1559 \dopdfoutline{##1}{2}{##3}{##4}}%
1560 \def\numsubsecentry##1##2##3##4{%
1561 \dopdfoutline{##1}{3}{##3}{##4}}%
1562 \def\numsubsubsecentry##1##2##3##4{%
1563 \dopdfoutline{##1}{4}{##3}{##4}}%
1565 \let\appentry\numchapentry%
1566 \let\appsecentry\numsecentry%
1567 \let\appsubsecentry\numsubsecentry%
1568 \let\appsubsubsecentry\numsubsubsecentry%
1569 \let\unnchapentry\numchapentry%
1570 \let\unnsecentry\numsecentry%
1571 \let\unnsubsecentry\numsubsecentry%
1572 \let\unnsubsubsecentry\numsubsubsecentry%
1574 % In the case of XeTeX, xdvipdfmx converts strings to UTF-16.
1575 % Therefore, the encoding and the language may not be considered.
1577 \indexnofonts % For avoiding UTF-16 convert issue of xdvipdfmx 20150315.
1578 \setupdatafile
1579 % We can have normal brace characters in the PDF outlines, unlike
1580 % Texinfo index files. So set that up.
1581 \def\{{\lbracecharliteral}%
1582 \def\}{\rbracecharliteral}%
1583 \catcode`\\=\active \otherbackslash
1584 \input \tocreadfilename
1585 \endgroup
1587 {\catcode`[=1 \catcode`]=2
1588 \catcode`{=\other \catcode`}=\other
1589 \gdef\lbracecharliteral[{]%
1590 \gdef\rbracecharliteral[}]%
1593 \special{pdf:docview << /PageMode /UseOutlines >> }
1594 % ``\special{pdf:tounicode ...}'' is not necessary
1595 % because xdvipdfmx converts strings from UTF-8 to UTF-16 without it.
1596 % However, due to UTF-16 convert issue of xdvipdfmx 20150315,
1597 % ``\special{pdf:dest ...}'' can not handle non-ASCII strings.
1598 % It fixed by xdvipdfmx 20160106 (TeX Live SVN r39753).
1602 % @image support for XeTeX
1604 \newif\ifxeteximgpdf
1605 \ifx\XeTeXrevision\thisisundefined
1606 \else
1608 % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto).
1609 \def\doxeteximage#1#2#3{%
1610 \def\xeteximagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}%
1611 \def\xeteximageheight{#3}\setbox2 = \hbox{\ignorespaces #3}%
1613 % XeTeX (and the PDF format) support .pdf, .png, .jpg (among
1614 % others). Let's try in that order, PDF first since if
1615 % someone has a scalable image, presumably better to use that than a
1616 % bitmap.
1617 \let\xeteximgext=\empty
1618 \xeteximgpdffalse
1619 \begingroup
1620 \openin 1 #1.pdf \ifeof 1
1621 \openin 1 #1.PDF \ifeof 1
1622 \openin 1 #1.png \ifeof 1
1623 \openin 1 #1.jpg \ifeof 1
1624 \openin 1 #1.jpeg \ifeof 1
1625 \openin 1 #1.JPG \ifeof 1
1626 \errmessage{Could not find image file #1 for XeTeX}%
1627 \else \gdef\xeteximgext{JPG}%
1629 \else \gdef\xeteximgext{jpeg}%
1631 \else \gdef\xeteximgext{jpg}%
1633 \else \gdef\xeteximgext{png}%
1635 \else \gdef\xeteximgext{PDF} \global\xeteximgpdftrue%
1637 \else \gdef\xeteximgext{pdf} \global\xeteximgpdftrue%
1639 \closein 1
1640 \endgroup
1642 \ifxeteximgpdf
1643 \XeTeXpdffile "#1".\xeteximgext ""
1644 \else
1645 \XeTeXpicfile "#1".\xeteximgext ""
1647 \ifdim \wd0 >0pt width \xeteximagewidth \fi
1648 \ifdim \wd2 >0pt height \xeteximageheight \fi \relax
1652 \message{fonts,}
1654 % Change the current font style to #1, remembering it in \curfontstyle.
1655 % For now, we do not accumulate font styles: @b{@i{foo}} prints foo in
1656 % italics, not bold italics.
1658 \def\setfontstyle#1{%
1659 \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd.
1660 \csname ten#1\endcsname % change the current font
1663 % Select #1 fonts with the current style.
1665 \def\selectfonts#1{\csname #1fonts\endcsname \csname\curfontstyle\endcsname}
1667 \def\rm{\fam=0 \setfontstyle{rm}}
1668 \def\it{\fam=\itfam \setfontstyle{it}}
1669 \def\sl{\fam=\slfam \setfontstyle{sl}}
1670 \def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf}
1671 \def\tt{\fam=\ttfam \setfontstyle{tt}}
1673 % Unfortunately, we have to override this for titles and the like, since
1674 % in those cases "rm" is bold. Sigh.
1675 \def\rmisbold{\rm\def\curfontstyle{bf}}
1677 % Texinfo sort of supports the sans serif font style, which plain TeX does not.
1678 % So we set up a \sf.
1679 \newfam\sffam
1680 \def\sf{\fam=\sffam \setfontstyle{sf}}
1681 \let\li = \sf % Sometimes we call it \li, not \sf.
1683 % We don't need math for this font style.
1684 \def\ttsl{\setfontstyle{ttsl}}
1687 % Set the baselineskip to #1, and the lineskip and strut size
1688 % correspondingly. There is no deep meaning behind these magic numbers
1689 % used as factors; they just match (closely enough) what Knuth defined.
1691 \def\lineskipfactor{.08333}
1692 \def\strutheightpercent{.70833}
1693 \def\strutdepthpercent {.29167}
1695 % can get a sort of poor man's double spacing by redefining this.
1696 \def\baselinefactor{1}
1698 \newdimen\textleading
1699 \def\setleading#1{%
1700 \dimen0 = #1\relax
1701 \normalbaselineskip = \baselinefactor\dimen0
1702 \normallineskip = \lineskipfactor\normalbaselineskip
1703 \normalbaselines
1704 \setbox\strutbox =\hbox{%
1705 \vrule width0pt height\strutheightpercent\baselineskip
1706 depth \strutdepthpercent \baselineskip
1710 % PDF CMaps. See also LaTeX's t1.cmap.
1712 % do nothing with this by default.
1713 \expandafter\let\csname cmapOT1\endcsname\gobble
1714 \expandafter\let\csname cmapOT1IT\endcsname\gobble
1715 \expandafter\let\csname cmapOT1TT\endcsname\gobble
1717 % if we are producing pdf, and we have \pdffontattr, then define cmaps.
1718 % (\pdffontattr was introduced many years ago, but people still run
1719 % older pdftex's; it's easy to conditionalize, so we do.)
1720 \ifpdf \ifx\pdffontattr\thisisundefined \else
1721 \begingroup
1722 \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
1723 \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
1724 %%DocumentNeededResources: ProcSet (CIDInit)
1725 %%IncludeResource: ProcSet (CIDInit)
1726 %%BeginResource: CMap (TeX-OT1-0)
1727 %%Title: (TeX-OT1-0 TeX OT1 0)
1728 %%Version: 1.000
1729 %%EndComments
1730 /CIDInit /ProcSet findresource begin
1731 12 dict begin
1732 begincmap
1733 /CIDSystemInfo
1734 << /Registry (TeX)
1735 /Ordering (OT1)
1736 /Supplement 0
1737 >> def
1738 /CMapName /TeX-OT1-0 def
1739 /CMapType 2 def
1740 1 begincodespacerange
1741 <00> <7F>
1742 endcodespacerange
1743 8 beginbfrange
1744 <00> <01> <0393>
1745 <09> <0A> <03A8>
1746 <23> <26> <0023>
1747 <28> <3B> <0028>
1748 <3F> <5B> <003F>
1749 <5D> <5E> <005D>
1750 <61> <7A> <0061>
1751 <7B> <7C> <2013>
1752 endbfrange
1753 40 beginbfchar
1754 <02> <0398>
1755 <03> <039B>
1756 <04> <039E>
1757 <05> <03A0>
1758 <06> <03A3>
1759 <07> <03D2>
1760 <08> <03A6>
1761 <0B> <00660066>
1762 <0C> <00660069>
1763 <0D> <0066006C>
1764 <0E> <006600660069>
1765 <0F> <00660066006C>
1766 <10> <0131>
1767 <11> <0237>
1768 <12> <0060>
1769 <13> <00B4>
1770 <14> <02C7>
1771 <15> <02D8>
1772 <16> <00AF>
1773 <17> <02DA>
1774 <18> <00B8>
1775 <19> <00DF>
1776 <1A> <00E6>
1777 <1B> <0153>
1778 <1C> <00F8>
1779 <1D> <00C6>
1780 <1E> <0152>
1781 <1F> <00D8>
1782 <21> <0021>
1783 <22> <201D>
1784 <27> <2019>
1785 <3C> <00A1>
1786 <3D> <003D>
1787 <3E> <00BF>
1788 <5C> <201C>
1789 <5F> <02D9>
1790 <60> <2018>
1791 <7D> <02DD>
1792 <7E> <007E>
1793 <7F> <00A8>
1794 endbfchar
1795 endcmap
1796 CMapName currentdict /CMap defineresource pop
1799 %%EndResource
1800 %%EOF
1801 }\endgroup
1802 \expandafter\edef\csname cmapOT1\endcsname#1{%
1803 \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
1806 % \cmapOT1IT
1807 \begingroup
1808 \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
1809 \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
1810 %%DocumentNeededResources: ProcSet (CIDInit)
1811 %%IncludeResource: ProcSet (CIDInit)
1812 %%BeginResource: CMap (TeX-OT1IT-0)
1813 %%Title: (TeX-OT1IT-0 TeX OT1IT 0)
1814 %%Version: 1.000
1815 %%EndComments
1816 /CIDInit /ProcSet findresource begin
1817 12 dict begin
1818 begincmap
1819 /CIDSystemInfo
1820 << /Registry (TeX)
1821 /Ordering (OT1IT)
1822 /Supplement 0
1823 >> def
1824 /CMapName /TeX-OT1IT-0 def
1825 /CMapType 2 def
1826 1 begincodespacerange
1827 <00> <7F>
1828 endcodespacerange
1829 8 beginbfrange
1830 <00> <01> <0393>
1831 <09> <0A> <03A8>
1832 <25> <26> <0025>
1833 <28> <3B> <0028>
1834 <3F> <5B> <003F>
1835 <5D> <5E> <005D>
1836 <61> <7A> <0061>
1837 <7B> <7C> <2013>
1838 endbfrange
1839 42 beginbfchar
1840 <02> <0398>
1841 <03> <039B>
1842 <04> <039E>
1843 <05> <03A0>
1844 <06> <03A3>
1845 <07> <03D2>
1846 <08> <03A6>
1847 <0B> <00660066>
1848 <0C> <00660069>
1849 <0D> <0066006C>
1850 <0E> <006600660069>
1851 <0F> <00660066006C>
1852 <10> <0131>
1853 <11> <0237>
1854 <12> <0060>
1855 <13> <00B4>
1856 <14> <02C7>
1857 <15> <02D8>
1858 <16> <00AF>
1859 <17> <02DA>
1860 <18> <00B8>
1861 <19> <00DF>
1862 <1A> <00E6>
1863 <1B> <0153>
1864 <1C> <00F8>
1865 <1D> <00C6>
1866 <1E> <0152>
1867 <1F> <00D8>
1868 <21> <0021>
1869 <22> <201D>
1870 <23> <0023>
1871 <24> <00A3>
1872 <27> <2019>
1873 <3C> <00A1>
1874 <3D> <003D>
1875 <3E> <00BF>
1876 <5C> <201C>
1877 <5F> <02D9>
1878 <60> <2018>
1879 <7D> <02DD>
1880 <7E> <007E>
1881 <7F> <00A8>
1882 endbfchar
1883 endcmap
1884 CMapName currentdict /CMap defineresource pop
1887 %%EndResource
1888 %%EOF
1889 }\endgroup
1890 \expandafter\edef\csname cmapOT1IT\endcsname#1{%
1891 \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
1894 % \cmapOT1TT
1895 \begingroup
1896 \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
1897 \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
1898 %%DocumentNeededResources: ProcSet (CIDInit)
1899 %%IncludeResource: ProcSet (CIDInit)
1900 %%BeginResource: CMap (TeX-OT1TT-0)
1901 %%Title: (TeX-OT1TT-0 TeX OT1TT 0)
1902 %%Version: 1.000
1903 %%EndComments
1904 /CIDInit /ProcSet findresource begin
1905 12 dict begin
1906 begincmap
1907 /CIDSystemInfo
1908 << /Registry (TeX)
1909 /Ordering (OT1TT)
1910 /Supplement 0
1911 >> def
1912 /CMapName /TeX-OT1TT-0 def
1913 /CMapType 2 def
1914 1 begincodespacerange
1915 <00> <7F>
1916 endcodespacerange
1917 5 beginbfrange
1918 <00> <01> <0393>
1919 <09> <0A> <03A8>
1920 <21> <26> <0021>
1921 <28> <5F> <0028>
1922 <61> <7E> <0061>
1923 endbfrange
1924 32 beginbfchar
1925 <02> <0398>
1926 <03> <039B>
1927 <04> <039E>
1928 <05> <03A0>
1929 <06> <03A3>
1930 <07> <03D2>
1931 <08> <03A6>
1932 <0B> <2191>
1933 <0C> <2193>
1934 <0D> <0027>
1935 <0E> <00A1>
1936 <0F> <00BF>
1937 <10> <0131>
1938 <11> <0237>
1939 <12> <0060>
1940 <13> <00B4>
1941 <14> <02C7>
1942 <15> <02D8>
1943 <16> <00AF>
1944 <17> <02DA>
1945 <18> <00B8>
1946 <19> <00DF>
1947 <1A> <00E6>
1948 <1B> <0153>
1949 <1C> <00F8>
1950 <1D> <00C6>
1951 <1E> <0152>
1952 <1F> <00D8>
1953 <20> <2423>
1954 <27> <2019>
1955 <60> <2018>
1956 <7F> <00A8>
1957 endbfchar
1958 endcmap
1959 CMapName currentdict /CMap defineresource pop
1962 %%EndResource
1963 %%EOF
1964 }\endgroup
1965 \expandafter\edef\csname cmapOT1TT\endcsname#1{%
1966 \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
1968 \fi\fi
1971 % Set the font macro #1 to the font named \fontprefix#2.
1972 % #3 is the font's design size, #4 is a scale factor, #5 is the CMap
1973 % encoding (only OT1, OT1IT and OT1TT are allowed, or empty to omit).
1974 % Example:
1975 % #1 = \textrm
1976 % #2 = \rmshape
1977 % #3 = 10
1978 % #4 = \mainmagstep
1979 % #5 = OT1
1981 \def\setfont#1#2#3#4#5{%
1982 \font#1=\fontprefix#2#3 scaled #4
1983 \csname cmap#5\endcsname#1%
1985 % This is what gets called when #5 of \setfont is empty.
1986 \let\cmap\gobble
1988 % (end of cmaps)
1990 % Use cm as the default font prefix.
1991 % To specify the font prefix, you must define \fontprefix
1992 % before you read in texinfo.tex.
1993 \ifx\fontprefix\thisisundefined
1994 \def\fontprefix{cm}
1996 % Support font families that don't use the same naming scheme as CM.
1997 \def\rmshape{r}
1998 \def\rmbshape{bx} % where the normal face is bold
1999 \def\bfshape{b}
2000 \def\bxshape{bx}
2001 \def\ttshape{tt}
2002 \def\ttbshape{tt}
2003 \def\ttslshape{sltt}
2004 \def\itshape{ti}
2005 \def\itbshape{bxti}
2006 \def\slshape{sl}
2007 \def\slbshape{bxsl}
2008 \def\sfshape{ss}
2009 \def\sfbshape{ss}
2010 \def\scshape{csc}
2011 \def\scbshape{csc}
2013 % Definitions for a main text size of 11pt. (The default in Texinfo.)
2015 \def\definetextfontsizexi{%
2016 % Text fonts (11.2pt, magstep1).
2017 \def\textnominalsize{11pt}
2018 \edef\mainmagstep{\magstephalf}
2019 \setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
2020 \setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
2021 \setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
2022 \setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
2023 \setfont\textsl\slshape{10}{\mainmagstep}{OT1}
2024 \setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
2025 \setfont\textsc\scshape{10}{\mainmagstep}{OT1}
2026 \setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
2027 \font\texti=cmmi10 scaled \mainmagstep
2028 \font\textsy=cmsy10 scaled \mainmagstep
2029 \def\textecsize{1095}
2031 % A few fonts for @defun names and args.
2032 \setfont\defbf\bfshape{10}{\magstep1}{OT1}
2033 \setfont\deftt\ttshape{10}{\magstep1}{OT1TT}
2034 \setfont\defsl\slshape{10}{\magstep1}{OT1TT}
2035 \setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT}
2036 \def\df{\let\tentt=\deftt \let\tenbf = \defbf
2037 \let\tenttsl=\defttsl \let\tensl=\defsl \bf}
2039 % Fonts for indices, footnotes, small examples (9pt).
2040 \def\smallnominalsize{9pt}
2041 \setfont\smallrm\rmshape{9}{1000}{OT1}
2042 \setfont\smalltt\ttshape{9}{1000}{OT1TT}
2043 \setfont\smallbf\bfshape{10}{900}{OT1}
2044 \setfont\smallit\itshape{9}{1000}{OT1IT}
2045 \setfont\smallsl\slshape{9}{1000}{OT1}
2046 \setfont\smallsf\sfshape{9}{1000}{OT1}
2047 \setfont\smallsc\scshape{10}{900}{OT1}
2048 \setfont\smallttsl\ttslshape{10}{900}{OT1TT}
2049 \font\smalli=cmmi9
2050 \font\smallsy=cmsy9
2051 \def\smallecsize{0900}
2053 % Fonts for small examples (8pt).
2054 \def\smallernominalsize{8pt}
2055 \setfont\smallerrm\rmshape{8}{1000}{OT1}
2056 \setfont\smallertt\ttshape{8}{1000}{OT1TT}
2057 \setfont\smallerbf\bfshape{10}{800}{OT1}
2058 \setfont\smallerit\itshape{8}{1000}{OT1IT}
2059 \setfont\smallersl\slshape{8}{1000}{OT1}
2060 \setfont\smallersf\sfshape{8}{1000}{OT1}
2061 \setfont\smallersc\scshape{10}{800}{OT1}
2062 \setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
2063 \font\smalleri=cmmi8
2064 \font\smallersy=cmsy8
2065 \def\smallerecsize{0800}
2067 % Fonts for title page (20.4pt):
2068 \def\titlenominalsize{20pt}
2069 \setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
2070 \setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
2071 \setfont\titlesl\slbshape{10}{\magstep4}{OT1}
2072 \setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
2073 \setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
2074 \setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
2075 \let\titlebf=\titlerm
2076 \setfont\titlesc\scbshape{10}{\magstep4}{OT1}
2077 \font\titlei=cmmi12 scaled \magstep3
2078 \font\titlesy=cmsy10 scaled \magstep4
2079 \def\titleecsize{2074}
2081 % Chapter (and unnumbered) fonts (17.28pt).
2082 \def\chapnominalsize{17pt}
2083 \setfont\chaprm\rmbshape{12}{\magstep2}{OT1}
2084 \setfont\chapit\itbshape{10}{\magstep3}{OT1IT}
2085 \setfont\chapsl\slbshape{10}{\magstep3}{OT1}
2086 \setfont\chaptt\ttbshape{12}{\magstep2}{OT1TT}
2087 \setfont\chapttsl\ttslshape{10}{\magstep3}{OT1TT}
2088 \setfont\chapsf\sfbshape{17}{1000}{OT1}
2089 \let\chapbf=\chaprm
2090 \setfont\chapsc\scbshape{10}{\magstep3}{OT1}
2091 \font\chapi=cmmi12 scaled \magstep2
2092 \font\chapsy=cmsy10 scaled \magstep3
2093 \def\chapecsize{1728}
2095 % Section fonts (14.4pt).
2096 \def\secnominalsize{14pt}
2097 \setfont\secrm\rmbshape{12}{\magstep1}{OT1}
2098 \setfont\secrmnotbold\rmshape{12}{\magstep1}{OT1}
2099 \setfont\secit\itbshape{10}{\magstep2}{OT1IT}
2100 \setfont\secsl\slbshape{10}{\magstep2}{OT1}
2101 \setfont\sectt\ttbshape{12}{\magstep1}{OT1TT}
2102 \setfont\secttsl\ttslshape{10}{\magstep2}{OT1TT}
2103 \setfont\secsf\sfbshape{12}{\magstep1}{OT1}
2104 \let\secbf\secrm
2105 \setfont\secsc\scbshape{10}{\magstep2}{OT1}
2106 \font\seci=cmmi12 scaled \magstep1
2107 \font\secsy=cmsy10 scaled \magstep2
2108 \def\sececsize{1440}
2110 % Subsection fonts (13.15pt).
2111 \def\ssecnominalsize{13pt}
2112 \setfont\ssecrm\rmbshape{12}{\magstephalf}{OT1}
2113 \setfont\ssecit\itbshape{10}{1315}{OT1IT}
2114 \setfont\ssecsl\slbshape{10}{1315}{OT1}
2115 \setfont\ssectt\ttbshape{12}{\magstephalf}{OT1TT}
2116 \setfont\ssecttsl\ttslshape{10}{1315}{OT1TT}
2117 \setfont\ssecsf\sfbshape{12}{\magstephalf}{OT1}
2118 \let\ssecbf\ssecrm
2119 \setfont\ssecsc\scbshape{10}{1315}{OT1}
2120 \font\sseci=cmmi12 scaled \magstephalf
2121 \font\ssecsy=cmsy10 scaled 1315
2122 \def\ssececsize{1200}
2124 % Reduced fonts for @acro in text (10pt).
2125 \def\reducednominalsize{10pt}
2126 \setfont\reducedrm\rmshape{10}{1000}{OT1}
2127 \setfont\reducedtt\ttshape{10}{1000}{OT1TT}
2128 \setfont\reducedbf\bfshape{10}{1000}{OT1}
2129 \setfont\reducedit\itshape{10}{1000}{OT1IT}
2130 \setfont\reducedsl\slshape{10}{1000}{OT1}
2131 \setfont\reducedsf\sfshape{10}{1000}{OT1}
2132 \setfont\reducedsc\scshape{10}{1000}{OT1}
2133 \setfont\reducedttsl\ttslshape{10}{1000}{OT1TT}
2134 \font\reducedi=cmmi10
2135 \font\reducedsy=cmsy10
2136 \def\reducedecsize{1000}
2138 \textleading = 13.2pt % line spacing for 11pt CM
2139 \textfonts % reset the current fonts
2141 } % end of 11pt text font size definitions, \definetextfontsizexi
2144 % Definitions to make the main text be 10pt Computer Modern, with
2145 % section, chapter, etc., sizes following suit. This is for the GNU
2146 % Press printing of the Emacs 22 manual. Maybe other manuals in the
2147 % future. Used with @smallbook, which sets the leading to 12pt.
2149 \def\definetextfontsizex{%
2150 % Text fonts (10pt).
2151 \def\textnominalsize{10pt}
2152 \edef\mainmagstep{1000}
2153 \setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
2154 \setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
2155 \setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
2156 \setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
2157 \setfont\textsl\slshape{10}{\mainmagstep}{OT1}
2158 \setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
2159 \setfont\textsc\scshape{10}{\mainmagstep}{OT1}
2160 \setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
2161 \font\texti=cmmi10 scaled \mainmagstep
2162 \font\textsy=cmsy10 scaled \mainmagstep
2163 \def\textecsize{1000}
2165 % A few fonts for @defun names and args.
2166 \setfont\defbf\bfshape{10}{\magstephalf}{OT1}
2167 \setfont\deftt\ttshape{10}{\magstephalf}{OT1TT}
2168 \setfont\defsl\slshape{10}{\magstephalf}{OT1TT}
2169 \setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT}
2170 \def\df{\let\tentt=\deftt \let\tenbf = \defbf
2171 \let\tensl=\defsl \let\tenttsl=\defttsl \bf}
2173 % Fonts for indices, footnotes, small examples (9pt).
2174 \def\smallnominalsize{9pt}
2175 \setfont\smallrm\rmshape{9}{1000}{OT1}
2176 \setfont\smalltt\ttshape{9}{1000}{OT1TT}
2177 \setfont\smallbf\bfshape{10}{900}{OT1}
2178 \setfont\smallit\itshape{9}{1000}{OT1IT}
2179 \setfont\smallsl\slshape{9}{1000}{OT1}
2180 \setfont\smallsf\sfshape{9}{1000}{OT1}
2181 \setfont\smallsc\scshape{10}{900}{OT1}
2182 \setfont\smallttsl\ttslshape{10}{900}{OT1TT}
2183 \font\smalli=cmmi9
2184 \font\smallsy=cmsy9
2185 \def\smallecsize{0900}
2187 % Fonts for small examples (8pt).
2188 \def\smallernominalsize{8pt}
2189 \setfont\smallerrm\rmshape{8}{1000}{OT1}
2190 \setfont\smallertt\ttshape{8}{1000}{OT1TT}
2191 \setfont\smallerbf\bfshape{10}{800}{OT1}
2192 \setfont\smallerit\itshape{8}{1000}{OT1IT}
2193 \setfont\smallersl\slshape{8}{1000}{OT1}
2194 \setfont\smallersf\sfshape{8}{1000}{OT1}
2195 \setfont\smallersc\scshape{10}{800}{OT1}
2196 \setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
2197 \font\smalleri=cmmi8
2198 \font\smallersy=cmsy8
2199 \def\smallerecsize{0800}
2201 % Fonts for title page (20.4pt):
2202 \def\titlenominalsize{20pt}
2203 \setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
2204 \setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
2205 \setfont\titlesl\slbshape{10}{\magstep4}{OT1}
2206 \setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
2207 \setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
2208 \setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
2209 \let\titlebf=\titlerm
2210 \setfont\titlesc\scbshape{10}{\magstep4}{OT1}
2211 \font\titlei=cmmi12 scaled \magstep3
2212 \font\titlesy=cmsy10 scaled \magstep4
2213 \def\titleecsize{2074}
2215 % Chapter fonts (14.4pt).
2216 \def\chapnominalsize{14pt}
2217 \setfont\chaprm\rmbshape{12}{\magstep1}{OT1}
2218 \setfont\chapit\itbshape{10}{\magstep2}{OT1IT}
2219 \setfont\chapsl\slbshape{10}{\magstep2}{OT1}
2220 \setfont\chaptt\ttbshape{12}{\magstep1}{OT1TT}
2221 \setfont\chapttsl\ttslshape{10}{\magstep2}{OT1TT}
2222 \setfont\chapsf\sfbshape{12}{\magstep1}{OT1}
2223 \let\chapbf\chaprm
2224 \setfont\chapsc\scbshape{10}{\magstep2}{OT1}
2225 \font\chapi=cmmi12 scaled \magstep1
2226 \font\chapsy=cmsy10 scaled \magstep2
2227 \def\chapecsize{1440}
2229 % Section fonts (12pt).
2230 \def\secnominalsize{12pt}
2231 \setfont\secrm\rmbshape{12}{1000}{OT1}
2232 \setfont\secit\itbshape{10}{\magstep1}{OT1IT}
2233 \setfont\secsl\slbshape{10}{\magstep1}{OT1}
2234 \setfont\sectt\ttbshape{12}{1000}{OT1TT}
2235 \setfont\secttsl\ttslshape{10}{\magstep1}{OT1TT}
2236 \setfont\secsf\sfbshape{12}{1000}{OT1}
2237 \let\secbf\secrm
2238 \setfont\secsc\scbshape{10}{\magstep1}{OT1}
2239 \font\seci=cmmi12
2240 \font\secsy=cmsy10 scaled \magstep1
2241 \def\sececsize{1200}
2243 % Subsection fonts (10pt).
2244 \def\ssecnominalsize{10pt}
2245 \setfont\ssecrm\rmbshape{10}{1000}{OT1}
2246 \setfont\ssecit\itbshape{10}{1000}{OT1IT}
2247 \setfont\ssecsl\slbshape{10}{1000}{OT1}
2248 \setfont\ssectt\ttbshape{10}{1000}{OT1TT}
2249 \setfont\ssecttsl\ttslshape{10}{1000}{OT1TT}
2250 \setfont\ssecsf\sfbshape{10}{1000}{OT1}
2251 \let\ssecbf\ssecrm
2252 \setfont\ssecsc\scbshape{10}{1000}{OT1}
2253 \font\sseci=cmmi10
2254 \font\ssecsy=cmsy10
2255 \def\ssececsize{1000}
2257 % Reduced fonts for @acro in text (9pt).
2258 \def\reducednominalsize{9pt}
2259 \setfont\reducedrm\rmshape{9}{1000}{OT1}
2260 \setfont\reducedtt\ttshape{9}{1000}{OT1TT}
2261 \setfont\reducedbf\bfshape{10}{900}{OT1}
2262 \setfont\reducedit\itshape{9}{1000}{OT1IT}
2263 \setfont\reducedsl\slshape{9}{1000}{OT1}
2264 \setfont\reducedsf\sfshape{9}{1000}{OT1}
2265 \setfont\reducedsc\scshape{10}{900}{OT1}
2266 \setfont\reducedttsl\ttslshape{10}{900}{OT1TT}
2267 \font\reducedi=cmmi9
2268 \font\reducedsy=cmsy9
2269 \def\reducedecsize{0900}
2271 \divide\parskip by 2 % reduce space between paragraphs
2272 \textleading = 12pt % line spacing for 10pt CM
2273 \textfonts % reset the current fonts
2275 } % end of 10pt text font size definitions, \definetextfontsizex
2278 % We provide the user-level command
2279 % @fonttextsize 10
2280 % (or 11) to redefine the text font size. pt is assumed.
2282 \def\xiword{11}
2283 \def\xword{10}
2284 \def\xwordpt{10pt}
2286 \parseargdef\fonttextsize{%
2287 \def\textsizearg{#1}%
2288 %\wlog{doing @fonttextsize \textsizearg}%
2290 % Set \globaldefs so that documents can use this inside @tex, since
2291 % makeinfo 4.8 does not support it, but we need it nonetheless.
2293 \begingroup \globaldefs=1
2294 \ifx\textsizearg\xword \definetextfontsizex
2295 \else \ifx\textsizearg\xiword \definetextfontsizexi
2296 \else
2297 \errhelp=\EMsimple
2298 \errmessage{@fonttextsize only supports `10' or `11', not `\textsizearg'}
2299 \fi\fi
2300 \endgroup
2303 % In order for the font changes to affect most math symbols and letters,
2304 % we have to define the \textfont of the standard families. We don't
2305 % bother to reset \scriptfont and \scriptscriptfont; awaiting user need.
2307 \def\resetmathfonts{%
2308 \textfont0=\tenrm \textfont1=\teni \textfont2=\tensy
2309 \textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf
2310 \textfont\ttfam=\tentt \textfont\sffam=\tensf
2313 % The font-changing commands redefine the meanings of \tenSTYLE, instead
2314 % of just \STYLE. We do this because \STYLE needs to also set the
2315 % current \fam for math mode. Our \STYLE (e.g., \rm) commands hardwire
2316 % \tenSTYLE to set the current font.
2318 % Each font-changing command also sets the names \lsize (one size lower)
2319 % and \lllsize (three sizes lower). These relative commands are used
2320 % in, e.g., the LaTeX logo and acronyms.
2322 % This all needs generalizing, badly.
2324 \def\textfonts{%
2325 \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl
2326 \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
2327 \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy
2328 \let\tenttsl=\textttsl
2329 \def\curfontsize{text}%
2330 \def\lsize{reduced}\def\lllsize{smaller}%
2331 \resetmathfonts \setleading{\textleading}}
2332 \def\titlefonts{%
2333 \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl
2334 \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc
2335 \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy
2336 \let\tenttsl=\titlettsl
2337 \def\curfontsize{title}%
2338 \def\lsize{chap}\def\lllsize{subsec}%
2339 \resetmathfonts \setleading{27pt}}
2340 \def\titlefont#1{{\titlefonts\rmisbold #1}}
2341 \def\chapfonts{%
2342 \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
2343 \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
2344 \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy
2345 \let\tenttsl=\chapttsl
2346 \def\curfontsize{chap}%
2347 \def\lsize{sec}\def\lllsize{text}%
2348 \resetmathfonts \setleading{19pt}}
2349 \def\secfonts{%
2350 \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl
2351 \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc
2352 \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy
2353 \let\tenttsl=\secttsl
2354 \def\curfontsize{sec}%
2355 \def\lsize{subsec}\def\lllsize{reduced}%
2356 \resetmathfonts \setleading{17pt}}
2357 \def\subsecfonts{%
2358 \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl
2359 \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc
2360 \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy
2361 \let\tenttsl=\ssecttsl
2362 \def\curfontsize{ssec}%
2363 \def\lsize{text}\def\lllsize{small}%
2364 \resetmathfonts \setleading{15pt}}
2365 \let\subsubsecfonts = \subsecfonts
2366 \def\reducedfonts{%
2367 \let\tenrm=\reducedrm \let\tenit=\reducedit \let\tensl=\reducedsl
2368 \let\tenbf=\reducedbf \let\tentt=\reducedtt \let\reducedcaps=\reducedsc
2369 \let\tensf=\reducedsf \let\teni=\reducedi \let\tensy=\reducedsy
2370 \let\tenttsl=\reducedttsl
2371 \def\curfontsize{reduced}%
2372 \def\lsize{small}\def\lllsize{smaller}%
2373 \resetmathfonts \setleading{10.5pt}}
2374 \def\smallfonts{%
2375 \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl
2376 \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc
2377 \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy
2378 \let\tenttsl=\smallttsl
2379 \def\curfontsize{small}%
2380 \def\lsize{smaller}\def\lllsize{smaller}%
2381 \resetmathfonts \setleading{10.5pt}}
2382 \def\smallerfonts{%
2383 \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl
2384 \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc
2385 \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy
2386 \let\tenttsl=\smallerttsl
2387 \def\curfontsize{smaller}%
2388 \def\lsize{smaller}\def\lllsize{smaller}%
2389 \resetmathfonts \setleading{9.5pt}}
2391 % Fonts for short table of contents.
2392 \setfont\shortcontrm\rmshape{12}{1000}{OT1}
2393 \setfont\shortcontbf\bfshape{10}{\magstep1}{OT1} % no cmb12
2394 \setfont\shortcontsl\slshape{12}{1000}{OT1}
2395 \setfont\shortconttt\ttshape{12}{1000}{OT1TT}
2397 % Define these just so they can be easily changed for other fonts.
2398 \def\angleleft{$\langle$}
2399 \def\angleright{$\rangle$}
2401 % Set the fonts to use with the @small... environments.
2402 \let\smallexamplefonts = \smallfonts
2404 % About \smallexamplefonts. If we use \smallfonts (9pt), @smallexample
2405 % can fit this many characters:
2406 % 8.5x11=86 smallbook=72 a4=90 a5=69
2407 % If we use \scriptfonts (8pt), then we can fit this many characters:
2408 % 8.5x11=90+ smallbook=80 a4=90+ a5=77
2409 % For me, subjectively, the few extra characters that fit aren't worth
2410 % the additional smallness of 8pt. So I'm making the default 9pt.
2412 % By the way, for comparison, here's what fits with @example (10pt):
2413 % 8.5x11=71 smallbook=60 a4=75 a5=58
2414 % --karl, 24jan03.
2416 % Set up the default fonts, so we can use them for creating boxes.
2418 \definetextfontsizexi
2421 \message{markup,}
2423 % Check if we are currently using a typewriter font. Since all the
2424 % Computer Modern typewriter fonts have zero interword stretch (and
2425 % shrink), and it is reasonable to expect all typewriter fonts to have
2426 % this property, we can check that font parameter.
2428 \def\ifmonospace{\ifdim\fontdimen3\font=0pt }
2430 % Markup style infrastructure. \defmarkupstylesetup\INITMACRO will
2431 % define and register \INITMACRO to be called on markup style changes.
2432 % \INITMACRO can check \currentmarkupstyle for the innermost
2433 % style and the set of \ifmarkupSTYLE switches for all styles
2434 % currently in effect.
2435 \newif\ifmarkupvar
2436 \newif\ifmarkupsamp
2437 \newif\ifmarkupkey
2438 %\newif\ifmarkupfile % @file == @samp.
2439 %\newif\ifmarkupoption % @option == @samp.
2440 \newif\ifmarkupcode
2441 \newif\ifmarkupkbd
2442 %\newif\ifmarkupenv % @env == @code.
2443 %\newif\ifmarkupcommand % @command == @code.
2444 \newif\ifmarkuptex % @tex (and part of @math, for now).
2445 \newif\ifmarkupexample
2446 \newif\ifmarkupverb
2447 \newif\ifmarkupverbatim
2449 \let\currentmarkupstyle\empty
2451 \def\setupmarkupstyle#1{%
2452 \csname markup#1true\endcsname
2453 \def\currentmarkupstyle{#1}%
2454 \markupstylesetup
2457 \let\markupstylesetup\empty
2459 \def\defmarkupstylesetup#1{%
2460 \expandafter\def\expandafter\markupstylesetup
2461 \expandafter{\markupstylesetup #1}%
2462 \def#1%
2465 % Markup style setup for left and right quotes.
2466 \defmarkupstylesetup\markupsetuplq{%
2467 \expandafter\let\expandafter \temp
2468 \csname markupsetuplq\currentmarkupstyle\endcsname
2469 \ifx\temp\relax \markupsetuplqdefault \else \temp \fi
2472 \defmarkupstylesetup\markupsetuprq{%
2473 \expandafter\let\expandafter \temp
2474 \csname markupsetuprq\currentmarkupstyle\endcsname
2475 \ifx\temp\relax \markupsetuprqdefault \else \temp \fi
2479 \catcode`\'=\active
2480 \catcode`\`=\active
2482 \gdef\markupsetuplqdefault{\let`\lq}
2483 \gdef\markupsetuprqdefault{\let'\rq}
2485 \gdef\markupsetcodequoteleft{\let`\codequoteleft}
2486 \gdef\markupsetcodequoteright{\let'\codequoteright}
2489 \let\markupsetuplqcode \markupsetcodequoteleft
2490 \let\markupsetuprqcode \markupsetcodequoteright
2492 \let\markupsetuplqexample \markupsetcodequoteleft
2493 \let\markupsetuprqexample \markupsetcodequoteright
2495 \let\markupsetuplqkbd \markupsetcodequoteleft
2496 \let\markupsetuprqkbd \markupsetcodequoteright
2498 \let\markupsetuplqsamp \markupsetcodequoteleft
2499 \let\markupsetuprqsamp \markupsetcodequoteright
2501 \let\markupsetuplqverb \markupsetcodequoteleft
2502 \let\markupsetuprqverb \markupsetcodequoteright
2504 \let\markupsetuplqverbatim \markupsetcodequoteleft
2505 \let\markupsetuprqverbatim \markupsetcodequoteright
2507 % Allow an option to not use regular directed right quote/apostrophe
2508 % (char 0x27), but instead the undirected quote from cmtt (char 0x0d).
2509 % The undirected quote is ugly, so don't make it the default, but it
2510 % works for pasting with more pdf viewers (at least evince), the
2511 % lilypond developers report. xpdf does work with the regular 0x27.
2513 \def\codequoteright{%
2514 \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax
2515 \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax
2517 \else \char'15 \fi
2518 \else \char'15 \fi
2521 % and a similar option for the left quote char vs. a grave accent.
2522 % Modern fonts display ASCII 0x60 as a grave accent, so some people like
2523 % the code environments to do likewise.
2525 \def\codequoteleft{%
2526 \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax
2527 \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax
2528 % [Knuth] pp. 380,381,391
2529 % \relax disables Spanish ligatures ?` and !` of \tt font.
2530 \relax`%
2531 \else \char'22 \fi
2532 \else \char'22 \fi
2535 % Commands to set the quote options.
2537 \parseargdef\codequoteundirected{%
2538 \def\temp{#1}%
2539 \ifx\temp\onword
2540 \expandafter\let\csname SETtxicodequoteundirected\endcsname
2541 = t%
2542 \else\ifx\temp\offword
2543 \expandafter\let\csname SETtxicodequoteundirected\endcsname
2544 = \relax
2545 \else
2546 \errhelp = \EMsimple
2547 \errmessage{Unknown @codequoteundirected value `\temp', must be on|off}%
2548 \fi\fi
2551 \parseargdef\codequotebacktick{%
2552 \def\temp{#1}%
2553 \ifx\temp\onword
2554 \expandafter\let\csname SETtxicodequotebacktick\endcsname
2555 = t%
2556 \else\ifx\temp\offword
2557 \expandafter\let\csname SETtxicodequotebacktick\endcsname
2558 = \relax
2559 \else
2560 \errhelp = \EMsimple
2561 \errmessage{Unknown @codequotebacktick value `\temp', must be on|off}%
2562 \fi\fi
2565 % [Knuth] pp. 380,381,391, disable Spanish ligatures ?` and !` of \tt font.
2566 \def\noligaturesquoteleft{\relax\lq}
2568 % Count depth in font-changes, for error checks
2569 \newcount\fontdepth \fontdepth=0
2571 % Font commands.
2573 % #1 is the font command (\sl or \it), #2 is the text to slant.
2574 % If we are in a monospaced environment, however, 1) always use \ttsl,
2575 % and 2) do not add an italic correction.
2576 \def\dosmartslant#1#2{%
2577 \ifusingtt
2578 {{\ttsl #2}\let\next=\relax}%
2579 {\def\next{{#1#2}\futurelet\next\smartitaliccorrection}}%
2580 \next
2582 \def\smartslanted{\dosmartslant\sl}
2583 \def\smartitalic{\dosmartslant\it}
2585 % Output an italic correction unless \next (presumed to be the following
2586 % character) is such as not to need one.
2587 \def\smartitaliccorrection{%
2588 \ifx\next,%
2589 \else\ifx\next-%
2590 \else\ifx\next.%
2591 \else\ifx\next\.%
2592 \else\ifx\next\comma%
2593 \else\ptexslash
2594 \fi\fi\fi\fi\fi
2595 \aftersmartic
2598 % Unconditional use \ttsl, and no ic. @var is set to this for defuns.
2599 \def\ttslanted#1{{\ttsl #1}}
2601 % @cite is like \smartslanted except unconditionally use \sl. We never want
2602 % ttsl for book titles, do we?
2603 \def\cite#1{{\sl #1}\futurelet\next\smartitaliccorrection}
2605 \def\aftersmartic{}
2606 \def\var#1{%
2607 \let\saveaftersmartic = \aftersmartic
2608 \def\aftersmartic{\null\let\aftersmartic=\saveaftersmartic}%
2609 \smartslanted{#1}%
2612 \let\i=\smartitalic
2613 \let\slanted=\smartslanted
2614 \let\dfn=\smartslanted
2615 \let\emph=\smartitalic
2617 % Explicit font changes: @r, @sc, undocumented @ii.
2618 \def\r#1{{\rm #1}} % roman font
2619 \def\sc#1{{\smallcaps#1}} % smallcaps font
2620 \def\ii#1{{\it #1}} % italic font
2622 % @b, explicit bold. Also @strong.
2623 \def\b#1{{\bf #1}}
2624 \let\strong=\b
2626 % @sansserif, explicit sans.
2627 \def\sansserif#1{{\sf #1}}
2629 % We can't just use \exhyphenpenalty, because that only has effect at
2630 % the end of a paragraph. Restore normal hyphenation at the end of the
2631 % group within which \nohyphenation is presumably called.
2633 \def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation}
2634 \def\restorehyphenation{\hyphenchar\font = `- }
2636 % Set sfcode to normal for the chars that usually have another value.
2637 % Can't use plain's \frenchspacing because it uses the `\x notation, and
2638 % sometimes \x has an active definition that messes things up.
2640 \catcode`@=11
2641 \def\plainfrenchspacing{%
2642 \sfcode`\.=\@m \sfcode`\?=\@m \sfcode`\!=\@m
2643 \sfcode`\:=\@m \sfcode`\;=\@m \sfcode`\,=\@m
2644 \def\endofsentencespacefactor{1000}% for @. and friends
2646 \def\plainnonfrenchspacing{%
2647 \sfcode`\.3000\sfcode`\?3000\sfcode`\!3000
2648 \sfcode`\:2000\sfcode`\;1500\sfcode`\,1250
2649 \def\endofsentencespacefactor{3000}% for @. and friends
2651 \catcode`@=\other
2652 \def\endofsentencespacefactor{3000}% default
2654 % @t, explicit typewriter.
2655 \def\t#1{%
2656 {\tt \rawbackslash \plainfrenchspacing #1}%
2657 \null
2660 % @samp.
2661 \def\samp#1{{\setupmarkupstyle{samp}\lq\tclose{#1}\rq\null}}
2663 % @indicateurl is \samp, that is, with quotes.
2664 \let\indicateurl=\samp
2666 % @code (and similar) prints in typewriter, but with spaces the same
2667 % size as normal in the surrounding text, without hyphenation, etc.
2668 % This is a subroutine for that.
2669 \def\tclose#1{%
2671 % Change normal interword space to be same as for the current font.
2672 \spaceskip = \fontdimen2\font
2674 % Switch to typewriter.
2677 % But `\ ' produces the large typewriter interword space.
2678 \def\ {{\spaceskip = 0pt{} }}%
2680 % Turn off hyphenation.
2681 \nohyphenation
2683 \rawbackslash
2684 \plainfrenchspacing
2687 \null % reset spacefactor to 1000
2690 % We *must* turn on hyphenation at `-' and `_' in @code.
2691 % (But see \codedashfinish below.)
2692 % Otherwise, it is too hard to avoid overfull hboxes
2693 % in the Emacs manual, the Library manual, etc.
2695 % Unfortunately, TeX uses one parameter (\hyphenchar) to control
2696 % both hyphenation at - and hyphenation within words.
2697 % We must therefore turn them both off (\tclose does that)
2698 % and arrange explicitly to hyphenate at a dash. -- rms.
2700 \catcode`\-=\active \catcode`\_=\active
2701 \catcode`\'=\active \catcode`\`=\active
2702 \global\let'=\rq \global\let`=\lq % default definitions
2704 \global\def\code{\begingroup
2705 \setupmarkupstyle{code}%
2706 % The following should really be moved into \setupmarkupstyle handlers.
2707 \catcode\dashChar=\active \catcode\underChar=\active
2708 \ifallowcodebreaks
2709 \let-\codedash
2710 \let_\codeunder
2711 \else
2712 \let-\normaldash
2713 \let_\realunder
2715 % Given -foo (with a single dash), we do not want to allow a break
2716 % after the hyphen.
2717 \global\let\codedashprev=\codedash
2719 \codex
2722 \gdef\codedash{\futurelet\next\codedashfinish}
2723 \gdef\codedashfinish{%
2724 \normaldash % always output the dash character itself.
2726 % Now, output a discretionary to allow a line break, unless
2727 % (a) the next character is a -, or
2728 % (b) the preceding character is a -.
2729 % E.g., given --posix, we do not want to allow a break after either -.
2730 % Given --foo-bar, we do want to allow a break between the - and the b.
2731 \ifx\next\codedash \else
2732 \ifx\codedashprev\codedash
2733 \else \discretionary{}{}{}\fi
2735 % we need the space after the = for the case when \next itself is a
2736 % space token; it would get swallowed otherwise. As in @code{- a}.
2737 \global\let\codedashprev= \next
2740 \def\normaldash{-}
2742 \def\codex #1{\tclose{#1}\endgroup}
2744 \def\codeunder{%
2745 % this is all so @math{@code{var_name}+1} can work. In math mode, _
2746 % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.)
2747 % will therefore expand the active definition of _, which is us
2748 % (inside @code that is), therefore an endless loop.
2749 \ifusingtt{\ifmmode
2750 \mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_.
2751 \else\normalunderscore \fi
2752 \discretionary{}{}{}}%
2753 {\_}%
2756 % An additional complication: the above will allow breaks after, e.g.,
2757 % each of the four underscores in __typeof__. This is bad.
2758 % @allowcodebreaks provides a document-level way to turn breaking at -
2759 % and _ on and off.
2761 \newif\ifallowcodebreaks \allowcodebreakstrue
2763 \def\keywordtrue{true}
2764 \def\keywordfalse{false}
2766 \parseargdef\allowcodebreaks{%
2767 \def\txiarg{#1}%
2768 \ifx\txiarg\keywordtrue
2769 \allowcodebreakstrue
2770 \else\ifx\txiarg\keywordfalse
2771 \allowcodebreaksfalse
2772 \else
2773 \errhelp = \EMsimple
2774 \errmessage{Unknown @allowcodebreaks option `\txiarg', must be true|false}%
2775 \fi\fi
2778 % For @command, @env, @file, @option quotes seem unnecessary,
2779 % so use \code rather than \samp.
2780 \let\command=\code
2781 \let\env=\code
2782 \let\file=\code
2783 \let\option=\code
2785 % @uref (abbreviation for `urlref') aka @url takes an optional
2786 % (comma-separated) second argument specifying the text to display and
2787 % an optional third arg as text to display instead of (rather than in
2788 % addition to) the url itself. First (mandatory) arg is the url.
2790 % TeX-only option to allow changing PDF output to show only the second
2791 % arg (if given), and not the url (which is then just the link target).
2792 \newif\ifurefurlonlylink
2794 % The main macro is \urefbreak, which allows breaking at expected
2795 % places within the url. (There used to be another version, which
2796 % didn't support automatic breaking.)
2797 \def\urefbreak{\begingroup \urefcatcodes \dourefbreak}
2798 \let\uref=\urefbreak
2800 \def\dourefbreak#1{\urefbreakfinish #1,,,\finish}
2801 \def\urefbreakfinish#1,#2,#3,#4\finish{% doesn't work in @example
2802 \unsepspaces
2803 \pdfurl{#1}%
2804 \setbox0 = \hbox{\ignorespaces #3}%
2805 \ifdim\wd0 > 0pt
2806 \unhbox0 % third arg given, show only that
2807 \else
2808 \setbox0 = \hbox{\ignorespaces #2}% look for second arg
2809 \ifdim\wd0 > 0pt
2810 \ifpdf
2811 \ifurefurlonlylink
2812 % PDF plus option to not display url, show just arg
2813 \unhbox0
2814 \else
2815 % PDF, normally display both arg and url for consistency,
2816 % visibility, if the pdf is eventually used to print, etc.
2817 \unhbox0\ (\urefcode{#1})%
2819 \else
2820 \unhbox0\ (\urefcode{#1})% DVI, always show arg and url
2822 \else
2823 \urefcode{#1}% only url given, so show it
2826 \endlink
2827 \endgroup}
2829 % Allow line breaks around only a few characters (only).
2830 \def\urefcatcodes{%
2831 \catcode`\&=\active \catcode`\.=\active
2832 \catcode`\#=\active \catcode`\?=\active
2833 \catcode`\/=\active
2836 \urefcatcodes
2838 \global\def\urefcode{\begingroup
2839 \setupmarkupstyle{code}%
2840 \urefcatcodes
2841 \let&\urefcodeamp
2842 \let.\urefcodedot
2843 \let#\urefcodehash
2844 \let?\urefcodequest
2845 \let/\urefcodeslash
2846 \codex
2849 % By default, they are just regular characters.
2850 \global\def&{\normalamp}
2851 \global\def.{\normaldot}
2852 \global\def#{\normalhash}
2853 \global\def?{\normalquest}
2854 \global\def/{\normalslash}
2857 % we put a little stretch before and after the breakable chars, to help
2858 % line breaking of long url's. The unequal skips make look better in
2859 % cmtt at least, especially for dots.
2860 \def\urefprestretchamount{.13em}
2861 \def\urefpoststretchamount{.1em}
2862 \def\urefprestretch{\urefprebreak \hskip0pt plus\urefprestretchamount\relax}
2863 \def\urefpoststretch{\urefpostbreak \hskip0pt plus\urefprestretchamount\relax}
2865 \def\urefcodeamp{\urefprestretch \&\urefpoststretch}
2866 \def\urefcodedot{\urefprestretch .\urefpoststretch}
2867 \def\urefcodehash{\urefprestretch \#\urefpoststretch}
2868 \def\urefcodequest{\urefprestretch ?\urefpoststretch}
2869 \def\urefcodeslash{\futurelet\next\urefcodeslashfinish}
2871 \catcode`\/=\active
2872 \global\def\urefcodeslashfinish{%
2873 \urefprestretch \slashChar
2874 % Allow line break only after the final / in a sequence of
2875 % slashes, to avoid line break between the slashes in http://.
2876 \ifx\next/\else \urefpoststretch \fi
2880 % One more complication: by default we'll break after the special
2881 % characters, but some people like to break before the special chars, so
2882 % allow that. Also allow no breaking at all, for manual control.
2884 \parseargdef\urefbreakstyle{%
2885 \def\txiarg{#1}%
2886 \ifx\txiarg\wordnone
2887 \def\urefprebreak{\nobreak}\def\urefpostbreak{\nobreak}
2888 \else\ifx\txiarg\wordbefore
2889 \def\urefprebreak{\allowbreak}\def\urefpostbreak{\nobreak}
2890 \else\ifx\txiarg\wordafter
2891 \def\urefprebreak{\nobreak}\def\urefpostbreak{\allowbreak}
2892 \else
2893 \errhelp = \EMsimple
2894 \errmessage{Unknown @urefbreakstyle setting `\txiarg'}%
2895 \fi\fi\fi
2897 \def\wordafter{after}
2898 \def\wordbefore{before}
2899 \def\wordnone{none}
2901 \urefbreakstyle after
2903 % @url synonym for @uref, since that's how everyone uses it.
2905 \let\url=\uref
2907 % rms does not like angle brackets --karl, 17may97.
2908 % So now @email is just like @uref, unless we are pdf.
2910 %\def\email#1{\angleleft{\tt #1}\angleright}
2911 \ifpdf
2912 \def\email#1{\doemail#1,,\finish}
2913 \def\doemail#1,#2,#3\finish{\begingroup
2914 \unsepspaces
2915 \pdfurl{mailto:#1}%
2916 \setbox0 = \hbox{\ignorespaces #2}%
2917 \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi
2918 \endlink
2919 \endgroup}
2920 \else
2921 \let\email=\uref
2924 % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
2925 % `example' (@kbd uses ttsl only inside of @example and friends),
2926 % or `code' (@kbd uses normal tty font always).
2927 \parseargdef\kbdinputstyle{%
2928 \def\txiarg{#1}%
2929 \ifx\txiarg\worddistinct
2930 \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
2931 \else\ifx\txiarg\wordexample
2932 \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
2933 \else\ifx\txiarg\wordcode
2934 \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
2935 \else
2936 \errhelp = \EMsimple
2937 \errmessage{Unknown @kbdinputstyle setting `\txiarg'}%
2938 \fi\fi\fi
2940 \def\worddistinct{distinct}
2941 \def\wordexample{example}
2942 \def\wordcode{code}
2944 % Default is `distinct'.
2945 \kbdinputstyle distinct
2947 % @kbd is like @code, except that if the argument is just one @key command,
2948 % then @kbd has no effect.
2949 \def\kbd#1{{\def\look{#1}\expandafter\kbdsub\look??\par}}
2951 \def\xkey{\key}
2952 \def\kbdsub#1#2#3\par{%
2953 \def\one{#1}\def\three{#3}\def\threex{??}%
2954 \ifx\one\xkey\ifx\threex\three \key{#2}%
2955 \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi
2956 \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi
2959 % definition of @key that produces a lozenge. Doesn't adjust to text size.
2960 %\setfont\keyrm\rmshape{8}{1000}{OT1}
2961 %\font\keysy=cmsy9
2962 %\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{%
2963 % \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
2964 % \vbox{\hrule\kern-0.4pt
2965 % \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
2966 % \kern-0.4pt\hrule}%
2967 % \kern-.06em\raise0.4pt\hbox{\angleright}}}}
2969 % definition of @key with no lozenge. If the current font is already
2970 % monospace, don't change it; that way, we respect @kbdinputstyle. But
2971 % if it isn't monospace, then use \tt.
2973 \def\key#1{{\setupmarkupstyle{key}%
2974 \nohyphenation
2975 \ifmonospace\else\tt\fi
2976 #1}\null}
2978 % @clicksequence{File @click{} Open ...}
2979 \def\clicksequence#1{\begingroup #1\endgroup}
2981 % @clickstyle @arrow (by default)
2982 \parseargdef\clickstyle{\def\click{#1}}
2983 \def\click{\arrow}
2985 % Typeset a dimension, e.g., `in' or `pt'. The only reason for the
2986 % argument is to make the input look right: @dmn{pt} instead of @dmn{}pt.
2988 \def\dmn#1{\thinspace #1}
2990 % @acronym for "FBI", "NATO", and the like.
2991 % We print this one point size smaller, since it's intended for
2992 % all-uppercase.
2994 \def\acronym#1{\doacronym #1,,\finish}
2995 \def\doacronym#1,#2,#3\finish{%
2996 {\selectfonts\lsize #1}%
2997 \def\temp{#2}%
2998 \ifx\temp\empty \else
2999 \space ({\unsepspaces \ignorespaces \temp \unskip})%
3001 \null % reset \spacefactor=1000
3004 % @abbr for "Comput. J." and the like.
3005 % No font change, but don't do end-of-sentence spacing.
3007 \def\abbr#1{\doabbr #1,,\finish}
3008 \def\doabbr#1,#2,#3\finish{%
3009 {\plainfrenchspacing #1}%
3010 \def\temp{#2}%
3011 \ifx\temp\empty \else
3012 \space ({\unsepspaces \ignorespaces \temp \unskip})%
3014 \null % reset \spacefactor=1000
3017 % @asis just yields its argument. Used with @table, for example.
3019 \def\asis#1{#1}
3021 % @math outputs its argument in math mode.
3023 % One complication: _ usually means subscripts, but it could also mean
3024 % an actual _ character, as in @math{@var{some_variable} + 1}. So make
3025 % _ active, and distinguish by seeing if the current family is \slfam,
3026 % which is what @var uses.
3028 \catcode`\_ = \active
3029 \gdef\mathunderscore{%
3030 \catcode`\_=\active
3031 \def_{\ifnum\fam=\slfam \_\else\sb\fi}%
3034 % Another complication: we want \\ (and @\) to output a math (or tt) \.
3035 % FYI, plain.tex uses \\ as a temporary control sequence (for no
3036 % particular reason), but this is not advertised and we don't care.
3038 % The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.
3039 \def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi}
3041 \def\math{%
3042 \ifmmode\else % only go into math if not in math mode already
3043 \tex
3044 \mathunderscore
3045 \let\\ = \mathbackslash
3046 \mathactive
3047 % make the texinfo accent commands work in math mode
3048 \let\"=\ddot
3049 \let\'=\acute
3050 \let\==\bar
3051 \let\^=\hat
3052 \let\`=\grave
3053 \let\u=\breve
3054 \let\v=\check
3055 \let\~=\tilde
3056 \let\dotaccent=\dot
3057 % have to provide another name for sup operator
3058 \let\mathopsup=\sup
3059 $\expandafter\finishmath\fi
3061 \def\finishmath#1{#1$\endgroup} % Close the group opened by \tex.
3063 % Some active characters (such as <) are spaced differently in math.
3064 % We have to reset their definitions in case the @math was an argument
3065 % to a command which sets the catcodes (such as @item or @section).
3068 \catcode`^ = \active
3069 \catcode`< = \active
3070 \catcode`> = \active
3071 \catcode`+ = \active
3072 \catcode`' = \active
3073 \gdef\mathactive{%
3074 \let^ = \ptexhat
3075 \let< = \ptexless
3076 \let> = \ptexgtr
3077 \let+ = \ptexplus
3078 \let' = \ptexquoteright
3082 % for @sub and @sup, if in math mode, just do a normal sub/superscript.
3083 % If in text, use math to place as sub/superscript, but switch
3084 % into text mode, with smaller fonts. This is a different font than the
3085 % one used for real math sub/superscripts (8pt vs. 7pt), but let's not
3086 % fix it (significant additions to font machinery) until someone notices.
3088 \def\sub{\ifmmode \expandafter\sb \else \expandafter\finishsub\fi}
3089 \def\finishsub#1{$\sb{\hbox{\selectfonts\lllsize #1}}$}%
3091 \def\sup{\ifmmode \expandafter\ptexsp \else \expandafter\finishsup\fi}
3092 \def\finishsup#1{$\ptexsp{\hbox{\selectfonts\lllsize #1}}$}%
3094 % @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}.
3095 % Ignore unless FMTNAME == tex; then it is like @iftex and @tex,
3096 % except specified as a normal braced arg, so no newlines to worry about.
3098 \def\outfmtnametex{tex}
3100 \long\def\inlinefmt#1{\doinlinefmt #1,\finish}
3101 \long\def\doinlinefmt#1,#2,\finish{%
3102 \def\inlinefmtname{#1}%
3103 \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\fi
3106 % @inlinefmtifelse{FMTNAME,THEN-TEXT,ELSE-TEXT} expands THEN-TEXT if
3107 % FMTNAME is tex, else ELSE-TEXT.
3108 \long\def\inlinefmtifelse#1{\doinlinefmtifelse #1,,,\finish}
3109 \long\def\doinlinefmtifelse#1,#2,#3,#4,\finish{%
3110 \def\inlinefmtname{#1}%
3111 \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\else \ignorespaces #3\fi
3114 % For raw, must switch into @tex before parsing the argument, to avoid
3115 % setting catcodes prematurely. Doing it this way means that, for
3116 % example, @inlineraw{html, foo{bar} gets a parse error instead of being
3117 % ignored. But this isn't important because if people want a literal
3118 % *right* brace they would have to use a command anyway, so they may as
3119 % well use a command to get a left brace too. We could re-use the
3120 % delimiter character idea from \verb, but it seems like overkill.
3122 \long\def\inlineraw{\tex \doinlineraw}
3123 \long\def\doinlineraw#1{\doinlinerawtwo #1,\finish}
3124 \def\doinlinerawtwo#1,#2,\finish{%
3125 \def\inlinerawname{#1}%
3126 \ifx\inlinerawname\outfmtnametex \ignorespaces #2\fi
3127 \endgroup % close group opened by \tex.
3130 % @inlineifset{VAR, TEXT} expands TEXT if VAR is @set.
3132 \long\def\inlineifset#1{\doinlineifset #1,\finish}
3133 \long\def\doinlineifset#1,#2,\finish{%
3134 \def\inlinevarname{#1}%
3135 \expandafter\ifx\csname SET\inlinevarname\endcsname\relax
3136 \else\ignorespaces#2\fi
3139 % @inlineifclear{VAR, TEXT} expands TEXT if VAR is not @set.
3141 \long\def\inlineifclear#1{\doinlineifclear #1,\finish}
3142 \long\def\doinlineifclear#1,#2,\finish{%
3143 \def\inlinevarname{#1}%
3144 \expandafter\ifx\csname SET\inlinevarname\endcsname\relax \ignorespaces#2\fi
3148 \message{glyphs,}
3149 % and logos.
3151 % @@ prints an @, as does @atchar{}.
3152 \def\@{\char64 }
3153 \let\atchar=\@
3155 % @{ @} @lbracechar{} @rbracechar{} all generate brace characters.
3156 % Unless we're in typewriter, use \ecfont because the CM text fonts do
3157 % not have braces, and we don't want to switch into math.
3158 \def\mylbrace{{\ifmonospace\else\ecfont\fi \char123}}
3159 \def\myrbrace{{\ifmonospace\else\ecfont\fi \char125}}
3160 \let\{=\mylbrace \let\lbracechar=\{
3161 \let\}=\myrbrace \let\rbracechar=\}
3162 \begingroup
3163 % Definitions to produce \{ and \} commands for indices,
3164 % and @{ and @} for the aux/toc files.
3165 \catcode`\{ = \other \catcode`\} = \other
3166 \catcode`\[ = 1 \catcode`\] = 2
3167 \catcode`\! = 0 \catcode`\\ = \other
3168 !gdef!lbracecmd[\{]%
3169 !gdef!rbracecmd[\}]%
3170 !gdef!lbraceatcmd[@{]%
3171 !gdef!rbraceatcmd[@}]%
3172 !endgroup
3174 % @comma{} to avoid , parsing problems.
3175 \let\comma = ,
3177 % Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
3178 % Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H.
3179 \let\, = \ptexc
3180 \let\dotaccent = \ptexdot
3181 \def\ringaccent#1{{\accent23 #1}}
3182 \let\tieaccent = \ptext
3183 \let\ubaraccent = \ptexb
3184 \let\udotaccent = \d
3186 % Other special characters: @questiondown @exclamdown @ordf @ordm
3187 % Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
3188 \def\questiondown{?`}
3189 \def\exclamdown{!`}
3190 \def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}}
3191 \def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}}
3193 % Dotless i and dotless j, used for accents.
3194 \def\imacro{i}
3195 \def\jmacro{j}
3196 \def\dotless#1{%
3197 \def\temp{#1}%
3198 \ifx\temp\imacro \ifmmode\imath \else\ptexi \fi
3199 \else\ifx\temp\jmacro \ifmmode\jmath \else\j \fi
3200 \else \errmessage{@dotless can be used only with i or j}%
3201 \fi\fi
3204 % The \TeX{} logo, as in plain, but resetting the spacing so that a
3205 % period following counts as ending a sentence. (Idea found in latex.)
3207 \edef\TeX{\TeX \spacefactor=1000 }
3209 % @LaTeX{} logo. Not quite the same results as the definition in
3210 % latex.ltx, since we use a different font for the raised A; it's most
3211 % convenient for us to use an explicitly smaller font, rather than using
3212 % the \scriptstyle font (since we don't reset \scriptstyle and
3213 % \scriptscriptstyle).
3215 \def\LaTeX{%
3216 L\kern-.36em
3217 {\setbox0=\hbox{T}%
3218 \vbox to \ht0{\hbox{%
3219 \ifx\textnominalsize\xwordpt
3220 % for 10pt running text, \lllsize (8pt) is too small for the A in LaTeX.
3221 % Revert to plain's \scriptsize, which is 7pt.
3222 \count255=\the\fam $\fam\count255 \scriptstyle A$%
3223 \else
3224 % For 11pt, we can use our lllsize.
3225 \selectfonts\lllsize A%
3228 \vss
3230 \kern-.15em
3231 \TeX
3234 % Some math mode symbols. Define \ensuremath to switch into math mode
3235 % unless we are already there. Expansion tricks may not be needed here,
3236 % but safer, and can't hurt.
3237 \def\ensuremath{\ifmmode \expandafter\asis \else\expandafter\ensuredmath \fi}
3238 \def\ensuredmath#1{$\relax#1$}
3240 \def\bullet{\ensuremath\ptexbullet}
3241 \def\geq{\ensuremath\ge}
3242 \def\leq{\ensuremath\le}
3243 \def\minus{\ensuremath-}
3245 % @dots{} outputs an ellipsis using the current font.
3246 % We do .5em per period so that it has the same spacing in the cm
3247 % typewriter fonts as three actual period characters; on the other hand,
3248 % in other typewriter fonts three periods are wider than 1.5em. So do
3249 % whichever is larger.
3251 \def\dots{%
3252 \leavevmode
3253 \setbox0=\hbox{...}% get width of three periods
3254 \ifdim\wd0 > 1.5em
3255 \dimen0 = \wd0
3256 \else
3257 \dimen0 = 1.5em
3259 \hbox to \dimen0{%
3260 \hskip 0pt plus.25fil
3261 .\hskip 0pt plus1fil
3262 .\hskip 0pt plus1fil
3263 .\hskip 0pt plus.5fil
3267 % @enddots{} is an end-of-sentence ellipsis.
3269 \def\enddots{%
3270 \dots
3271 \spacefactor=\endofsentencespacefactor
3274 % @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
3276 % Since these characters are used in examples, they should be an even number of
3277 % \tt widths. Each \tt character is 1en, so two makes it 1em.
3279 \def\point{$\star$}
3280 \def\arrow{\leavevmode\raise.05ex\hbox to 1em{\hfil$\rightarrow$\hfil}}
3281 \def\result{\leavevmode\raise.05ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}
3282 \def\expansion{\leavevmode\hbox to 1em{\hfil$\mapsto$\hfil}}
3283 \def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}}
3284 \def\equiv{\leavevmode\hbox to 1em{\hfil$\ptexequiv$\hfil}}
3286 % The @error{} command.
3287 % Adapted from the TeXbook's \boxit.
3289 \newbox\errorbox
3291 {\tentt \global\dimen0 = 3em}% Width of the box.
3292 \dimen2 = .55pt % Thickness of rules
3293 % The text. (`r' is open on the right, `e' somewhat less so on the left.)
3294 \setbox0 = \hbox{\kern-.75pt \reducedsf \putworderror\kern-1.5pt}
3296 \setbox\errorbox=\hbox to \dimen0{\hfil
3297 \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
3298 \advance\hsize by -2\dimen2 % Rules.
3299 \vbox{%
3300 \hrule height\dimen2
3301 \hbox{\vrule width\dimen2 \kern3pt % Space to left of text.
3302 \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below.
3303 \kern3pt\vrule width\dimen2}% Space to right.
3304 \hrule height\dimen2}
3305 \hfil}
3307 \def\error{\leavevmode\lower.7ex\copy\errorbox}
3309 % @pounds{} is a sterling sign, which Knuth put in the CM italic font.
3311 \def\pounds{{\it\$}}
3313 % @euro{} comes from a separate font, depending on the current style.
3314 % We use the free feym* fonts from the eurosym package by Henrik
3315 % Theiling, which support regular, slanted, bold and bold slanted (and
3316 % "outlined" (blackboard board, sort of) versions, which we don't need).
3317 % It is available from http://www.ctan.org/tex-archive/fonts/eurosym.
3319 % Although only regular is the truly official Euro symbol, we ignore
3320 % that. The Euro is designed to be slightly taller than the regular
3321 % font height.
3323 % feymr - regular
3324 % feymo - slanted
3325 % feybr - bold
3326 % feybo - bold slanted
3328 % There is no good (free) typewriter version, to my knowledge.
3329 % A feymr10 euro is ~7.3pt wide, while a normal cmtt10 char is ~5.25pt wide.
3330 % Hmm.
3332 % Also doesn't work in math. Do we need to do math with euro symbols?
3333 % Hope not.
3336 \def\euro{{\eurofont e}}
3337 \def\eurofont{%
3338 % We set the font at each command, rather than predefining it in
3339 % \textfonts and the other font-switching commands, so that
3340 % installations which never need the symbol don't have to have the
3341 % font installed.
3343 % There is only one designed size (nominal 10pt), so we always scale
3344 % that to the current nominal size.
3346 % By the way, simply using "at 1em" works for cmr10 and the like, but
3347 % does not work for cmbx10 and other extended/shrunken fonts.
3349 \def\eurosize{\csname\curfontsize nominalsize\endcsname}%
3351 \ifx\curfontstyle\bfstylename
3352 % bold:
3353 \font\thiseurofont = \ifusingit{feybo10}{feybr10} at \eurosize
3354 \else
3355 % regular:
3356 \font\thiseurofont = \ifusingit{feymo10}{feymr10} at \eurosize
3358 \thiseurofont
3361 % Glyphs from the EC fonts. We don't use \let for the aliases, because
3362 % sometimes we redefine the original macro, and the alias should reflect
3363 % the redefinition.
3365 % Use LaTeX names for the Icelandic letters.
3366 \def\DH{{\ecfont \char"D0}} % Eth
3367 \def\dh{{\ecfont \char"F0}} % eth
3368 \def\TH{{\ecfont \char"DE}} % Thorn
3369 \def\th{{\ecfont \char"FE}} % thorn
3371 \def\guillemetleft{{\ecfont \char"13}}
3372 \def\guillemotleft{\guillemetleft}
3373 \def\guillemetright{{\ecfont \char"14}}
3374 \def\guillemotright{\guillemetright}
3375 \def\guilsinglleft{{\ecfont \char"0E}}
3376 \def\guilsinglright{{\ecfont \char"0F}}
3377 \def\quotedblbase{{\ecfont \char"12}}
3378 \def\quotesinglbase{{\ecfont \char"0D}}
3380 % This positioning is not perfect (see the ogonek LaTeX package), but
3381 % we have the precomposed glyphs for the most common cases. We put the
3382 % tests to use those glyphs in the single \ogonek macro so we have fewer
3383 % dummy definitions to worry about for index entries, etc.
3385 % ogonek is also used with other letters in Lithuanian (IOU), but using
3386 % the precomposed glyphs for those is not so easy since they aren't in
3387 % the same EC font.
3388 \def\ogonek#1{{%
3389 \def\temp{#1}%
3390 \ifx\temp\macrocharA\Aogonek
3391 \else\ifx\temp\macrochara\aogonek
3392 \else\ifx\temp\macrocharE\Eogonek
3393 \else\ifx\temp\macrochare\eogonek
3394 \else
3395 \ecfont \setbox0=\hbox{#1}%
3396 \ifdim\ht0=1ex\accent"0C #1%
3397 \else\ooalign{\unhbox0\crcr\hidewidth\char"0C \hidewidth}%
3399 \fi\fi\fi\fi
3402 \def\Aogonek{{\ecfont \char"81}}\def\macrocharA{A}
3403 \def\aogonek{{\ecfont \char"A1}}\def\macrochara{a}
3404 \def\Eogonek{{\ecfont \char"86}}\def\macrocharE{E}
3405 \def\eogonek{{\ecfont \char"A6}}\def\macrochare{e}
3407 % Use the European Computer Modern fonts (cm-super in outline format)
3408 % for non-CM glyphs. That is ec* for regular text and tc* for the text
3409 % companion symbols (LaTeX TS1 encoding). Both are part of the ec
3410 % package and follow the same conventions.
3412 \def\ecfont{\etcfont{e}}
3413 \def\tcfont{\etcfont{t}}
3415 \def\etcfont#1{%
3416 % We can't distinguish serif/sans and italic/slanted, but this
3417 % is used for crude hacks anyway (like adding French and German
3418 % quotes to documents typeset with CM, where we lose kerning), so
3419 % hopefully nobody will notice/care.
3420 \edef\ecsize{\csname\curfontsize ecsize\endcsname}%
3421 \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}%
3422 \ifmonospace
3423 % typewriter:
3424 \font\thisecfont = #1ctt\ecsize \space at \nominalsize
3425 \else
3426 \ifx\curfontstyle\bfstylename
3427 % bold:
3428 \font\thisecfont = #1cb\ifusingit{i}{x}\ecsize \space at \nominalsize
3429 \else
3430 % regular:
3431 \font\thisecfont = #1c\ifusingit{ti}{rm}\ecsize \space at \nominalsize
3434 \thisecfont
3437 % @registeredsymbol - R in a circle. The font for the R should really
3438 % be smaller yet, but lllsize is the best we can do for now.
3439 % Adapted from the plain.tex definition of \copyright.
3441 \def\registeredsymbol{%
3442 $^{{\ooalign{\hfil\raise.07ex\hbox{\selectfonts\lllsize R}%
3443 \hfil\crcr\Orb}}%
3447 % @textdegree - the normal degrees sign.
3449 \def\textdegree{$^\circ$}
3451 % Laurent Siebenmann reports \Orb undefined with:
3452 % Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38
3453 % so we'll define it if necessary.
3455 \ifx\Orb\thisisundefined
3456 \def\Orb{\mathhexbox20D}
3459 % Quotes.
3460 \chardef\quotedblleft="5C
3461 \chardef\quotedblright=`\"
3462 \chardef\quoteleft=`\`
3463 \chardef\quoteright=`\'
3466 \message{page headings,}
3468 \newskip\titlepagetopglue \titlepagetopglue = 1.5in
3469 \newskip\titlepagebottomglue \titlepagebottomglue = 2pc
3471 % First the title page. Must do @settitle before @titlepage.
3472 \newif\ifseenauthor
3473 \newif\iffinishedtitlepage
3475 % @setcontentsaftertitlepage used to do an implicit @contents or
3476 % @shortcontents after @end titlepage, but it is now obsolete.
3477 \def\setcontentsaftertitlepage{%
3478 \errmessage{@setcontentsaftertitlepage has been removed as a Texinfo
3479 command; move your @contents command if you want the contents
3480 after the title page.}}%
3481 \def\setshortcontentsaftertitlepage{%
3482 \errmessage{@setshortcontentsaftertitlepage has been removed as a Texinfo
3483 command; move your @shortcontents and @contents commands if you
3484 want the contents after the title page.}}%
3486 \parseargdef\shorttitlepage{%
3487 \begingroup \hbox{}\vskip 1.5in \chaprm \centerline{#1}%
3488 \endgroup\page\hbox{}\page}
3490 \envdef\titlepage{%
3491 % Open one extra group, as we want to close it in the middle of \Etitlepage.
3492 \begingroup
3493 \parindent=0pt \textfonts
3494 % Leave some space at the very top of the page.
3495 \vglue\titlepagetopglue
3496 % No rule at page bottom unless we print one at the top with @title.
3497 \finishedtitlepagetrue
3499 % Most title ``pages'' are actually two pages long, with space
3500 % at the top of the second. We don't want the ragged left on the second.
3501 \let\oldpage = \page
3502 \def\page{%
3503 \iffinishedtitlepage\else
3504 \finishtitlepage
3506 \let\page = \oldpage
3507 \page
3508 \null
3512 \def\Etitlepage{%
3513 \iffinishedtitlepage\else
3514 \finishtitlepage
3516 % It is important to do the page break before ending the group,
3517 % because the headline and footline are only empty inside the group.
3518 % If we use the new definition of \page, we always get a blank page
3519 % after the title page, which we certainly don't want.
3520 \oldpage
3521 \endgroup
3523 % Need this before the \...aftertitlepage checks so that if they are
3524 % in effect the toc pages will come out with page numbers.
3525 \HEADINGSon
3528 \def\finishtitlepage{%
3529 \vskip4pt \hrule height 2pt width \hsize
3530 \vskip\titlepagebottomglue
3531 \finishedtitlepagetrue
3534 % Settings used for typesetting titles: no hyphenation, no indentation,
3535 % don't worry much about spacing, ragged right. This should be used
3536 % inside a \vbox, and fonts need to be set appropriately first. Because
3537 % it is always used for titles, nothing else, we call \rmisbold. \par
3538 % should be specified before the end of the \vbox, since a vbox is a group.
3540 \def\raggedtitlesettings{%
3541 \rmisbold
3542 \hyphenpenalty=10000
3543 \parindent=0pt
3544 \tolerance=5000
3545 \ptexraggedright
3548 % Macros to be used within @titlepage:
3550 \let\subtitlerm=\tenrm
3551 \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}
3553 \parseargdef\title{%
3554 \checkenv\titlepage
3555 \vbox{\titlefonts \raggedtitlesettings #1\par}%
3556 % print a rule at the page bottom also.
3557 \finishedtitlepagefalse
3558 \vskip4pt \hrule height 4pt width \hsize \vskip4pt
3561 \parseargdef\subtitle{%
3562 \checkenv\titlepage
3563 {\subtitlefont \rightline{#1}}%
3566 % @author should come last, but may come many times.
3567 % It can also be used inside @quotation.
3569 \parseargdef\author{%
3570 \def\temp{\quotation}%
3571 \ifx\thisenv\temp
3572 \def\quotationauthor{#1}% printed in \Equotation.
3573 \else
3574 \checkenv\titlepage
3575 \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi
3576 {\secfonts\rmisbold \leftline{#1}}%
3581 % Set up page headings and footings.
3583 \let\thispage=\folio
3585 \newtoks\evenheadline % headline on even pages
3586 \newtoks\oddheadline % headline on odd pages
3587 \newtoks\evenfootline % footline on even pages
3588 \newtoks\oddfootline % footline on odd pages
3590 % Now make \makeheadline and \makefootline in Plain TeX use those variables
3591 \headline={{\textfonts\rm \ifodd\pageno \the\oddheadline
3592 \else \the\evenheadline \fi}}
3593 \footline={{\textfonts\rm \ifodd\pageno \the\oddfootline
3594 \else \the\evenfootline \fi}\HEADINGShook}
3595 \let\HEADINGShook=\relax
3597 % Commands to set those variables.
3598 % For example, this is what @headings on does
3599 % @evenheading @thistitle|@thispage|@thischapter
3600 % @oddheading @thischapter|@thispage|@thistitle
3601 % @evenfooting @thisfile||
3602 % @oddfooting ||@thisfile
3605 \def\evenheading{\parsearg\evenheadingxxx}
3606 \def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish}
3607 \def\evenheadingyyy #1\|#2\|#3\|#4\finish{%
3608 \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
3610 \def\oddheading{\parsearg\oddheadingxxx}
3611 \def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish}
3612 \def\oddheadingyyy #1\|#2\|#3\|#4\finish{%
3613 \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
3615 \parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}%
3617 \def\evenfooting{\parsearg\evenfootingxxx}
3618 \def\evenfootingxxx #1{\evenfootingyyy #1\|\|\|\|\finish}
3619 \def\evenfootingyyy #1\|#2\|#3\|#4\finish{%
3620 \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
3622 \def\oddfooting{\parsearg\oddfootingxxx}
3623 \def\oddfootingxxx #1{\oddfootingyyy #1\|\|\|\|\finish}
3624 \def\oddfootingyyy #1\|#2\|#3\|#4\finish{%
3625 \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}%
3627 % Leave some space for the footline. Hopefully ok to assume
3628 % @evenfooting will not be used by itself.
3629 \global\advance\txipageheight by -12pt
3630 \global\advance\vsize by -12pt
3633 \parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}}
3635 % @evenheadingmarks top \thischapter <- chapter at the top of a page
3636 % @evenheadingmarks bottom \thischapter <- chapter at the bottom of a page
3638 % The same set of arguments for:
3640 % @oddheadingmarks
3641 % @evenfootingmarks
3642 % @oddfootingmarks
3643 % @everyheadingmarks
3644 % @everyfootingmarks
3646 % These define \getoddheadingmarks, \getevenheadingmarks,
3647 % \getoddfootingmarks, and \getevenfootingmarks, each to one of
3648 % \gettopheadingmarks, \getbottomheadingmarks.
3650 \def\evenheadingmarks{\headingmarks{even}{heading}}
3651 \def\oddheadingmarks{\headingmarks{odd}{heading}}
3652 \def\evenfootingmarks{\headingmarks{even}{footing}}
3653 \def\oddfootingmarks{\headingmarks{odd}{footing}}
3654 \parseargdef\everyheadingmarks{\headingmarks{even}{heading}{#1}
3655 \headingmarks{odd}{heading}{#1} }
3656 \parseargdef\everyfootingmarks{\headingmarks{even}{footing}{#1}
3657 \headingmarks{odd}{footing}{#1} }
3658 % #1 = even/odd, #2 = heading/footing, #3 = top/bottom.
3659 \def\headingmarks#1#2#3 {%
3660 \expandafter\let\expandafter\temp \csname get#3headingmarks\endcsname
3661 \global\expandafter\let\csname get#1#2marks\endcsname \temp
3664 \everyheadingmarks bottom
3665 \everyfootingmarks bottom
3667 % @headings double turns headings on for double-sided printing.
3668 % @headings single turns headings on for single-sided printing.
3669 % @headings off turns them off.
3670 % @headings on same as @headings double, retained for compatibility.
3671 % @headings after turns on double-sided headings after this page.
3672 % @headings doubleafter turns on double-sided headings after this page.
3673 % @headings singleafter turns on single-sided headings after this page.
3674 % By default, they are off at the start of a document,
3675 % and turned `on' after @end titlepage.
3677 \parseargdef\headings{\csname HEADINGS#1\endcsname}
3679 \def\headingsoff{% non-global headings elimination
3680 \evenheadline={\hfil}\evenfootline={\hfil}%
3681 \oddheadline={\hfil}\oddfootline={\hfil}%
3684 \def\HEADINGSoff{{\globaldefs=1 \headingsoff}} % global setting
3685 \HEADINGSoff % it's the default
3687 % When we turn headings on, set the page number to 1.
3688 % For double-sided printing, put current file name in lower left corner,
3689 % chapter name on inside top of right hand pages, document
3690 % title on inside top of left hand pages, and page numbers on outside top
3691 % edge of all pages.
3692 \def\HEADINGSdouble{%
3693 \global\pageno=1
3694 \global\evenfootline={\hfil}
3695 \global\oddfootline={\hfil}
3696 \global\evenheadline={\line{\folio\hfil\thistitle}}
3697 \global\oddheadline={\line{\thischapterheading\hfil\folio}}
3698 \global\let\contentsalignmacro = \chapoddpage
3700 \let\contentsalignmacro = \chappager
3702 % For single-sided printing, chapter title goes across top left of page,
3703 % page number on top right.
3704 \def\HEADINGSsingle{%
3705 \global\pageno=1
3706 \global\evenfootline={\hfil}
3707 \global\oddfootline={\hfil}
3708 \global\evenheadline={\line{\thischapterheading\hfil\folio}}
3709 \global\oddheadline={\line{\thischapterheading\hfil\folio}}
3710 \global\let\contentsalignmacro = \chappager
3712 \def\HEADINGSon{\HEADINGSdouble}
3714 \def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex}
3715 \let\HEADINGSdoubleafter=\HEADINGSafter
3716 \def\HEADINGSdoublex{%
3717 \global\evenfootline={\hfil}
3718 \global\oddfootline={\hfil}
3719 \global\evenheadline={\line{\folio\hfil\thistitle}}
3720 \global\oddheadline={\line{\thischapterheading\hfil\folio}}
3721 \global\let\contentsalignmacro = \chapoddpage
3724 \def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex}
3725 \def\HEADINGSsinglex{%
3726 \global\evenfootline={\hfil}
3727 \global\oddfootline={\hfil}
3728 \global\evenheadline={\line{\thischapterheading\hfil\folio}}
3729 \global\oddheadline={\line{\thischapterheading\hfil\folio}}
3730 \global\let\contentsalignmacro = \chappager
3733 % Subroutines used in generating headings
3734 % This produces Day Month Year style of output.
3735 % Only define if not already defined, in case a txi-??.tex file has set
3736 % up a different format (e.g., txi-cs.tex does this).
3737 \ifx\today\thisisundefined
3738 \def\today{%
3739 \number\day\space
3740 \ifcase\month
3741 \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr
3742 \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug
3743 \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec
3745 \space\number\year}
3748 % @settitle line... specifies the title of the document, for headings.
3749 % It generates no output of its own.
3750 \def\thistitle{\putwordNoTitle}
3751 \def\settitle{\parsearg{\gdef\thistitle}}
3754 \message{tables,}
3755 % Tables -- @table, @ftable, @vtable, @item(x).
3757 % default indentation of table text
3758 \newdimen\tableindent \tableindent=.8in
3759 % default indentation of @itemize and @enumerate text
3760 \newdimen\itemindent \itemindent=.3in
3761 % margin between end of table item and start of table text.
3762 \newdimen\itemmargin \itemmargin=.1in
3764 % used internally for \itemindent minus \itemmargin
3765 \newdimen\itemmax
3767 % Note @table, @ftable, and @vtable define @item, @itemx, etc., with
3768 % these defs.
3769 % They also define \itemindex
3770 % to index the item name in whatever manner is desired (perhaps none).
3772 \newif\ifitemxneedsnegativevskip
3774 \def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi}
3776 \def\internalBitem{\smallbreak \parsearg\itemzzz}
3777 \def\internalBitemx{\itemxpar \parsearg\itemzzz}
3779 \def\itemzzz #1{\begingroup %
3780 \advance\hsize by -\rightskip
3781 \advance\hsize by -\tableindent
3782 \setbox0=\hbox{\itemindicate{#1}}%
3783 \itemindex{#1}%
3784 \nobreak % This prevents a break before @itemx.
3786 % If the item text does not fit in the space we have, put it on a line
3787 % by itself, and do not allow a page break either before or after that
3788 % line. We do not start a paragraph here because then if the next
3789 % command is, e.g., @kindex, the whatsit would get put into the
3790 % horizontal list on a line by itself, resulting in extra blank space.
3791 \ifdim \wd0>\itemmax
3793 % Make this a paragraph so we get the \parskip glue and wrapping,
3794 % but leave it ragged-right.
3795 \begingroup
3796 \advance\leftskip by-\tableindent
3797 \advance\hsize by\tableindent
3798 \advance\rightskip by0pt plus1fil\relax
3799 \leavevmode\unhbox0\par
3800 \endgroup
3802 % We're going to be starting a paragraph, but we don't want the
3803 % \parskip glue -- logically it's part of the @item we just started.
3804 \nobreak \vskip-\parskip
3806 % Stop a page break at the \parskip glue coming up. However, if
3807 % what follows is an environment such as @example, there will be no
3808 % \parskip glue; then the negative vskip we just inserted would
3809 % cause the example and the item to crash together. So we use this
3810 % bizarre value of 10001 as a signal to \aboveenvbreak to insert
3811 % \parskip glue after all. Section titles are handled this way also.
3813 \penalty 10001
3814 \endgroup
3815 \itemxneedsnegativevskipfalse
3816 \else
3817 % The item text fits into the space. Start a paragraph, so that the
3818 % following text (if any) will end up on the same line.
3819 \noindent
3820 % Do this with kerns and \unhbox so that if there is a footnote in
3821 % the item text, it can migrate to the main vertical list and
3822 % eventually be printed.
3823 \nobreak\kern-\tableindent
3824 \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0
3825 \unhbox0
3826 \nobreak\kern\dimen0
3827 \endgroup
3828 \itemxneedsnegativevskiptrue
3832 \def\item{\errmessage{@item while not in a list environment}}
3833 \def\itemx{\errmessage{@itemx while not in a list environment}}
3835 % @table, @ftable, @vtable.
3836 \envdef\table{%
3837 \let\itemindex\gobble
3838 \tablecheck{table}%
3840 \envdef\ftable{%
3841 \def\itemindex ##1{\doind {fn}{\code{##1}}}%
3842 \tablecheck{ftable}%
3844 \envdef\vtable{%
3845 \def\itemindex ##1{\doind {vr}{\code{##1}}}%
3846 \tablecheck{vtable}%
3848 \def\tablecheck#1{%
3849 \ifnum \the\catcode`\^^M=\active
3850 \endgroup
3851 \errmessage{This command won't work in this context; perhaps the problem is
3852 that we are \inenvironment\thisenv}%
3853 \def\next{\doignore{#1}}%
3854 \else
3855 \let\next\tablex
3857 \next
3859 \def\tablex#1{%
3860 \def\itemindicate{#1}%
3861 \parsearg\tabley
3863 \def\tabley#1{%
3865 \makevalueexpandable
3866 \edef\temp{\noexpand\tablez #1\space\space\space}%
3867 \expandafter
3868 }\temp \endtablez
3870 \def\tablez #1 #2 #3 #4\endtablez{%
3871 \aboveenvbreak
3872 \ifnum 0#1>0 \advance \leftskip by #1\mil \fi
3873 \ifnum 0#2>0 \tableindent=#2\mil \fi
3874 \ifnum 0#3>0 \advance \rightskip by #3\mil \fi
3875 \itemmax=\tableindent
3876 \advance \itemmax by -\itemmargin
3877 \advance \leftskip by \tableindent
3878 \exdentamount=\tableindent
3879 \parindent = 0pt
3880 \parskip = \smallskipamount
3881 \ifdim \parskip=0pt \parskip=2pt \fi
3882 \let\item = \internalBitem
3883 \let\itemx = \internalBitemx
3885 \def\Etable{\endgraf\afterenvbreak}
3886 \let\Eftable\Etable
3887 \let\Evtable\Etable
3888 \let\Eitemize\Etable
3889 \let\Eenumerate\Etable
3891 % This is the counter used by @enumerate, which is really @itemize
3893 \newcount \itemno
3895 \envdef\itemize{\parsearg\doitemize}
3897 \def\doitemize#1{%
3898 \aboveenvbreak
3899 \itemmax=\itemindent
3900 \advance\itemmax by -\itemmargin
3901 \advance\leftskip by \itemindent
3902 \exdentamount=\itemindent
3903 \parindent=0pt
3904 \parskip=\smallskipamount
3905 \ifdim\parskip=0pt \parskip=2pt \fi
3907 % Try typesetting the item mark so that if the document erroneously says
3908 % something like @itemize @samp (intending @table), there's an error
3909 % right away at the @itemize. It's not the best error message in the
3910 % world, but it's better than leaving it to the @item. This means if
3911 % the user wants an empty mark, they have to say @w{} not just @w.
3912 \def\itemcontents{#1}%
3913 \setbox0 = \hbox{\itemcontents}%
3915 % @itemize with no arg is equivalent to @itemize @bullet.
3916 \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi
3918 \let\item=\itemizeitem
3921 % Definition of @item while inside @itemize and @enumerate.
3923 \def\itemizeitem{%
3924 \advance\itemno by 1 % for enumerations
3925 {\let\par=\endgraf \smallbreak}% reasonable place to break
3927 % If the document has an @itemize directly after a section title, a
3928 % \nobreak will be last on the list, and \sectionheading will have
3929 % done a \vskip-\parskip. In that case, we don't want to zero
3930 % parskip, or the item text will crash with the heading. On the
3931 % other hand, when there is normal text preceding the item (as there
3932 % usually is), we do want to zero parskip, or there would be too much
3933 % space. In that case, we won't have a \nobreak before. At least
3934 % that's the theory.
3935 \ifnum\lastpenalty<10000 \parskip=0in \fi
3936 \noindent
3937 \hbox to 0pt{\hss \itemcontents \kern\itemmargin}%
3939 \ifinner\else
3940 \vadjust{\penalty 1200}% not good to break after first line of item.
3942 % We can be in inner vertical mode in a footnote, although an
3943 % @itemize looks awful there.
3945 \flushcr
3948 % \splitoff TOKENS\endmark defines \first to be the first token in
3949 % TOKENS, and \rest to be the remainder.
3951 \def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
3953 % Allow an optional argument of an uppercase letter, lowercase letter,
3954 % or number, to specify the first label in the enumerated list. No
3955 % argument is the same as `1'.
3957 \envparseargdef\enumerate{\enumeratey #1 \endenumeratey}
3958 \def\enumeratey #1 #2\endenumeratey{%
3959 % If we were given no argument, pretend we were given `1'.
3960 \def\thearg{#1}%
3961 \ifx\thearg\empty \def\thearg{1}\fi
3963 % Detect if the argument is a single token. If so, it might be a
3964 % letter. Otherwise, the only valid thing it can be is a number.
3965 % (We will always have one token, because of the test we just made.
3966 % This is a good thing, since \splitoff doesn't work given nothing at
3967 % all -- the first parameter is undelimited.)
3968 \expandafter\splitoff\thearg\endmark
3969 \ifx\rest\empty
3970 % Only one token in the argument. It could still be anything.
3971 % A ``lowercase letter'' is one whose \lccode is nonzero.
3972 % An ``uppercase letter'' is one whose \lccode is both nonzero, and
3973 % not equal to itself.
3974 % Otherwise, we assume it's a number.
3976 % We need the \relax at the end of the \ifnum lines to stop TeX from
3977 % continuing to look for a <number>.
3979 \ifnum\lccode\expandafter`\thearg=0\relax
3980 \numericenumerate % a number (we hope)
3981 \else
3982 % It's a letter.
3983 \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax
3984 \lowercaseenumerate % lowercase letter
3985 \else
3986 \uppercaseenumerate % uppercase letter
3989 \else
3990 % Multiple tokens in the argument. We hope it's a number.
3991 \numericenumerate
3995 % An @enumerate whose labels are integers. The starting integer is
3996 % given in \thearg.
3998 \def\numericenumerate{%
3999 \itemno = \thearg
4000 \startenumeration{\the\itemno}%
4003 % The starting (lowercase) letter is in \thearg.
4004 \def\lowercaseenumerate{%
4005 \itemno = \expandafter`\thearg
4006 \startenumeration{%
4007 % Be sure we're not beyond the end of the alphabet.
4008 \ifnum\itemno=0
4009 \errmessage{No more lowercase letters in @enumerate; get a bigger
4010 alphabet}%
4012 \char\lccode\itemno
4016 % The starting (uppercase) letter is in \thearg.
4017 \def\uppercaseenumerate{%
4018 \itemno = \expandafter`\thearg
4019 \startenumeration{%
4020 % Be sure we're not beyond the end of the alphabet.
4021 \ifnum\itemno=0
4022 \errmessage{No more uppercase letters in @enumerate; get a bigger
4023 alphabet}
4025 \char\uccode\itemno
4029 % Call \doitemize, adding a period to the first argument and supplying the
4030 % common last two arguments. Also subtract one from the initial value in
4031 % \itemno, since @item increments \itemno.
4033 \def\startenumeration#1{%
4034 \advance\itemno by -1
4035 \doitemize{#1.}\flushcr
4038 % @alphaenumerate and @capsenumerate are abbreviations for giving an arg
4039 % to @enumerate.
4041 \def\alphaenumerate{\enumerate{a}}
4042 \def\capsenumerate{\enumerate{A}}
4043 \def\Ealphaenumerate{\Eenumerate}
4044 \def\Ecapsenumerate{\Eenumerate}
4047 % @multitable macros
4048 % Amy Hendrickson, 8/18/94, 3/6/96
4050 % @multitable ... @end multitable will make as many columns as desired.
4051 % Contents of each column will wrap at width given in preamble. Width
4052 % can be specified either with sample text given in a template line,
4053 % or in percent of \hsize, the current width of text on page.
4055 % Table can continue over pages but will only break between lines.
4057 % To make preamble:
4059 % Either define widths of columns in terms of percent of \hsize:
4060 % @multitable @columnfractions .25 .3 .45
4061 % @item ...
4063 % Numbers following @columnfractions are the percent of the total
4064 % current hsize to be used for each column. You may use as many
4065 % columns as desired.
4068 % Or use a template:
4069 % @multitable {Column 1 template} {Column 2 template} {Column 3 template}
4070 % @item ...
4071 % using the widest term desired in each column.
4073 % Each new table line starts with @item, each subsequent new column
4074 % starts with @tab. Empty columns may be produced by supplying @tab's
4075 % with nothing between them for as many times as empty columns are needed,
4076 % ie, @tab@tab@tab will produce two empty columns.
4078 % @item, @tab do not need to be on their own lines, but it will not hurt
4079 % if they are.
4081 % Sample multitable:
4083 % @multitable {Column 1 template} {Column 2 template} {Column 3 template}
4084 % @item first col stuff @tab second col stuff @tab third col
4085 % @item
4086 % first col stuff
4087 % @tab
4088 % second col stuff
4089 % @tab
4090 % third col
4091 % @item first col stuff @tab second col stuff
4092 % @tab Many paragraphs of text may be used in any column.
4094 % They will wrap at the width determined by the template.
4095 % @item@tab@tab This will be in third column.
4096 % @end multitable
4098 % Default dimensions may be reset by user.
4099 % @multitableparskip is vertical space between paragraphs in table.
4100 % @multitableparindent is paragraph indent in table.
4101 % @multitablecolmargin is horizontal space to be left between columns.
4102 % @multitablelinespace is space to leave between table items, baseline
4103 % to baseline.
4104 % 0pt means it depends on current normal line spacing.
4106 \newskip\multitableparskip
4107 \newskip\multitableparindent
4108 \newdimen\multitablecolspace
4109 \newskip\multitablelinespace
4110 \multitableparskip=0pt
4111 \multitableparindent=6pt
4112 \multitablecolspace=12pt
4113 \multitablelinespace=0pt
4115 % Macros used to set up halign preamble:
4117 \let\endsetuptable\relax
4118 \def\xendsetuptable{\endsetuptable}
4119 \let\columnfractions\relax
4120 \def\xcolumnfractions{\columnfractions}
4121 \newif\ifsetpercent
4123 % #1 is the @columnfraction, usually a decimal number like .5, but might
4124 % be just 1. We just use it, whatever it is.
4126 \def\pickupwholefraction#1 {%
4127 \global\advance\colcount by 1
4128 \expandafter\xdef\csname col\the\colcount\endcsname{#1\hsize}%
4129 \setuptable
4132 \newcount\colcount
4133 \def\setuptable#1{%
4134 \def\firstarg{#1}%
4135 \ifx\firstarg\xendsetuptable
4136 \let\go = \relax
4137 \else
4138 \ifx\firstarg\xcolumnfractions
4139 \global\setpercenttrue
4140 \else
4141 \ifsetpercent
4142 \let\go\pickupwholefraction
4143 \else
4144 \global\advance\colcount by 1
4145 \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a
4146 % separator; typically that is always in the input, anyway.
4147 \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
4150 \ifx\go\pickupwholefraction
4151 % Put the argument back for the \pickupwholefraction call, so
4152 % we'll always have a period there to be parsed.
4153 \def\go{\pickupwholefraction#1}%
4154 \else
4155 \let\go = \setuptable
4156 \fi%
4161 % multitable-only commands.
4163 % @headitem starts a heading row, which we typeset in bold. Assignments
4164 % have to be global since we are inside the implicit group of an
4165 % alignment entry. \everycr below resets \everytab so we don't have to
4166 % undo it ourselves.
4167 \def\headitemfont{\b}% for people to use in the template row; not changeable
4168 \def\headitem{%
4169 \checkenv\multitable
4170 \crcr
4171 \gdef\headitemcrhook{\nobreak}% attempt to avoid page break after headings
4172 \global\everytab={\bf}% can't use \headitemfont since the parsing differs
4173 \the\everytab % for the first item
4176 % default for tables with no headings.
4177 \let\headitemcrhook=\relax
4179 % A \tab used to include \hskip1sp. But then the space in a template
4180 % line is not enough. That is bad. So let's go back to just `&' until
4181 % we again encounter the problem the 1sp was intended to solve.
4182 % --karl, nathan@acm.org, 20apr99.
4183 \def\tab{\checkenv\multitable &\the\everytab}%
4185 % @multitable ... @end multitable definitions:
4187 \newtoks\everytab % insert after every tab.
4189 \envdef\multitable{%
4190 \vskip\parskip
4191 \startsavinginserts
4193 % @item within a multitable starts a normal row.
4194 % We use \def instead of \let so that if one of the multitable entries
4195 % contains an @itemize, we don't choke on the \item (seen as \crcr aka
4196 % \endtemplate) expanding \doitemize.
4197 \def\item{\crcr}%
4199 \tolerance=9500
4200 \hbadness=9500
4201 \setmultitablespacing
4202 \parskip=\multitableparskip
4203 \parindent=\multitableparindent
4204 \overfullrule=0pt
4205 \global\colcount=0
4207 \everycr = {%
4208 \noalign{%
4209 \global\everytab={}% Reset from possible headitem.
4210 \global\colcount=0 % Reset the column counter.
4212 % Check for saved footnotes, etc.:
4213 \checkinserts
4215 % Perhaps a \nobreak, then reset:
4216 \headitemcrhook
4217 \global\let\headitemcrhook=\relax
4221 \parsearg\domultitable
4223 \def\domultitable#1{%
4224 % To parse everything between @multitable and @item:
4225 \setuptable#1 \endsetuptable
4227 % This preamble sets up a generic column definition, which will
4228 % be used as many times as user calls for columns.
4229 % \vtop will set a single line and will also let text wrap and
4230 % continue for many paragraphs if desired.
4231 \halign\bgroup &%
4232 \global\advance\colcount by 1
4233 \multistrut
4234 \vtop{%
4235 % Use the current \colcount to find the correct column width:
4236 \hsize=\expandafter\csname col\the\colcount\endcsname
4238 % In order to keep entries from bumping into each other
4239 % we will add a \leftskip of \multitablecolspace to all columns after
4240 % the first one.
4242 % If a template has been used, we will add \multitablecolspace
4243 % to the width of each template entry.
4245 % If the user has set preamble in terms of percent of \hsize we will
4246 % use that dimension as the width of the column, and the \leftskip
4247 % will keep entries from bumping into each other. Table will start at
4248 % left margin and final column will justify at right margin.
4250 % Make sure we don't inherit \rightskip from the outer environment.
4251 \rightskip=0pt
4252 \ifnum\colcount=1
4253 % The first column will be indented with the surrounding text.
4254 \advance\hsize by\leftskip
4255 \else
4256 \ifsetpercent \else
4257 % If user has not set preamble in terms of percent of \hsize
4258 % we will advance \hsize by \multitablecolspace.
4259 \advance\hsize by \multitablecolspace
4261 % In either case we will make \leftskip=\multitablecolspace:
4262 \leftskip=\multitablecolspace
4264 % Ignoring space at the beginning and end avoids an occasional spurious
4265 % blank line, when TeX decides to break the line at the space before the
4266 % box from the multistrut, so the strut ends up on a line by itself.
4267 % For example:
4268 % @multitable @columnfractions .11 .89
4269 % @item @code{#}
4270 % @tab Legal holiday which is valid in major parts of the whole country.
4271 % Is automatically provided with highlighting sequences respectively
4272 % marking characters.
4273 \noindent\ignorespaces##\unskip\multistrut
4274 }\cr
4276 \def\Emultitable{%
4277 \crcr
4278 \egroup % end the \halign
4279 \global\setpercentfalse
4282 \def\setmultitablespacing{%
4283 \def\multistrut{\strut}% just use the standard line spacing
4285 % Compute \multitablelinespace (if not defined by user) for use in
4286 % \multitableparskip calculation. We used define \multistrut based on
4287 % this, but (ironically) that caused the spacing to be off.
4288 % See bug-texinfo report from Werner Lemberg, 31 Oct 2004 12:52:20 +0100.
4289 \ifdim\multitablelinespace=0pt
4290 \setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip
4291 \global\advance\multitablelinespace by-\ht0
4293 % Test to see if parskip is larger than space between lines of
4294 % table. If not, do nothing.
4295 % If so, set to same dimension as multitablelinespace.
4296 \ifdim\multitableparskip>\multitablelinespace
4297 \global\multitableparskip=\multitablelinespace
4298 \global\advance\multitableparskip-7pt % to keep parskip somewhat smaller
4299 % than skip between lines in the table.
4300 \fi%
4301 \ifdim\multitableparskip=0pt
4302 \global\multitableparskip=\multitablelinespace
4303 \global\advance\multitableparskip-7pt % to keep parskip somewhat smaller
4304 % than skip between lines in the table.
4305 \fi}
4308 \message{conditionals,}
4310 % @iftex, @ifnotdocbook, @ifnothtml, @ifnotinfo, @ifnotplaintext,
4311 % @ifnotxml always succeed. They currently do nothing; we don't
4312 % attempt to check whether the conditionals are properly nested. But we
4313 % have to remember that they are conditionals, so that @end doesn't
4314 % attempt to close an environment group.
4316 \def\makecond#1{%
4317 \expandafter\let\csname #1\endcsname = \relax
4318 \expandafter\let\csname iscond.#1\endcsname = 1
4320 \makecond{iftex}
4321 \makecond{ifnotdocbook}
4322 \makecond{ifnothtml}
4323 \makecond{ifnotinfo}
4324 \makecond{ifnotplaintext}
4325 \makecond{ifnotxml}
4327 % Ignore @ignore, @ifhtml, @ifinfo, and the like.
4329 \def\direntry{\doignore{direntry}}
4330 \def\documentdescription{\doignore{documentdescription}}
4331 \def\docbook{\doignore{docbook}}
4332 \def\html{\doignore{html}}
4333 \def\ifdocbook{\doignore{ifdocbook}}
4334 \def\ifhtml{\doignore{ifhtml}}
4335 \def\ifinfo{\doignore{ifinfo}}
4336 \def\ifnottex{\doignore{ifnottex}}
4337 \def\ifplaintext{\doignore{ifplaintext}}
4338 \def\ifxml{\doignore{ifxml}}
4339 \def\ignore{\doignore{ignore}}
4340 \def\menu{\doignore{menu}}
4341 \def\xml{\doignore{xml}}
4343 % Ignore text until a line `@end #1', keeping track of nested conditionals.
4345 % A count to remember the depth of nesting.
4346 \newcount\doignorecount
4348 \def\doignore#1{\begingroup
4349 % Scan in ``verbatim'' mode:
4350 \obeylines
4351 \catcode`\@ = \other
4352 \catcode`\{ = \other
4353 \catcode`\} = \other
4355 % Make sure that spaces turn into tokens that match what \doignoretext wants.
4356 \spaceisspace
4358 % Count number of #1's that we've seen.
4359 \doignorecount = 0
4361 % Swallow text until we reach the matching `@end #1'.
4362 \dodoignore{#1}%
4365 { \catcode`_=11 % We want to use \_STOP_ which cannot appear in texinfo source.
4366 \obeylines %
4368 \gdef\dodoignore#1{%
4369 % #1 contains the command name as a string, e.g., `ifinfo'.
4371 % Define a command to find the next `@end #1'.
4372 \long\def\doignoretext##1^^M@end #1{%
4373 \doignoretextyyy##1^^M@#1\_STOP_}%
4375 % And this command to find another #1 command, at the beginning of a
4376 % line. (Otherwise, we would consider a line `@c @ifset', for
4377 % example, to count as an @ifset for nesting.)
4378 \long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}%
4380 % And now expand that command.
4381 \doignoretext ^^M%
4385 \def\doignoreyyy#1{%
4386 \def\temp{#1}%
4387 \ifx\temp\empty % Nothing found.
4388 \let\next\doignoretextzzz
4389 \else % Found a nested condition, ...
4390 \advance\doignorecount by 1
4391 \let\next\doignoretextyyy % ..., look for another.
4392 % If we're here, #1 ends with ^^M\ifinfo (for example).
4394 \next #1% the token \_STOP_ is present just after this macro.
4397 % We have to swallow the remaining "\_STOP_".
4399 \def\doignoretextzzz#1{%
4400 \ifnum\doignorecount = 0 % We have just found the outermost @end.
4401 \let\next\enddoignore
4402 \else % Still inside a nested condition.
4403 \advance\doignorecount by -1
4404 \let\next\doignoretext % Look for the next @end.
4406 \next
4409 % Finish off ignored text.
4410 { \obeylines%
4411 % Ignore anything after the last `@end #1'; this matters in verbatim
4412 % environments, where otherwise the newline after an ignored conditional
4413 % would result in a blank line in the output.
4414 \gdef\enddoignore#1^^M{\endgroup\ignorespaces}%
4418 % @set VAR sets the variable VAR to an empty value.
4419 % @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
4421 % Since we want to separate VAR from REST-OF-LINE (which might be
4422 % empty), we can't just use \parsearg; we have to insert a space of our
4423 % own to delimit the rest of the line, and then take it out again if we
4424 % didn't need it.
4425 % We rely on the fact that \parsearg sets \catcode`\ =10.
4427 \parseargdef\set{\setyyy#1 \endsetyyy}
4428 \def\setyyy#1 #2\endsetyyy{%
4430 \makevalueexpandable
4431 \def\temp{#2}%
4432 \edef\next{\gdef\makecsname{SET#1}}%
4433 \ifx\temp\empty
4434 \next{}%
4435 \else
4436 \setzzz#2\endsetzzz
4440 % Remove the trailing space \setxxx inserted.
4441 \def\setzzz#1 \endsetzzz{\next{#1}}
4443 % @clear VAR clears (i.e., unsets) the variable VAR.
4445 \parseargdef\clear{%
4447 \makevalueexpandable
4448 \global\expandafter\let\csname SET#1\endcsname=\relax
4452 % @value{foo} gets the text saved in variable foo.
4453 \def\value{\begingroup\makevalueexpandable\valuexxx}
4454 \def\valuexxx#1{\expandablevalue{#1}\endgroup}
4456 \catcode`\-=\active \catcode`\_=\active
4458 \gdef\makevalueexpandable{%
4459 \let\value = \expandablevalue
4460 % We don't want these characters active, ...
4461 \catcode`\-=\other \catcode`\_=\other
4462 % ..., but we might end up with active ones in the argument if
4463 % we're called from @code, as @code{@value{foo-bar_}}, though.
4464 % So \let them to their normal equivalents.
4465 \let-\normaldash \let_\normalunderscore
4469 % We have this subroutine so that we can handle at least some @value's
4470 % properly in indexes (we call \makevalueexpandable in \indexdummies).
4471 % The command has to be fully expandable (if the variable is set), since
4472 % the result winds up in the index file. This means that if the
4473 % variable's value contains other Texinfo commands, it's almost certain
4474 % it will fail (although perhaps we could fix that with sufficient work
4475 % to do a one-level expansion on the result, instead of complete).
4477 % Unfortunately, this has the consequence that when _ is in the *value*
4478 % of an @set, it does not print properly in the roman fonts (get the cmr
4479 % dot accent at position 126 instead). No fix comes to mind, and it's
4480 % been this way since 2003 or earlier, so just ignore it.
4482 \def\expandablevalue#1{%
4483 \expandafter\ifx\csname SET#1\endcsname\relax
4484 {[No value for ``#1'']}%
4485 \message{Variable `#1', used in @value, is not set.}%
4486 \else
4487 \csname SET#1\endcsname
4491 % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
4492 % with @set.
4494 % To get the special treatment we need for `@end ifset,' we call
4495 % \makecond and then redefine.
4497 \makecond{ifset}
4498 \def\ifset{\parsearg{\doifset{\let\next=\ifsetfail}}}
4499 \def\doifset#1#2{%
4501 \makevalueexpandable
4502 \let\next=\empty
4503 \expandafter\ifx\csname SET#2\endcsname\relax
4504 #1% If not set, redefine \next.
4506 \expandafter
4507 }\next
4509 \def\ifsetfail{\doignore{ifset}}
4511 % @ifclear VAR ... @end executes the `...' iff VAR has never been
4512 % defined with @set, or has been undefined with @clear.
4514 % The `\else' inside the `\doifset' parameter is a trick to reuse the
4515 % above code: if the variable is not set, do nothing, if it is set,
4516 % then redefine \next to \ifclearfail.
4518 \makecond{ifclear}
4519 \def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}}
4520 \def\ifclearfail{\doignore{ifclear}}
4522 % @ifcommandisdefined CMD ... @end executes the `...' if CMD (written
4523 % without the @) is in fact defined. We can only feasibly check at the
4524 % TeX level, so something like `mathcode' is going to considered
4525 % defined even though it is not a Texinfo command.
4527 \makecond{ifcommanddefined}
4528 \def\ifcommanddefined{\parsearg{\doifcmddefined{\let\next=\ifcmddefinedfail}}}
4530 \def\doifcmddefined#1#2{{%
4531 \makevalueexpandable
4532 \let\next=\empty
4533 \expandafter\ifx\csname #2\endcsname\relax
4534 #1% If not defined, \let\next as above.
4536 \expandafter
4537 }\next
4539 \def\ifcmddefinedfail{\doignore{ifcommanddefined}}
4541 % @ifcommandnotdefined CMD ... handled similar to @ifclear above.
4542 \makecond{ifcommandnotdefined}
4543 \def\ifcommandnotdefined{%
4544 \parsearg{\doifcmddefined{\else \let\next=\ifcmdnotdefinedfail}}}
4545 \def\ifcmdnotdefinedfail{\doignore{ifcommandnotdefined}}
4547 % Set the `txicommandconditionals' variable, so documents have a way to
4548 % test if the @ifcommand...defined conditionals are available.
4549 \set txicommandconditionals
4551 % @dircategory CATEGORY -- specify a category of the dir file
4552 % which this file should belong to. Ignore this in TeX.
4553 \let\dircategory=\comment
4555 % @defininfoenclose.
4556 \let\definfoenclose=\comment
4559 \message{indexing,}
4560 % Index generation facilities
4562 % Define \newwrite to be identical to plain tex's \newwrite
4563 % except not \outer, so it can be used within macros and \if's.
4564 \edef\newwrite{\makecsname{ptexnewwrite}}
4566 % \newindex {foo} defines an index named IX.
4567 % It automatically defines \IXindex such that
4568 % \IXindex ...rest of line... puts an entry in the index IX.
4569 % It also defines \IXindfile to be the number of the output channel for
4570 % the file that accumulates this index. The file's extension is IX.
4571 % The name of an index should be no more than 2 characters long
4572 % for the sake of vms.
4574 \def\newindex#1{%
4575 \expandafter\chardef\csname#1indfile\endcsname=0
4576 \expandafter\xdef\csname#1index\endcsname{% % Define @#1index
4577 \noexpand\doindex{#1}}
4580 % @defindex foo == \newindex{foo}
4582 \def\defindex{\parsearg\newindex}
4584 % Define @defcodeindex, like @defindex except put all entries in @code.
4586 \def\defcodeindex{\parsearg\newcodeindex}
4588 \def\newcodeindex#1{%
4589 \expandafter\chardef\csname#1indfile\endcsname=0
4590 \expandafter\xdef\csname#1index\endcsname{%
4591 \noexpand\docodeindex{#1}}%
4594 % The default indices:
4595 \newindex{cp}% concepts,
4596 \newcodeindex{fn}% functions,
4597 \newcodeindex{vr}% variables,
4598 \newcodeindex{tp}% types,
4599 \newcodeindex{ky}% keys
4600 \newcodeindex{pg}% and programs.
4603 % @synindex foo bar makes index foo feed into index bar.
4604 % Do this instead of @defindex foo if you don't want it as a separate index.
4606 % @syncodeindex foo bar similar, but put all entries made for index foo
4607 % inside @code.
4609 \def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}}
4610 \def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}}
4612 % #1 is \doindex or \docodeindex, #2 the index getting redefined (foo),
4613 % #3 the target index (bar).
4614 \def\dosynindex#1#2#3{%
4615 % Only do \closeout if we haven't already done it, else we'll end up
4616 % closing the target index.
4617 \expandafter \ifx\csname donesynindex#2\endcsname \relax
4618 % The \closeout helps reduce unnecessary open files; the limit on the
4619 % Acorn RISC OS is a mere 16 files.
4620 \expandafter\closeout\csname#2indfile\endcsname
4621 \expandafter\let\csname donesynindex#2\endcsname = 1
4623 % redefine \fooindfile:
4624 \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname
4625 \expandafter\let\csname#2indfile\endcsname=\temp
4626 % redefine \fooindex:
4627 \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}%
4630 % Define \doindex, the driver for all index macros.
4631 % Argument #1 is generated by the calling \fooindex macro,
4632 % and it the two-letter name of the index.
4634 \def\doindex#1{\edef\indexname{#1}\parsearg\doindexxxx}
4635 \def\doindexxxx #1{\doind{\indexname}{#1}}
4637 % like the previous two, but they put @code around the argument.
4638 \def\docodeindex#1{\edef\indexname{#1}\parsearg\docodeindexxxx}
4639 \def\docodeindexxxx #1{\doind{\indexname}{\code{#1}}}
4641 % Used when writing an index entry out to an index file, to prevent
4642 % expansion of Texinfo commands that can appear in an index entry.
4644 \def\indexdummies{%
4645 \escapechar = `\\ % use backslash in output files.
4646 \def\@{@}% change to @@ when we switch to @ as escape char in index files.
4647 \def\ {\realbackslash\space }%
4649 % Need these unexpandable (because we define \tt as a dummy)
4650 % definitions when @{ or @} appear in index entry text. Also, more
4651 % complicated, when \tex is in effect and \{ is a \delimiter again.
4652 % We can't use \lbracecmd and \rbracecmd because texindex assumes
4653 % braces and backslashes are used only as delimiters. Perhaps we
4654 % should use @lbracechar and @rbracechar?
4655 \def\{{{\tt\char123}}%
4656 \def\}{{\tt\char125}}%
4658 % Do the redefinitions.
4659 \commondummies
4662 % For the aux and toc files, @ is the escape character. So we want to
4663 % redefine everything using @ as the escape character (instead of
4664 % \realbackslash, still used for index files). When everything uses @,
4665 % this will be simpler.
4667 \def\atdummies{%
4668 \def\@{@@}%
4669 \def\ {@ }%
4670 \let\{ = \lbraceatcmd
4671 \let\} = \rbraceatcmd
4673 % Do the redefinitions.
4674 \commondummies
4675 \otherbackslash
4678 % Called from \indexdummies and \atdummies.
4680 \def\commondummies{%
4681 % \definedummyword defines \#1 as \string\#1\space, thus effectively
4682 % preventing its expansion. This is used only for control words,
4683 % not control letters, because the \space would be incorrect for
4684 % control characters, but is needed to separate the control word
4685 % from whatever follows.
4687 % For control letters, we have \definedummyletter, which omits the
4688 % space.
4690 % These can be used both for control words that take an argument and
4691 % those that do not. If it is followed by {arg} in the input, then
4692 % that will dutifully get written to the index (or wherever).
4694 \def\definedummyword ##1{\def##1{\string##1\space}}%
4695 \def\definedummyletter##1{\def##1{\string##1}}%
4696 \let\definedummyaccent\definedummyletter
4698 \commondummiesnofonts
4700 \definedummyletter\_%
4701 \definedummyletter\-%
4703 % Non-English letters.
4704 \definedummyword\AA
4705 \definedummyword\AE
4706 \definedummyword\DH
4707 \definedummyword\L
4708 \definedummyword\O
4709 \definedummyword\OE
4710 \definedummyword\TH
4711 \definedummyword\aa
4712 \definedummyword\ae
4713 \definedummyword\dh
4714 \definedummyword\exclamdown
4715 \definedummyword\l
4716 \definedummyword\o
4717 \definedummyword\oe
4718 \definedummyword\ordf
4719 \definedummyword\ordm
4720 \definedummyword\questiondown
4721 \definedummyword\ss
4722 \definedummyword\th
4724 % Although these internal commands shouldn't show up, sometimes they do.
4725 \definedummyword\bf
4726 \definedummyword\gtr
4727 \definedummyword\hat
4728 \definedummyword\less
4729 \definedummyword\sf
4730 \definedummyword\sl
4731 \definedummyword\tclose
4732 \definedummyword\tt
4734 \definedummyword\LaTeX
4735 \definedummyword\TeX
4737 % Assorted special characters.
4738 \definedummyword\arrow
4739 \definedummyword\bullet
4740 \definedummyword\comma
4741 \definedummyword\copyright
4742 \definedummyword\registeredsymbol
4743 \definedummyword\dots
4744 \definedummyword\enddots
4745 \definedummyword\entrybreak
4746 \definedummyword\equiv
4747 \definedummyword\error
4748 \definedummyword\euro
4749 \definedummyword\expansion
4750 \definedummyword\geq
4751 \definedummyword\guillemetleft
4752 \definedummyword\guillemetright
4753 \definedummyword\guilsinglleft
4754 \definedummyword\guilsinglright
4755 \definedummyword\lbracechar
4756 \definedummyword\leq
4757 \definedummyword\mathopsup
4758 \definedummyword\minus
4759 \definedummyword\ogonek
4760 \definedummyword\pounds
4761 \definedummyword\point
4762 \definedummyword\print
4763 \definedummyword\quotedblbase
4764 \definedummyword\quotedblleft
4765 \definedummyword\quotedblright
4766 \definedummyword\quoteleft
4767 \definedummyword\quoteright
4768 \definedummyword\quotesinglbase
4769 \definedummyword\rbracechar
4770 \definedummyword\result
4771 \definedummyword\sub
4772 \definedummyword\sup
4773 \definedummyword\textdegree
4775 % We want to disable all macros so that they are not expanded by \write.
4776 \macrolist
4778 \normalturnoffactive
4780 % Handle some cases of @value -- where it does not contain any
4781 % (non-fully-expandable) commands.
4782 \makevalueexpandable
4785 % \commondummiesnofonts: common to \commondummies and \indexnofonts.
4786 % Define \definedumyletter, \definedummyaccent and \definedummyword before
4787 % using.
4789 \def\commondummiesnofonts{%
4790 % Control letters and accents.
4791 \definedummyletter\!%
4792 \definedummyaccent\"%
4793 \definedummyaccent\'%
4794 \definedummyletter\*%
4795 \definedummyaccent\,%
4796 \definedummyletter\.%
4797 \definedummyletter\/%
4798 \definedummyletter\:%
4799 \definedummyaccent\=%
4800 \definedummyletter\?%
4801 \definedummyaccent\^%
4802 \definedummyaccent\`%
4803 \definedummyaccent\~%
4804 \definedummyword\u
4805 \definedummyword\v
4806 \definedummyword\H
4807 \definedummyword\dotaccent
4808 \definedummyword\ogonek
4809 \definedummyword\ringaccent
4810 \definedummyword\tieaccent
4811 \definedummyword\ubaraccent
4812 \definedummyword\udotaccent
4813 \definedummyword\dotless
4815 % Texinfo font commands.
4816 \definedummyword\b
4817 \definedummyword\i
4818 \definedummyword\r
4819 \definedummyword\sansserif
4820 \definedummyword\sc
4821 \definedummyword\slanted
4822 \definedummyword\t
4824 % Commands that take arguments.
4825 \definedummyword\abbr
4826 \definedummyword\acronym
4827 \definedummyword\anchor
4828 \definedummyword\cite
4829 \definedummyword\code
4830 \definedummyword\command
4831 \definedummyword\dfn
4832 \definedummyword\dmn
4833 \definedummyword\email
4834 \definedummyword\emph
4835 \definedummyword\env
4836 \definedummyword\file
4837 \definedummyword\image
4838 \definedummyword\indicateurl
4839 \definedummyword\inforef
4840 \definedummyword\kbd
4841 \definedummyword\key
4842 \definedummyword\math
4843 \definedummyword\option
4844 \definedummyword\pxref
4845 \definedummyword\ref
4846 \definedummyword\samp
4847 \definedummyword\strong
4848 \definedummyword\tie
4849 \definedummyword\U
4850 \definedummyword\uref
4851 \definedummyword\url
4852 \definedummyword\var
4853 \definedummyword\verb
4854 \definedummyword\w
4855 \definedummyword\xref
4858 % For testing: output @{ and @} in index sort strings as \{ and \}.
4859 \newif\ifusebracesinindexes
4861 \let\indexlbrace\relax
4862 \let\indexrbrace\relax
4864 {\catcode`\@=0
4865 \catcode`\\=13
4866 @gdef@backslashdisappear{@def\{}}
4870 \catcode`\<=13
4871 \catcode`\-=13
4872 \catcode`\`=13
4873 \gdef\indexnonalnumdisappear{%
4874 \expandafter\ifx\csname SETtxiindexlquoteignore\endcsname\relax\else
4875 % @set txiindexlquoteignore makes us ignore left quotes in the sort term.
4876 % (Introduced for FSFS 2nd ed.)
4877 \let`=\empty
4880 \expandafter\ifx\csname SETtxiindexbackslashignore\endcsname\relax\else
4881 \backslashdisappear
4884 \expandafter\ifx\csname SETtxiindexhyphenignore\endcsname\relax\else
4885 \def-{}%
4887 \expandafter\ifx\csname SETtxiindexlessthanignore\endcsname\relax\else
4888 \def<{}%
4890 \expandafter\ifx\csname SETtxiindexatsignignore\endcsname\relax\else
4891 \def\@{}%
4895 \gdef\indexnonalnumreappear{%
4896 \useindexbackslash
4897 \let-\normaldash
4898 \let<\normalless
4899 \def\@{@}%
4904 % \indexnofonts is used when outputting the strings to sort the index
4905 % by, and when constructing control sequence names. It eliminates all
4906 % control sequences and just writes whatever the best ASCII sort string
4907 % would be for a given command (usually its argument).
4909 \def\indexnofonts{%
4910 % Accent commands should become @asis.
4911 \def\definedummyaccent##1{\let##1\asis}%
4912 % We can just ignore other control letters.
4913 \def\definedummyletter##1{\let##1\empty}%
4914 % All control words become @asis by default; overrides below.
4915 \let\definedummyword\definedummyaccent
4916 \commondummiesnofonts
4918 % Don't no-op \tt, since it isn't a user-level command
4919 % and is used in the definitions of the active chars like <, >, |, etc.
4920 % Likewise with the other plain tex font commands.
4921 %\let\tt=\asis
4923 \def\ { }%
4924 \def\@{@}%
4925 \def\_{\normalunderscore}%
4926 \def\-{}% @- shouldn't affect sorting
4928 \uccode`\1=`\{ \uppercase{\def\{{1}}%
4929 \uccode`\1=`\} \uppercase{\def\}{1}}%
4930 \let\lbracechar\{%
4931 \let\rbracechar\}%
4933 % Non-English letters.
4934 \def\AA{AA}%
4935 \def\AE{AE}%
4936 \def\DH{DZZ}%
4937 \def\L{L}%
4938 \def\OE{OE}%
4939 \def\O{O}%
4940 \def\TH{TH}%
4941 \def\aa{aa}%
4942 \def\ae{ae}%
4943 \def\dh{dzz}%
4944 \def\exclamdown{!}%
4945 \def\l{l}%
4946 \def\oe{oe}%
4947 \def\ordf{a}%
4948 \def\ordm{o}%
4949 \def\o{o}%
4950 \def\questiondown{?}%
4951 \def\ss{ss}%
4952 \def\th{th}%
4954 \def\LaTeX{LaTeX}%
4955 \def\TeX{TeX}%
4957 % Assorted special characters.
4958 % (The following {} will end up in the sort string, but that's ok.)
4959 \def\arrow{->}%
4960 \def\bullet{bullet}%
4961 \def\comma{,}%
4962 \def\copyright{copyright}%
4963 \def\dots{...}%
4964 \def\enddots{...}%
4965 \def\equiv{==}%
4966 \def\error{error}%
4967 \def\euro{euro}%
4968 \def\expansion{==>}%
4969 \def\geq{>=}%
4970 \def\guillemetleft{<<}%
4971 \def\guillemetright{>>}%
4972 \def\guilsinglleft{<}%
4973 \def\guilsinglright{>}%
4974 \def\leq{<=}%
4975 \def\minus{-}%
4976 \def\point{.}%
4977 \def\pounds{pounds}%
4978 \def\print{-|}%
4979 \def\quotedblbase{"}%
4980 \def\quotedblleft{"}%
4981 \def\quotedblright{"}%
4982 \def\quoteleft{`}%
4983 \def\quoteright{'}%
4984 \def\quotesinglbase{,}%
4985 \def\registeredsymbol{R}%
4986 \def\result{=>}%
4987 \def\textdegree{o}%
4989 % We need to get rid of all macros, leaving only the arguments (if present).
4990 % Of course this is not nearly correct, but it is the best we can do for now.
4991 % makeinfo does not expand macros in the argument to @deffn, which ends up
4992 % writing an index entry, and texindex isn't prepared for an index sort entry
4993 % that starts with \.
4995 % Since macro invocations are followed by braces, we can just redefine them
4996 % to take a single TeX argument. The case of a macro invocation that
4997 % goes to end-of-line is not handled.
4999 \macrolist
5003 \let\SETmarginindex=\relax % put index entries in margin (undocumented)?
5005 % Most index entries go through here, but \dosubind is the general case.
5006 % #1 is the index name, #2 is the entry text.
5007 \def\doind#1#2{\dosubind{#1}{#2}{}}
5009 % There is also \dosubind {index}{topic}{subtopic}
5010 % which makes an entry in a two-level index such as the operation index.
5011 % TODO: Two-level index? Operation index?
5013 % Workhorse for all indexes.
5014 % #1 is name of index, #2 is stuff to put there, #3 is subentry --
5015 % empty if called from \doind, as we usually are (the main exception
5016 % is with most defuns, which call us directly).
5018 \def\dosubind#1#2#3{%
5019 \iflinks
5021 \requireopenindexfile{#1}%
5022 % Store the main index entry text (including the third arg).
5023 \toks0 = {#2}%
5024 % If third arg is present, precede it with a space.
5025 \def\thirdarg{#3}%
5026 \ifx\thirdarg\empty \else
5027 \toks0 = \expandafter{\the\toks0 \space #3}%
5030 \edef\writeto{\csname#1indfile\endcsname}%
5032 \safewhatsit\dosubindwrite
5037 % Check if an index file has been opened, and if not, open it.
5038 \def\requireopenindexfile#1{%
5039 \ifnum\csname #1indfile\endcsname=0
5040 \expandafter\newwrite \csname#1indfile\endcsname
5041 \edef\suffix{#1}%
5042 % A .fls suffix would conflict with the file extension for the output
5043 % of -recorder, so use .f1s instead.
5044 \ifx\suffix\indexisfl\def\suffix{f1}\fi
5045 % Open the file
5046 \immediate\openout\csname#1indfile\endcsname \jobname.\suffix
5047 % Using \immediate here prevents an object entering into the current box,
5048 % which could confound checks such as those in \safewhatsit for preceding
5049 % skips.
5050 \fi}
5051 \def\indexisfl{fl}
5053 % Output \ as {\indexbackslash}, because \ is an escape character in
5054 % the index files.
5055 \let\indexbackslash=\relax
5056 {\catcode`\@=0 \catcode`\\=\active
5057 @gdef@useindexbackslash{@def\{{@indexbackslash}}}
5060 % Definition for writing index entry text.
5061 \def\sortas#1{\ignorespaces}%
5063 % Definition for writing index entry sort key. Should occur at the at
5064 % the beginning of the index entry, like
5065 % @cindex @sortas{september} \september
5066 % The \ignorespaces takes care of following space, but there's no way
5067 % to remove space before it.
5069 \catcode`\-=13
5070 \gdef\indexwritesortas{%
5071 \begingroup
5072 \indexnonalnumreappear
5073 \indexwritesortasxxx}
5074 \gdef\indexwritesortasxxx#1{%
5075 \xdef\indexsortkey{#1}\endgroup}
5079 % Write the entry in \toks0 to the index file.
5081 \def\dosubindwrite{%
5082 % Put the index entry in the margin if desired.
5083 \ifx\SETmarginindex\relax\else
5084 \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}%
5087 % Remember, we are within a group.
5088 \indexdummies % Must do this here, since \bf, etc expand at this stage
5089 \useindexbackslash % \indexbackslash isn't defined now so it will be output
5090 % as is; and it will print as backslash.
5091 % The braces around \indexbrace are recognized by texindex.
5093 % Get the string to sort by, by processing the index entry with all
5094 % font commands turned off.
5095 {\indexnofonts
5096 \def\lbracechar{{\indexlbrace}}%
5097 \def\rbracechar{{\indexrbrace}}%
5098 \let\{=\lbracechar
5099 \let\}=\rbracechar
5100 \indexnonalnumdisappear
5101 \xdef\indexsortkey{}%
5102 \let\sortas=\indexwritesortas
5103 \edef\temp{\the\toks0}%
5104 \setbox\dummybox = \hbox{\temp}% Make sure to execute any \sortas
5105 \ifx\indexsortkey\empty
5106 \xdef\indexsortkey{\temp}%
5107 \ifx\indexsortkey\empty\xdef\indexsortkey{ }\fi
5111 % Set up the complete index entry, with both the sort key and
5112 % the original text, including any font commands. We write
5113 % three arguments to \entry to the .?? file (four in the
5114 % subentry case), texindex reduces to two when writing the .??s
5115 % sorted result.
5116 \edef\temp{%
5117 \write\writeto{%
5118 \string\entry{\indexsortkey}{\noexpand\folio}{\the\toks0}}%
5120 \temp
5122 \newbox\dummybox % used above
5124 % Take care of unwanted page breaks/skips around a whatsit:
5126 % If a skip is the last thing on the list now, preserve it
5127 % by backing up by \lastskip, doing the \write, then inserting
5128 % the skip again. Otherwise, the whatsit generated by the
5129 % \write or \pdfdest will make \lastskip zero. The result is that
5130 % sequences like this:
5131 % @end defun
5132 % @tindex whatever
5133 % @defun ...
5134 % will have extra space inserted, because the \medbreak in the
5135 % start of the @defun won't see the skip inserted by the @end of
5136 % the previous defun.
5138 % But don't do any of this if we're not in vertical mode. We
5139 % don't want to do a \vskip and prematurely end a paragraph.
5141 % Avoid page breaks due to these extra skips, too.
5143 % But wait, there is a catch there:
5144 % We'll have to check whether \lastskip is zero skip. \ifdim is not
5145 % sufficient for this purpose, as it ignores stretch and shrink parts
5146 % of the skip. The only way seems to be to check the textual
5147 % representation of the skip.
5149 % The following is almost like \def\zeroskipmacro{0.0pt} except that
5150 % the ``p'' and ``t'' characters have catcode \other, not 11 (letter).
5152 \edef\zeroskipmacro{\expandafter\the\csname z@skip\endcsname}
5154 \newskip\whatsitskip
5155 \newcount\whatsitpenalty
5157 % ..., ready, GO:
5159 \def\safewhatsit#1{\ifhmode
5161 \else
5162 % \lastskip and \lastpenalty cannot both be nonzero simultaneously.
5163 \whatsitskip = \lastskip
5164 \edef\lastskipmacro{\the\lastskip}%
5165 \whatsitpenalty = \lastpenalty
5167 % If \lastskip is nonzero, that means the last item was a
5168 % skip. And since a skip is discardable, that means this
5169 % -\whatsitskip glue we're inserting is preceded by a
5170 % non-discardable item, therefore it is not a potential
5171 % breakpoint, therefore no \nobreak needed.
5172 \ifx\lastskipmacro\zeroskipmacro
5173 \else
5174 \vskip-\whatsitskip
5179 \ifx\lastskipmacro\zeroskipmacro
5180 % If \lastskip was zero, perhaps the last item was a penalty, and
5181 % perhaps it was >=10000, e.g., a \nobreak. In that case, we want
5182 % to re-insert the same penalty (values >10000 are used for various
5183 % signals); since we just inserted a non-discardable item, any
5184 % following glue (such as a \parskip) would be a breakpoint. For example:
5185 % @deffn deffn-whatever
5186 % @vindex index-whatever
5187 % Description.
5188 % would allow a break between the index-whatever whatsit
5189 % and the "Description." paragraph.
5190 \ifnum\whatsitpenalty>9999 \penalty\whatsitpenalty \fi
5191 \else
5192 % On the other hand, if we had a nonzero \lastskip,
5193 % this make-up glue would be preceded by a non-discardable item
5194 % (the whatsit from the \write), so we must insert a \nobreak.
5195 \nobreak\vskip\whatsitskip
5197 \fi}
5199 % The index entry written in the file actually looks like
5200 % \entry {sortstring}{page}{topic}
5201 % or
5202 % \entry {sortstring}{page}{topic}{subtopic}
5203 % The texindex program reads in these files and writes files
5204 % containing these kinds of lines:
5205 % \initial {c}
5206 % before the first topic whose initial is c
5207 % \entry {topic}{pagelist}
5208 % for a topic that is used without subtopics
5209 % \primary {topic}
5210 % for the beginning of a topic that is used with subtopics
5211 % \secondary {subtopic}{pagelist}
5212 % for each subtopic.
5214 % Define the user-accessible indexing commands
5215 % @findex, @vindex, @kindex, @cindex.
5217 \def\findex {\fnindex}
5218 \def\kindex {\kyindex}
5219 \def\cindex {\cpindex}
5220 \def\vindex {\vrindex}
5221 \def\tindex {\tpindex}
5222 \def\pindex {\pgindex}
5224 \def\cindexsub {\begingroup\obeylines\cindexsub}
5225 {\obeylines %
5226 \gdef\cindexsub "#1" #2^^M{\endgroup %
5227 \dosubind{cp}{#2}{#1}}}
5229 % Define the macros used in formatting output of the sorted index material.
5231 % @printindex causes a particular index (the ??s file) to get printed.
5232 % It does not print any chapter heading (usually an @unnumbered).
5234 \parseargdef\printindex{\begingroup
5235 \dobreak \chapheadingskip{10000}%
5237 \smallfonts \rm
5238 \tolerance = 9500
5239 \plainfrenchspacing
5240 \everypar = {}% don't want the \kern\-parindent from indentation suppression.
5242 % See if the index file exists and is nonempty.
5243 % Change catcode of @ here so that if the index file contains
5244 % \initial {@}
5245 % as its first line, TeX doesn't complain about mismatched braces
5246 % (because it thinks @} is a control sequence).
5247 \catcode`\@ = 11
5248 % See comment in \requireopenindexfile.
5249 \def\indexname{#1}\ifx\indexname\indexisfl\def\indexname{f1}\fi
5250 \openin 1 \jobname.\indexname s
5251 \ifeof 1
5252 % \enddoublecolumns gets confused if there is no text in the index,
5253 % and it loses the chapter title and the aux file entries for the
5254 % index. The easiest way to prevent this problem is to make sure
5255 % there is some text.
5256 \putwordIndexNonexistent
5257 \else
5258 \catcode`\\ = 0
5259 \escapechar = `\\
5261 % If the index file exists but is empty, then \openin leaves \ifeof
5262 % false. We have to make TeX try to read something from the file, so
5263 % it can discover if there is anything in it.
5264 \read 1 to \thisline
5265 \ifeof 1
5266 \putwordIndexIsEmpty
5267 \else
5268 % Index files are almost Texinfo source, but we use \ as the escape
5269 % character. It would be better to use @, but that's too big a change
5270 % to make right now.
5271 \def\indexbackslash{\ttbackslash}%
5272 \let\indexlbrace\{ % Likewise, set these sequences for braces
5273 \let\indexrbrace\} % used in the sort key.
5274 \begindoublecolumns
5275 \let\entryorphanpenalty=\indexorphanpenalty
5277 % Read input from the index file line by line.
5278 \loopdo
5279 \ifeof1
5280 \let\firsttoken\relax
5281 \else
5282 \read 1 to \nextline
5283 \edef\act{\gdef\noexpand\firsttoken{\getfirsttoken\nextline}}%
5284 \act
5286 \thisline
5288 \ifeof1\else
5289 \let\thisline\nextline
5290 \repeat
5292 \enddoublecolumns
5295 \closein 1
5296 \endgroup}
5298 \def\getfirsttoken#1{\expandafter\getfirsttokenx#1\endfirsttoken}
5299 \long\def\getfirsttokenx#1#2\endfirsttoken{\noexpand#1}
5301 \def\loopdo#1\repeat{\def\body{#1}\loopdoxxx}
5302 \def\loopdoxxx{\let\next=\relax\body\let\next=\loopdoxxx\fi\next}
5304 % These macros are used by the sorted index file itself.
5305 % Change them to control the appearance of the index.
5307 {\catcode`\/=13 \catcode`\-=13 \catcode`\^=13 \catcode`\~=13 \catcode`\_=13
5308 \catcode`\|=13 \catcode`\<=13 \catcode`\>=13 \catcode`\+=13 \catcode`\"=13
5309 \catcode`\$=3
5310 \gdef\initialglyphs{%
5311 % Some changes for non-alphabetic characters. Using the glyphs from the
5312 % math fonts looks more consistent than the typewriter font used elsewhere
5313 % for these characters.
5314 \def\indexbackslash{\math{\backslash}}%
5315 \let\\=\indexbackslash
5317 % Can't get bold backslash so don't use bold forward slash
5318 \catcode`\/=13
5319 \def/{{\secrmnotbold \normalslash}}%
5320 \def-{{\normaldash\normaldash}}% en dash `--'
5321 \def^{{\chapbf \normalcaret}}%
5322 \def~{{\chapbf \normaltilde}}%
5323 \def\_{%
5324 \leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em }%
5325 \def|{$\vert$}%
5326 \def<{$\less$}%
5327 \def>{$\gtr$}%
5328 \def+{$\normalplus$}%
5331 \def\initial{%
5332 \bgroup
5333 \initialglyphs
5334 \initialx
5337 \def\initialx#1{%
5338 % Remove any glue we may have, we'll be inserting our own.
5339 \removelastskip
5341 % We like breaks before the index initials, so insert a bonus.
5342 % The glue before the bonus allows a little bit of space at the
5343 % bottom of a column to reduce an increase in inter-line spacing.
5344 \nobreak
5345 \vskip 0pt plus 5\baselineskip
5346 \penalty -300
5347 \vskip 0pt plus -5\baselineskip
5349 % Typeset the initial. Making this add up to a whole number of
5350 % baselineskips increases the chance of the dots lining up from column
5351 % to column. It still won't often be perfect, because of the stretch
5352 % we need before each entry, but it's better.
5354 % No shrink because it confuses \balancecolumns.
5355 \vskip 1.67\baselineskip plus 1\baselineskip
5356 \leftline{\secfonts \kern-0.05em \secbf #1}%
5357 % \secfonts is inside the argument of \leftline so that the change of
5358 % \baselineskip will not affect any glue inserted before the vbox that
5359 % \leftline creates.
5360 % Do our best not to break after the initial.
5361 \nobreak
5362 \vskip .33\baselineskip plus .1\baselineskip
5363 \egroup % \initialglyphs
5366 \newdimen\entryrightmargin
5367 \entryrightmargin=0pt
5369 % \entry typesets a paragraph consisting of the text (#1), dot leaders, and
5370 % then page number (#2) flushed to the right margin. It is used for index
5371 % and table of contents entries. The paragraph is indented by \leftskip.
5373 \def\entry{%
5374 \begingroup
5376 % Start a new paragraph if necessary, so our assignments below can't
5377 % affect previous text.
5378 \par
5380 % No extra space above this paragraph.
5381 \parskip = 0in
5383 % When reading the text of entry, convert explicit line breaks
5384 % from @* into spaces. The user might give these in long section
5385 % titles, for instance.
5386 \def\*{\unskip\space\ignorespaces}%
5387 \def\entrybreak{\hfil\break}% An undocumented command
5389 % A bit of stretch before each entry for the benefit of balancing
5390 % columns.
5391 \vskip 0pt plus0.5pt
5393 % Swallow the left brace of the text (first parameter):
5394 \afterassignment\doentry
5395 \let\temp =
5397 \def\entrybreak{\unskip\space\ignorespaces}%
5398 \def\doentry{%
5399 % Save the text of the entry
5400 \global\setbox\boxA=\hbox\bgroup
5401 \bgroup % Instead of the swallowed brace.
5402 \noindent
5403 \aftergroup\finishentry
5404 % And now comes the text of the entry.
5405 % Not absorbing as a macro argument reduces the chance of problems
5406 % with catcodes occurring.
5408 {\catcode`\@=11
5409 \gdef\finishentry#1{%
5410 \egroup % end box A
5411 \dimen@ = \wd\boxA % Length of text of entry
5412 \global\setbox\boxA=\hbox\bgroup\unhbox\boxA
5413 % #1 is the page number.
5415 % Get the width of the page numbers, and only use
5416 % leaders if they are present.
5417 \global\setbox\boxB = \hbox{#1}%
5418 \ifdim\wd\boxB = 0pt
5419 \null\nobreak\hfill\ %
5420 \else
5422 \null\nobreak\indexdotfill % Have leaders before the page number.
5424 \ifpdf
5425 \pdfgettoks#1.%
5426 \bgroup\let\domark\relax
5427 \hskip\skip\thinshrinkable\the\toksA
5428 \egroup
5429 % The redefinion of \domark stops marks being added in \pdflink to
5430 % preserve coloured links across page boundaries. Otherwise the marks
5431 % would get in the way of \lastbox in \insertindexentrybox.
5432 \else
5433 \hskip\skip\thinshrinkable #1%
5436 \egroup % end \boxA
5437 \ifdim\wd\boxB = 0pt
5438 \global\setbox\entryindexbox=\vbox{\unhbox\boxA}%
5439 \else
5440 \global\setbox\entryindexbox=\vbox\bgroup
5441 \prevdepth=\entrylinedepth
5442 \noindent
5443 % We want the text of the entries to be aligned to the left, and the
5444 % page numbers to be aligned to the right.
5446 \advance\leftskip by 0pt plus 1fil
5447 \advance\leftskip by 0pt plus -1fill
5448 \rightskip = 0pt plus -1fil
5449 \advance\rightskip by 0pt plus 1fill
5450 % Cause last line, which could consist of page numbers on their own
5451 % if the list of page numbers is long, to be aligned to the right.
5452 \parfillskip=0pt plus -1fill
5454 \hangindent=1em
5456 \advance\rightskip by \entryrightmargin
5457 % Determine how far we can stretch into the margin.
5458 % This allows, e.g., "Appendix H GNU Free Documentation License" to
5459 % fit on one line in @letterpaper format.
5460 \ifdim\entryrightmargin>2.1em
5461 \dimen@i=2.1em
5462 \else
5463 \dimen@i=0em
5465 \advance \parfillskip by 0pt minus 1\dimen@i
5467 \dimen@ii = \hsize
5468 \advance\dimen@ii by -1\leftskip
5469 \advance\dimen@ii by -1\entryrightmargin
5470 \advance\dimen@ii by 1\dimen@i
5471 \ifdim\wd\boxA > \dimen@ii % If the entry doesn't fit in one line
5472 \ifdim\dimen@ > 0.8\dimen@ii % due to long index text
5473 \dimen@ = 0.7\dimen@ % Try to split the text roughly evenly
5474 \dimen@ii = \hsize
5475 \advance \dimen@ii by -1em
5476 \ifnum\dimen@>\dimen@ii
5477 % If the entry is too long, use the whole line
5478 \dimen@ = \dimen@ii
5480 \advance\leftskip by 0pt plus 1fill % ragged right
5481 \advance \dimen@ by 1\rightskip
5482 \parshape = 2 0pt \dimen@ 1em \dimen@ii
5483 % Ideally we'd add a finite glue at the end of the first line only, but
5484 % TeX doesn't seem to provide a way to do such a thing.
5485 \fi\fi
5486 \unhbox\boxA
5488 % Do not prefer a separate line ending with a hyphen to fewer lines.
5489 \finalhyphendemerits = 0
5491 % Word spacing - no stretch
5492 \spaceskip=\fontdimen2\font minus \fontdimen4\font
5494 \linepenalty=1000 % Discourage line breaks.
5495 \hyphenpenalty=5000 % Discourage hyphenation.
5497 \par % format the paragraph
5498 \egroup % The \vbox
5500 \endgroup
5501 % delay text of entry until after penalty
5502 \bgroup\aftergroup\insertindexentrybox
5503 \entryorphanpenalty
5506 \newskip\thinshrinkable
5507 \skip\thinshrinkable=.15em minus .15em
5509 \newbox\entryindexbox
5510 \def\insertindexentrybox{%
5511 \copy\entryindexbox
5512 % The following gets the depth of the last box. This is for even
5513 % line spacing when entries span several lines.
5514 \setbox\dummybox\vbox{%
5515 \unvbox\entryindexbox
5516 \nointerlineskip
5517 \lastbox
5518 \global\entrylinedepth=\prevdepth
5520 % Note that we couldn't simply \unvbox\entryindexbox followed by
5521 % \nointerlineskip\lastbox to remove the last box and then reinstate it,
5522 % because this resets how far the box has been \moveleft'ed to 0. \unvbox
5523 % doesn't affect \prevdepth either.
5525 \newdimen\entrylinedepth
5527 % Default is no penalty
5528 \let\entryorphanpenalty\egroup
5530 % Used from \printindex. \firsttoken should be the first token
5531 % after the \entry. If it's not another \entry, we are at the last
5532 % line of a group of index entries, so insert a penalty to discourage
5533 % orphaned index entries.
5534 \long\def\indexorphanpenalty{%
5535 \def\isentry{\entry}%
5536 \ifx\firsttoken\isentry
5537 \else
5538 \unskip\penalty 9000
5539 % The \unskip here stops breaking before the glue. It relies on the
5540 % \vskip above being there, otherwise there is an error
5541 % "You can't use `\unskip' in vertical mode". There has to be glue
5542 % in the current vertical list that hasn't been added to the
5543 % "current page". See Chapter 24 of the TeXbook. This contradicts
5544 % Section 8.3.7 in "TeX by Topic," though.
5546 \egroup % now comes the box added with \aftergroup
5549 % Like plain.tex's \dotfill, except uses up at least 1 em.
5550 % The filll stretch here overpowers both the fil and fill stretch to push
5551 % the page number to the right.
5552 \def\indexdotfill{\cleaders
5553 \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1filll}
5556 \def\primary #1{\line{#1\hfil}}
5558 \newskip\secondaryindent \secondaryindent=0.5cm
5559 \def\secondary#1#2{{%
5560 \parfillskip=0in
5561 \parskip=0in
5562 \hangindent=1in
5563 \hangafter=1
5564 \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill
5565 \ifpdf
5566 \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph.
5567 \else
5570 \par
5573 % Define two-column mode, which we use to typeset indexes.
5574 % Adapted from the TeXbook, page 416, which is to say,
5575 % the manmac.tex format used to print the TeXbook itself.
5576 \catcode`\@=11 % private names
5578 \newbox\partialpage
5579 \newdimen\doublecolumnhsize
5580 \newdimen\doublecolumntopgap
5581 \doublecolumntopgap = 0pt
5583 % Use inside an output routine to save \topmark and \firstmark
5584 \def\savemarks{%
5585 \global\savedtopmark=\expandafter{\topmark }%
5586 \global\savedfirstmark=\expandafter{\firstmark }%
5588 \newtoks\savedtopmark
5589 \newtoks\savedfirstmark
5591 % Set \topmark and \firstmark for next time \output runs.
5592 % Can't be run from withinside \output (because any material
5593 % added while an output routine is active, including
5594 % penalties, is saved for after it finishes). The page so far
5595 % should be empty, otherwise what's on it will be thrown away.
5596 \def\restoremarks{%
5597 \mark{\the\savedtopmark}%
5598 \bgroup\output = {%
5599 \setbox\dummybox=\box\PAGE
5600 }abc\eject\egroup
5601 % "abc" because output routine doesn't fire for a completely empty page.
5602 \mark{\the\savedfirstmark}%
5605 \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
5606 % If not much space left on page, start a new page.
5607 \ifdim\pagetotal>0.8\vsize\vfill\eject\fi
5609 % Grab any single-column material above us.
5610 \output = {%
5612 % Here is a possibility not foreseen in manmac: if we accumulate a
5613 % whole lot of material, we might end up calling this \output
5614 % routine twice in a row (see the doublecol-lose test, which is
5615 % essentially a couple of indexes with @setchapternewpage off). In
5616 % that case we just ship out what is in \partialpage with the normal
5617 % output routine. Generally, \partialpage will be empty when this
5618 % runs and this will be a no-op. See the indexspread.tex test case.
5619 \ifvoid\partialpage \else
5620 \onepageout{\pagecontents\partialpage}%
5623 \global\setbox\partialpage = \vbox{%
5624 % Unvbox the main output page.
5625 \unvbox\PAGE
5626 \kern-\topskip \kern\baselineskip
5628 \savemarks
5630 \eject % run that output routine to set \partialpage
5631 \restoremarks
5633 % We recover the two marks that the last output routine saved in order
5634 % to propagate the information in marks added around a chapter heading,
5635 % which could be otherwise be lost by the time the final page is output.
5638 % Use the double-column output routine for subsequent pages.
5639 \output = {\doublecolumnout}%
5641 % Change the page size parameters. We could do this once outside this
5642 % routine, in each of @smallbook, @afourpaper, and the default 8.5x11
5643 % format, but then we repeat the same computation. Repeating a couple
5644 % of assignments once per index is clearly meaningless for the
5645 % execution time, so we may as well do it in one place.
5647 % First we halve the line length, less a little for the gutter between
5648 % the columns. We compute the gutter based on the line length, so it
5649 % changes automatically with the paper format. The magic constant
5650 % below is chosen so that the gutter has the same value (well, +-<1pt)
5651 % as it did when we hard-coded it.
5653 % We put the result in a separate register, \doublecolumhsize, so we
5654 % can restore it in \pagesofar, after \hsize itself has (potentially)
5655 % been clobbered.
5657 \doublecolumnhsize = \hsize
5658 \advance\doublecolumnhsize by -.04154\hsize
5659 \divide\doublecolumnhsize by 2
5660 \hsize = \doublecolumnhsize
5662 % Double the \vsize as well. (We don't need a separate register here,
5663 % since nobody clobbers \vsize.)
5664 \global\doublecolumntopgap = \topskip
5665 \global\advance\doublecolumntopgap by -1\baselineskip
5666 \advance\vsize by -1\doublecolumntopgap
5667 \vsize = 2\vsize
5668 \topskip=0pt
5669 \global\entrylinedepth=0pt\relax
5672 % The double-column output routine for all double-column pages except
5673 % the last, which is done by \balancecolumns.
5675 \def\doublecolumnout{%
5677 \splittopskip=\topskip \splitmaxdepth=\maxdepth
5678 % Get the available space for the double columns -- the normal
5679 % (undoubled) page height minus any material left over from the
5680 % previous page.
5681 \dimen@ = \vsize
5682 \divide\dimen@ by 2
5683 \advance\dimen@ by -\ht\partialpage
5685 % box0 will be the left-hand column, box2 the right.
5686 \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
5687 \onepageout\pagesofar
5688 \unvbox255
5689 \penalty\outputpenalty
5692 % Re-output the contents of the output page -- any previous material,
5693 % followed by the two boxes we just split, in box0 and box2.
5694 \def\pagesofar{%
5695 \unvbox\partialpage
5697 \hsize = \doublecolumnhsize
5698 \wd0=\hsize \wd2=\hsize
5699 \vbox{%
5700 \vskip\doublecolumntopgap
5701 \hbox to\txipagewidth{\box0\hfil\box2}}%
5705 % Finished with with double columns.
5706 \def\enddoublecolumns{%
5707 % The following penalty ensures that the page builder is exercised
5708 % _before_ we change the output routine. This is necessary in the
5709 % following situation:
5711 % The last section of the index consists only of a single entry.
5712 % Before this section, \pagetotal is less than \pagegoal, so no
5713 % break occurs before the last section starts. However, the last
5714 % section, consisting of \initial and the single \entry, does not
5715 % fit on the page and has to be broken off. Without the following
5716 % penalty the page builder will not be exercised until \eject
5717 % below, and by that time we'll already have changed the output
5718 % routine to the \balancecolumns version, so the next-to-last
5719 % double-column page will be processed with \balancecolumns, which
5720 % is wrong: The two columns will go to the main vertical list, with
5721 % the broken-off section in the recent contributions. As soon as
5722 % the output routine finishes, TeX starts reconsidering the page
5723 % break. The two columns and the broken-off section both fit on the
5724 % page, because the two columns now take up only half of the page
5725 % goal. When TeX sees \eject from below which follows the final
5726 % section, it invokes the new output routine that we've set after
5727 % \balancecolumns below; \onepageout will try to fit the two columns
5728 % and the final section into the vbox of \txipageheight (see
5729 % \pagebody), causing an overfull box.
5731 % Note that glue won't work here, because glue does not exercise the
5732 % page builder, unlike penalties (see The TeXbook, pp. 280-281).
5733 \penalty0
5735 \output = {%
5736 % Split the last of the double-column material.
5737 \savemarks
5738 \balancecolumns
5740 % Having called \balancecolumns once, we do not
5741 % want to call it again. Therefore, reset \output to its normal
5742 % definition right away.
5743 \global\output = {\onepageout{\pagecontents\PAGE}}%
5745 \eject
5746 \endgroup % started in \begindoublecolumns
5747 \restoremarks
5748 % Leave the double-column material on the current page, no automatic
5749 % page break.
5750 \box\balancedcolumns
5752 % \pagegoal was set to the doubled \vsize above, since we restarted
5753 % the current page. We're now back to normal single-column
5754 % typesetting, so reset \pagegoal to the normal \vsize (after the
5755 % \endgroup where \vsize got restored).
5756 \pagegoal = \vsize
5758 \newbox\balancedcolumns
5759 \setbox\balancedcolumns=\vbox{shouldnt see this}%
5761 % Only called for the last of the double column material. \doublecolumnout
5762 % does the others.
5763 \def\balancecolumns{%
5764 \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120.
5765 \dimen@ = \ht0
5766 \advance\dimen@ by \topskip
5767 \advance\dimen@ by-\baselineskip
5768 \ifdim\dimen@<14\baselineskip
5769 % Don't split a short final column in two.
5770 \setbox2=\vbox{}%
5771 \else
5772 \divide\dimen@ by 2 % target to split to
5773 \dimen@ii = \dimen@
5774 \splittopskip = \topskip
5775 % Loop until the second column is no higher than the first
5777 \vbadness = 10000
5778 \loop
5779 \global\setbox3 = \copy0
5780 \global\setbox1 = \vsplit3 to \dimen@
5781 % Remove glue from bottom of first column to
5782 % make sure it is higher than the second.
5783 \global\setbox1 = \vbox{\unvbox1\unpenalty\unskip}%
5784 \ifdim\ht3>\ht1
5785 \global\advance\dimen@ by 1pt
5786 \repeat
5788 \multiply\dimen@ii by 4
5789 \divide\dimen@ii by 5
5790 \ifdim\ht3<\dimen@ii
5791 % Column heights are too different, so don't make their bottoms
5792 % flush with each other. The glue at the end of the second column
5793 % allows a second column to stretch, reducing the difference in
5794 % height between the two.
5795 \setbox0=\vbox to\dimen@{\unvbox1\vfill}%
5796 \setbox2=\vbox to\dimen@{\unvbox3\vskip 0pt plus 0.3\ht0}%
5797 \else
5798 \setbox0=\vbox to\dimen@{\unvbox1}%
5799 \setbox2=\vbox to\dimen@{\unvbox3}%
5803 \global\setbox\balancedcolumns=\vbox{\pagesofar}%
5805 \catcode`\@ = \other
5808 \message{sectioning,}
5809 % Chapters, sections, etc.
5811 % Let's start with @part.
5812 \outer\parseargdef\part{\partzzz{#1}}
5813 \def\partzzz#1{%
5814 \chapoddpage
5815 \null
5816 \vskip.3\vsize % move it down on the page a bit
5817 \begingroup
5818 \noindent \titlefonts\rmisbold #1\par % the text
5819 \let\lastnode=\empty % no node to associate with
5820 \writetocentry{part}{#1}{}% but put it in the toc
5821 \headingsoff % no headline or footline on the part page
5822 % This outputs a mark at the end of the page that clears \thischapter
5823 % and \thissection, as is done in \startcontents.
5824 \let\pchapsepmacro\relax
5825 \chapmacro{}{Yomitfromtoc}{}%
5826 \chapoddpage
5827 \endgroup
5830 % \unnumberedno is an oxymoron. But we count the unnumbered
5831 % sections so that we can refer to them unambiguously in the pdf
5832 % outlines by their "section number". We avoid collisions with chapter
5833 % numbers by starting them at 10000. (If a document ever has 10000
5834 % chapters, we're in trouble anyway, I'm sure.)
5835 \newcount\unnumberedno \unnumberedno = 10000
5836 \newcount\chapno
5837 \newcount\secno \secno=0
5838 \newcount\subsecno \subsecno=0
5839 \newcount\subsubsecno \subsubsecno=0
5841 % This counter is funny since it counts through charcodes of letters A, B, ...
5842 \newcount\appendixno \appendixno = `\@
5844 % \def\appendixletter{\char\the\appendixno}
5845 % We do the following ugly conditional instead of the above simple
5846 % construct for the sake of pdftex, which needs the actual
5847 % letter in the expansion, not just typeset.
5849 \def\appendixletter{%
5850 \ifnum\appendixno=`A A%
5851 \else\ifnum\appendixno=`B B%
5852 \else\ifnum\appendixno=`C C%
5853 \else\ifnum\appendixno=`D D%
5854 \else\ifnum\appendixno=`E E%
5855 \else\ifnum\appendixno=`F F%
5856 \else\ifnum\appendixno=`G G%
5857 \else\ifnum\appendixno=`H H%
5858 \else\ifnum\appendixno=`I I%
5859 \else\ifnum\appendixno=`J J%
5860 \else\ifnum\appendixno=`K K%
5861 \else\ifnum\appendixno=`L L%
5862 \else\ifnum\appendixno=`M M%
5863 \else\ifnum\appendixno=`N N%
5864 \else\ifnum\appendixno=`O O%
5865 \else\ifnum\appendixno=`P P%
5866 \else\ifnum\appendixno=`Q Q%
5867 \else\ifnum\appendixno=`R R%
5868 \else\ifnum\appendixno=`S S%
5869 \else\ifnum\appendixno=`T T%
5870 \else\ifnum\appendixno=`U U%
5871 \else\ifnum\appendixno=`V V%
5872 \else\ifnum\appendixno=`W W%
5873 \else\ifnum\appendixno=`X X%
5874 \else\ifnum\appendixno=`Y Y%
5875 \else\ifnum\appendixno=`Z Z%
5876 % The \the is necessary, despite appearances, because \appendixletter is
5877 % expanded while writing the .toc file. \char\appendixno is not
5878 % expandable, thus it is written literally, thus all appendixes come out
5879 % with the same letter (or @) in the toc without it.
5880 \else\char\the\appendixno
5881 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
5882 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
5884 % Each @chapter defines these (using marks) as the number+name, number
5885 % and name of the chapter. Page headings and footings can use
5886 % these. @section does likewise.
5887 \def\thischapter{}
5888 \def\thischapternum{}
5889 \def\thischaptername{}
5890 \def\thissection{}
5891 \def\thissectionnum{}
5892 \def\thissectionname{}
5894 \newcount\absseclevel % used to calculate proper heading level
5895 \newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count
5897 % @raisesections: treat @section as chapter, @subsection as section, etc.
5898 \def\raisesections{\global\advance\secbase by -1}
5899 \let\up=\raisesections % original BFox name
5901 % @lowersections: treat @chapter as section, @section as subsection, etc.
5902 \def\lowersections{\global\advance\secbase by 1}
5903 \let\down=\lowersections % original BFox name
5905 % we only have subsub.
5906 \chardef\maxseclevel = 3
5908 % A numbered section within an unnumbered changes to unnumbered too.
5909 % To achieve this, remember the "biggest" unnum. sec. we are currently in:
5910 \chardef\unnlevel = \maxseclevel
5912 % Trace whether the current chapter is an appendix or not:
5913 % \chapheadtype is "N" or "A", unnumbered chapters are ignored.
5914 \def\chapheadtype{N}
5916 % Choose a heading macro
5917 % #1 is heading type
5918 % #2 is heading level
5919 % #3 is text for heading
5920 \def\genhead#1#2#3{%
5921 % Compute the abs. sec. level:
5922 \absseclevel=#2
5923 \advance\absseclevel by \secbase
5924 % Make sure \absseclevel doesn't fall outside the range:
5925 \ifnum \absseclevel < 0
5926 \absseclevel = 0
5927 \else
5928 \ifnum \absseclevel > 3
5929 \absseclevel = 3
5932 % The heading type:
5933 \def\headtype{#1}%
5934 \if \headtype U%
5935 \ifnum \absseclevel < \unnlevel
5936 \chardef\unnlevel = \absseclevel
5938 \else
5939 % Check for appendix sections:
5940 \ifnum \absseclevel = 0
5941 \edef\chapheadtype{\headtype}%
5942 \else
5943 \if \headtype A\if \chapheadtype N%
5944 \errmessage{@appendix... within a non-appendix chapter}%
5945 \fi\fi
5947 % Check for numbered within unnumbered:
5948 \ifnum \absseclevel > \unnlevel
5949 \def\headtype{U}%
5950 \else
5951 \chardef\unnlevel = 3
5954 % Now print the heading:
5955 \if \headtype U%
5956 \ifcase\absseclevel
5957 \unnumberedzzz{#3}%
5958 \or \unnumberedseczzz{#3}%
5959 \or \unnumberedsubseczzz{#3}%
5960 \or \unnumberedsubsubseczzz{#3}%
5962 \else
5963 \if \headtype A%
5964 \ifcase\absseclevel
5965 \appendixzzz{#3}%
5966 \or \appendixsectionzzz{#3}%
5967 \or \appendixsubseczzz{#3}%
5968 \or \appendixsubsubseczzz{#3}%
5970 \else
5971 \ifcase\absseclevel
5972 \chapterzzz{#3}%
5973 \or \seczzz{#3}%
5974 \or \numberedsubseczzz{#3}%
5975 \or \numberedsubsubseczzz{#3}%
5979 \suppressfirstparagraphindent
5982 % an interface:
5983 \def\numhead{\genhead N}
5984 \def\apphead{\genhead A}
5985 \def\unnmhead{\genhead U}
5987 % @chapter, @appendix, @unnumbered. Increment top-level counter, reset
5988 % all lower-level sectioning counters to zero.
5990 % Also set \chaplevelprefix, which we prepend to @float sequence numbers
5991 % (e.g., figures), q.v. By default (before any chapter), that is empty.
5992 \let\chaplevelprefix = \empty
5994 \outer\parseargdef\chapter{\numhead0{#1}} % normally numhead0 calls chapterzzz
5995 \def\chapterzzz#1{%
5996 % section resetting is \global in case the chapter is in a group, such
5997 % as an @include file.
5998 \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
5999 \global\advance\chapno by 1
6001 % Used for \float.
6002 \gdef\chaplevelprefix{\the\chapno.}%
6003 \resetallfloatnos
6005 % \putwordChapter can contain complex things in translations.
6006 \toks0=\expandafter{\putwordChapter}%
6007 \message{\the\toks0 \space \the\chapno}%
6009 % Write the actual heading.
6010 \chapmacro{#1}{Ynumbered}{\the\chapno}%
6012 % So @section and the like are numbered underneath this chapter.
6013 \global\let\section = \numberedsec
6014 \global\let\subsection = \numberedsubsec
6015 \global\let\subsubsection = \numberedsubsubsec
6018 \outer\parseargdef\appendix{\apphead0{#1}} % normally calls appendixzzz
6020 \def\appendixzzz#1{%
6021 \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
6022 \global\advance\appendixno by 1
6023 \gdef\chaplevelprefix{\appendixletter.}%
6024 \resetallfloatnos
6026 % \putwordAppendix can contain complex things in translations.
6027 \toks0=\expandafter{\putwordAppendix}%
6028 \message{\the\toks0 \space \appendixletter}%
6030 \chapmacro{#1}{Yappendix}{\appendixletter}%
6032 \global\let\section = \appendixsec
6033 \global\let\subsection = \appendixsubsec
6034 \global\let\subsubsection = \appendixsubsubsec
6037 % normally unnmhead0 calls unnumberedzzz:
6038 \outer\parseargdef\unnumbered{\unnmhead0{#1}}
6039 \def\unnumberedzzz#1{%
6040 \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
6041 \global\advance\unnumberedno by 1
6043 % Since an unnumbered has no number, no prefix for figures.
6044 \global\let\chaplevelprefix = \empty
6045 \resetallfloatnos
6047 % This used to be simply \message{#1}, but TeX fully expands the
6048 % argument to \message. Therefore, if #1 contained @-commands, TeX
6049 % expanded them. For example, in `@unnumbered The @cite{Book}', TeX
6050 % expanded @cite (which turns out to cause errors because \cite is meant
6051 % to be executed, not expanded).
6053 % Anyway, we don't want the fully-expanded definition of @cite to appear
6054 % as a result of the \message, we just want `@cite' itself. We use
6055 % \the<toks register> to achieve this: TeX expands \the<toks> only once,
6056 % simply yielding the contents of <toks register>. (We also do this for
6057 % the toc entries.)
6058 \toks0 = {#1}%
6059 \message{(\the\toks0)}%
6061 \chapmacro{#1}{Ynothing}{\the\unnumberedno}%
6063 \global\let\section = \unnumberedsec
6064 \global\let\subsection = \unnumberedsubsec
6065 \global\let\subsubsection = \unnumberedsubsubsec
6068 % @centerchap is like @unnumbered, but the heading is centered.
6069 \outer\parseargdef\centerchap{%
6070 \let\centerparametersmaybe = \centerparameters
6071 \unnmhead0{#1}%
6072 \let\centerparametersmaybe = \relax
6075 % @top is like @unnumbered.
6076 \let\top\unnumbered
6078 % Sections.
6080 \outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz
6081 \def\seczzz#1{%
6082 \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
6083 \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}%
6086 % normally calls appendixsectionzzz:
6087 \outer\parseargdef\appendixsection{\apphead1{#1}}
6088 \def\appendixsectionzzz#1{%
6089 \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
6090 \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}%
6092 \let\appendixsec\appendixsection
6094 % normally calls unnumberedseczzz:
6095 \outer\parseargdef\unnumberedsec{\unnmhead1{#1}}
6096 \def\unnumberedseczzz#1{%
6097 \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
6098 \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}%
6101 % Subsections.
6103 % normally calls numberedsubseczzz:
6104 \outer\parseargdef\numberedsubsec{\numhead2{#1}}
6105 \def\numberedsubseczzz#1{%
6106 \global\subsubsecno=0 \global\advance\subsecno by 1
6107 \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}%
6110 % normally calls appendixsubseczzz:
6111 \outer\parseargdef\appendixsubsec{\apphead2{#1}}
6112 \def\appendixsubseczzz#1{%
6113 \global\subsubsecno=0 \global\advance\subsecno by 1
6114 \sectionheading{#1}{subsec}{Yappendix}%
6115 {\appendixletter.\the\secno.\the\subsecno}%
6118 % normally calls unnumberedsubseczzz:
6119 \outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}}
6120 \def\unnumberedsubseczzz#1{%
6121 \global\subsubsecno=0 \global\advance\subsecno by 1
6122 \sectionheading{#1}{subsec}{Ynothing}%
6123 {\the\unnumberedno.\the\secno.\the\subsecno}%
6126 % Subsubsections.
6128 % normally numberedsubsubseczzz:
6129 \outer\parseargdef\numberedsubsubsec{\numhead3{#1}}
6130 \def\numberedsubsubseczzz#1{%
6131 \global\advance\subsubsecno by 1
6132 \sectionheading{#1}{subsubsec}{Ynumbered}%
6133 {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}%
6136 % normally appendixsubsubseczzz:
6137 \outer\parseargdef\appendixsubsubsec{\apphead3{#1}}
6138 \def\appendixsubsubseczzz#1{%
6139 \global\advance\subsubsecno by 1
6140 \sectionheading{#1}{subsubsec}{Yappendix}%
6141 {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}%
6144 % normally unnumberedsubsubseczzz:
6145 \outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}}
6146 \def\unnumberedsubsubseczzz#1{%
6147 \global\advance\subsubsecno by 1
6148 \sectionheading{#1}{subsubsec}{Ynothing}%
6149 {\the\unnumberedno.\the\secno.\the\subsecno.\the\subsubsecno}%
6152 % These macros control what the section commands do, according
6153 % to what kind of chapter we are in (ordinary, appendix, or unnumbered).
6154 % Define them by default for a numbered chapter.
6155 \let\section = \numberedsec
6156 \let\subsection = \numberedsubsec
6157 \let\subsubsection = \numberedsubsubsec
6159 % Define @majorheading, @heading and @subheading
6161 \def\majorheading{%
6162 {\advance\chapheadingskip by 10pt \chapbreak }%
6163 \parsearg\chapheadingzzz
6166 \def\chapheading{\chapbreak \parsearg\chapheadingzzz}
6167 \def\chapheadingzzz#1{%
6168 \vbox{\chapfonts \raggedtitlesettings #1\par}%
6169 \nobreak\bigskip \nobreak
6170 \suppressfirstparagraphindent
6173 % @heading, @subheading, @subsubheading.
6174 \parseargdef\heading{\sectionheading{#1}{sec}{Yomitfromtoc}{}
6175 \suppressfirstparagraphindent}
6176 \parseargdef\subheading{\sectionheading{#1}{subsec}{Yomitfromtoc}{}
6177 \suppressfirstparagraphindent}
6178 \parseargdef\subsubheading{\sectionheading{#1}{subsubsec}{Yomitfromtoc}{}
6179 \suppressfirstparagraphindent}
6181 % These macros generate a chapter, section, etc. heading only
6182 % (including whitespace, linebreaking, etc. around it),
6183 % given all the information in convenient, parsed form.
6185 % Args are the skip and penalty (usually negative)
6186 \def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}
6188 % Parameter controlling skip before chapter headings (if needed)
6189 \newskip\chapheadingskip
6191 % Define plain chapter starts, and page on/off switching for it.
6192 \def\chapbreak{\dobreak \chapheadingskip {-4000}}
6194 % Start a new page
6195 \def\chappager{\par\vfill\supereject}
6197 % \chapoddpage - start on an odd page for a new chapter
6198 % Because \domark is called before \chapoddpage, the filler page will
6199 % get the headings for the next chapter, which is wrong. But we don't
6200 % care -- we just disable all headings on the filler page.
6201 \def\chapoddpage{%
6202 \chappager
6203 \ifodd\pageno \else
6204 \begingroup
6205 \headingsoff
6206 \null
6207 \chappager
6208 \endgroup
6212 \parseargdef\setchapternewpage{\csname CHAPPAG#1\endcsname}
6214 \def\CHAPPAGoff{%
6215 \global\let\contentsalignmacro = \chappager
6216 \global\let\pchapsepmacro=\chapbreak
6217 \global\let\pagealignmacro=\chappager}
6219 \def\CHAPPAGon{%
6220 \global\let\contentsalignmacro = \chappager
6221 \global\let\pchapsepmacro=\chappager
6222 \global\let\pagealignmacro=\chappager
6223 \global\def\HEADINGSon{\HEADINGSsingle}}
6225 \def\CHAPPAGodd{%
6226 \global\let\contentsalignmacro = \chapoddpage
6227 \global\let\pchapsepmacro=\chapoddpage
6228 \global\let\pagealignmacro=\chapoddpage
6229 \global\def\HEADINGSon{\HEADINGSdouble}}
6231 \CHAPPAGon
6233 % \chapmacro - Chapter opening.
6235 % #1 is the text, #2 is the section type (Ynumbered, Ynothing,
6236 % Yappendix, Yomitfromtoc), #3 the chapter number.
6237 % Not used for @heading series.
6239 % To test against our argument.
6240 \def\Ynothingkeyword{Ynothing}
6241 \def\Yappendixkeyword{Yappendix}
6242 \def\Yomitfromtockeyword{Yomitfromtoc}
6244 \def\chapmacro#1#2#3{%
6245 \expandafter\ifx\thisenv\titlepage\else
6246 \checkenv{}% chapters, etc., should not start inside an environment.
6248 % FIXME: \chapmacro is currently called from inside \titlepage when
6249 % \setcontentsaftertitlepage to print the "Table of Contents" heading, but
6250 % this should probably be done by \sectionheading with an option to print
6251 % in chapter size.
6253 % Insert the first mark before the heading break (see notes for \domark).
6254 \let\prevchapterdefs=\lastchapterdefs
6255 \let\prevsectiondefs=\lastsectiondefs
6256 \gdef\lastsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}%
6257 \gdef\thissection{}}%
6259 \def\temptype{#2}%
6260 \ifx\temptype\Ynothingkeyword
6261 \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
6262 \gdef\thischapter{\thischaptername}}%
6263 \else\ifx\temptype\Yomitfromtockeyword
6264 \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
6265 \gdef\thischapter{}}%
6266 \else\ifx\temptype\Yappendixkeyword
6267 \toks0={#1}%
6268 \xdef\lastchapterdefs{%
6269 \gdef\noexpand\thischaptername{\the\toks0}%
6270 \gdef\noexpand\thischapternum{\appendixletter}%
6271 % \noexpand\putwordAppendix avoids expanding indigestible
6272 % commands in some of the translations.
6273 \gdef\noexpand\thischapter{\noexpand\putwordAppendix{}
6274 \noexpand\thischapternum:
6275 \noexpand\thischaptername}%
6277 \else
6278 \toks0={#1}%
6279 \xdef\lastchapterdefs{%
6280 \gdef\noexpand\thischaptername{\the\toks0}%
6281 \gdef\noexpand\thischapternum{\the\chapno}%
6282 % \noexpand\putwordChapter avoids expanding indigestible
6283 % commands in some of the translations.
6284 \gdef\noexpand\thischapter{\noexpand\putwordChapter{}
6285 \noexpand\thischapternum:
6286 \noexpand\thischaptername}%
6288 \fi\fi\fi
6290 % Output the mark. Pass it through \safewhatsit, to take care of
6291 % the preceding space.
6292 \safewhatsit\domark
6294 % Insert the chapter heading break.
6295 \pchapsepmacro
6297 % Now the second mark, after the heading break. No break points
6298 % between here and the heading.
6299 \let\prevchapterdefs=\lastchapterdefs
6300 \let\prevsectiondefs=\lastsectiondefs
6301 \domark
6304 \chapfonts \rmisbold
6305 \let\footnote=\errfootnoteheading % give better error message
6307 % Have to define \lastsection before calling \donoderef, because the
6308 % xref code eventually uses it. On the other hand, it has to be called
6309 % after \pchapsepmacro, or the headline will change too soon.
6310 \gdef\lastsection{#1}%
6312 % Only insert the separating space if we have a chapter/appendix
6313 % number, and don't print the unnumbered ``number''.
6314 \ifx\temptype\Ynothingkeyword
6315 \setbox0 = \hbox{}%
6316 \def\toctype{unnchap}%
6317 \else\ifx\temptype\Yomitfromtockeyword
6318 \setbox0 = \hbox{}% contents like unnumbered, but no toc entry
6319 \def\toctype{omit}%
6320 \else\ifx\temptype\Yappendixkeyword
6321 \setbox0 = \hbox{\putwordAppendix{} #3\enspace}%
6322 \def\toctype{app}%
6323 \else
6324 \setbox0 = \hbox{#3\enspace}%
6325 \def\toctype{numchap}%
6326 \fi\fi\fi
6328 % Write the toc entry for this chapter. Must come before the
6329 % \donoderef, because we include the current node name in the toc
6330 % entry, and \donoderef resets it to empty.
6331 \writetocentry{\toctype}{#1}{#3}%
6333 % For pdftex, we have to write out the node definition (aka, make
6334 % the pdfdest) after any page break, but before the actual text has
6335 % been typeset. If the destination for the pdf outline is after the
6336 % text, then jumping from the outline may wind up with the text not
6337 % being visible, for instance under high magnification.
6338 \donoderef{#2}%
6340 % Typeset the actual heading.
6341 \nobreak % Avoid page breaks at the interline glue.
6342 \vbox{\raggedtitlesettings \hangindent=\wd0 \centerparametersmaybe
6343 \unhbox0 #1\par}%
6345 \nobreak\bigskip % no page break after a chapter title
6346 \nobreak
6349 % @centerchap -- centered and unnumbered.
6350 \let\centerparametersmaybe = \relax
6351 \def\centerparameters{%
6352 \advance\rightskip by 3\rightskip
6353 \leftskip = \rightskip
6354 \parfillskip = 0pt
6358 % Section titles. These macros combine the section number parts and
6359 % call the generic \sectionheading to do the printing.
6361 \newskip\secheadingskip
6362 \def\secheadingbreak{\dobreak \secheadingskip{-1000}}
6364 % Subsection titles.
6365 \newskip\subsecheadingskip
6366 \def\subsecheadingbreak{\dobreak \subsecheadingskip{-500}}
6368 % Subsubsection titles.
6369 \def\subsubsecheadingskip{\subsecheadingskip}
6370 \def\subsubsecheadingbreak{\subsecheadingbreak}
6373 % Print any size, any type, section title.
6375 % #1 is the text of the title,
6376 % #2 is the section level (sec/subsec/subsubsec),
6377 % #3 is the section type (Ynumbered, Ynothing, Yappendix, Yomitfromtoc),
6378 % #4 is the section number.
6380 \def\seckeyword{sec}
6382 \def\sectionheading#1#2#3#4{%
6384 \def\sectionlevel{#2}%
6385 \def\temptype{#3}%
6387 % It is ok for the @heading series commands to appear inside an
6388 % environment (it's been historically allowed, though the logic is
6389 % dubious), but not the others.
6390 \ifx\temptype\Yomitfromtockeyword\else
6391 \checkenv{}% non-@*heading should not be in an environment.
6393 \let\footnote=\errfootnoteheading
6395 % Switch to the right set of fonts.
6396 \csname #2fonts\endcsname \rmisbold
6398 % Insert first mark before the heading break (see notes for \domark).
6399 \let\prevsectiondefs=\lastsectiondefs
6400 \ifx\temptype\Ynothingkeyword
6401 \ifx\sectionlevel\seckeyword
6402 \gdef\lastsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}%
6403 \gdef\thissection{\thissectionname}}%
6405 \else\ifx\temptype\Yomitfromtockeyword
6406 % Don't redefine \thissection.
6407 \else\ifx\temptype\Yappendixkeyword
6408 \ifx\sectionlevel\seckeyword
6409 \toks0={#1}%
6410 \xdef\lastsectiondefs{%
6411 \gdef\noexpand\thissectionname{\the\toks0}%
6412 \gdef\noexpand\thissectionnum{#4}%
6413 % \noexpand\putwordSection avoids expanding indigestible
6414 % commands in some of the translations.
6415 \gdef\noexpand\thissection{\noexpand\putwordSection{}
6416 \noexpand\thissectionnum:
6417 \noexpand\thissectionname}%
6420 \else
6421 \ifx\sectionlevel\seckeyword
6422 \toks0={#1}%
6423 \xdef\lastsectiondefs{%
6424 \gdef\noexpand\thissectionname{\the\toks0}%
6425 \gdef\noexpand\thissectionnum{#4}%
6426 % \noexpand\putwordSection avoids expanding indigestible
6427 % commands in some of the translations.
6428 \gdef\noexpand\thissection{\noexpand\putwordSection{}
6429 \noexpand\thissectionnum:
6430 \noexpand\thissectionname}%
6433 \fi\fi\fi
6435 % Go into vertical mode. Usually we'll already be there, but we
6436 % don't want the following whatsit to end up in a preceding paragraph
6437 % if the document didn't happen to have a blank line.
6438 \par
6440 % Output the mark. Pass it through \safewhatsit, to take care of
6441 % the preceding space.
6442 \safewhatsit\domark
6444 % Insert space above the heading.
6445 \csname #2headingbreak\endcsname
6447 % Now the second mark, after the heading break. No break points
6448 % between here and the heading.
6449 \global\let\prevsectiondefs=\lastsectiondefs
6450 \domark
6452 % Only insert the space after the number if we have a section number.
6453 \ifx\temptype\Ynothingkeyword
6454 \setbox0 = \hbox{}%
6455 \def\toctype{unn}%
6456 \gdef\lastsection{#1}%
6457 \else\ifx\temptype\Yomitfromtockeyword
6458 % for @headings -- no section number, don't include in toc,
6459 % and don't redefine \lastsection.
6460 \setbox0 = \hbox{}%
6461 \def\toctype{omit}%
6462 \let\sectionlevel=\empty
6463 \else\ifx\temptype\Yappendixkeyword
6464 \setbox0 = \hbox{#4\enspace}%
6465 \def\toctype{app}%
6466 \gdef\lastsection{#1}%
6467 \else
6468 \setbox0 = \hbox{#4\enspace}%
6469 \def\toctype{num}%
6470 \gdef\lastsection{#1}%
6471 \fi\fi\fi
6473 % Write the toc entry (before \donoderef). See comments in \chapmacro.
6474 \writetocentry{\toctype\sectionlevel}{#1}{#4}%
6476 % Write the node reference (= pdf destination for pdftex).
6477 % Again, see comments in \chapmacro.
6478 \donoderef{#3}%
6480 % Interline glue will be inserted when the vbox is completed.
6481 % That glue will be a valid breakpoint for the page, since it'll be
6482 % preceded by a whatsit (usually from the \donoderef, or from the
6483 % \writetocentry if there was no node). We don't want to allow that
6484 % break, since then the whatsits could end up on page n while the
6485 % section is on page n+1, thus toc/etc. are wrong. Debian bug 276000.
6486 \nobreak
6488 % Output the actual section heading.
6489 \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright
6490 \hangindent=\wd0 % zero if no section number
6491 \unhbox0 #1}%
6493 % Add extra space after the heading -- half of whatever came above it.
6494 % Don't allow stretch, though.
6495 \kern .5 \csname #2headingskip\endcsname
6497 % Do not let the kern be a potential breakpoint, as it would be if it
6498 % was followed by glue.
6499 \nobreak
6501 % We'll almost certainly start a paragraph next, so don't let that
6502 % glue accumulate. (Not a breakpoint because it's preceded by a
6503 % discardable item.) However, when a paragraph is not started next
6504 % (\startdefun, \cartouche, \center, etc.), this needs to be wiped out
6505 % or the negative glue will cause weirdly wrong output, typically
6506 % obscuring the section heading with something else.
6507 \vskip-\parskip
6509 % This is so the last item on the main vertical list is a known
6510 % \penalty > 10000, so \startdefun, etc., can recognize the situation
6511 % and do the needful.
6512 \penalty 10001
6516 \message{toc,}
6517 % Table of contents.
6518 \newwrite\tocfile
6520 % Write an entry to the toc file, opening it if necessary.
6521 % Called from @chapter, etc.
6523 % Example usage: \writetocentry{sec}{Section Name}{\the\chapno.\the\secno}
6524 % We append the current node name (if any) and page number as additional
6525 % arguments for the \{chap,sec,...}entry macros which will eventually
6526 % read this. The node name is used in the pdf outlines as the
6527 % destination to jump to.
6529 % We open the .toc file for writing here instead of at @setfilename (or
6530 % any other fixed time) so that @contents can be anywhere in the document.
6531 % But if #1 is `omit', then we don't do anything. This is used for the
6532 % table of contents chapter openings themselves.
6534 \newif\iftocfileopened
6535 \def\omitkeyword{omit}%
6537 \def\writetocentry#1#2#3{%
6538 \edef\writetoctype{#1}%
6539 \ifx\writetoctype\omitkeyword \else
6540 \iftocfileopened\else
6541 \immediate\openout\tocfile = \jobname.toc
6542 \global\tocfileopenedtrue
6545 \iflinks
6546 {\atdummies
6547 \edef\temp{%
6548 \write\tocfile{@#1entry{#2}{#3}{\lastnode}{\noexpand\folio}}}%
6549 \temp
6554 % Tell \shipout to create a pdf destination on each page, if we're
6555 % writing pdf. These are used in the table of contents. We can't
6556 % just write one on every page because the title pages are numbered
6557 % 1 and 2 (the page numbers aren't printed), and so are the first
6558 % two pages of the document. Thus, we'd have two destinations named
6559 % `1', and two named `2'.
6560 \ifpdf \global\pdfmakepagedesttrue \fi
6564 % These characters do not print properly in the Computer Modern roman
6565 % fonts, so we must take special care. This is more or less redundant
6566 % with the Texinfo input format setup at the end of this file.
6568 \def\activecatcodes{%
6569 \catcode`\"=\active
6570 \catcode`\$=\active
6571 \catcode`\<=\active
6572 \catcode`\>=\active
6573 \catcode`\\=\active
6574 \catcode`\^=\active
6575 \catcode`\_=\active
6576 \catcode`\|=\active
6577 \catcode`\~=\active
6581 % Read the toc file, which is essentially Texinfo input.
6582 \def\readtocfile{%
6583 \setupdatafile
6584 \activecatcodes
6585 \input \tocreadfilename
6588 \newskip\contentsrightmargin \contentsrightmargin=1in
6589 \newcount\savepageno
6590 \newcount\lastnegativepageno \lastnegativepageno = -1
6592 % Prepare to read what we've written to \tocfile.
6594 \def\startcontents#1{%
6595 % If @setchapternewpage on, and @headings double, the contents should
6596 % start on an odd page, unlike chapters. Thus, we maintain
6597 % \contentsalignmacro in parallel with \pagealignmacro.
6598 % From: Torbjorn Granlund <tege@matematik.su.se>
6599 \contentsalignmacro
6600 \immediate\closeout\tocfile
6602 % Don't need to put `Contents' or `Short Contents' in the headline.
6603 % It is abundantly clear what they are.
6604 \chapmacro{#1}{Yomitfromtoc}{}%
6606 \savepageno = \pageno
6607 \begingroup % Set up to handle contents files properly.
6608 \raggedbottom % Worry more about breakpoints than the bottom.
6609 \entryrightmargin=\contentsrightmargin % Don't use the full line length.
6611 % Roman numerals for page numbers.
6612 \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi
6615 % redefined for the two-volume lispref. We always output on
6616 % \jobname.toc even if this is redefined.
6618 \def\tocreadfilename{\jobname.toc}
6620 % Normal (long) toc.
6622 \def\contents{%
6623 \startcontents{\putwordTOC}%
6624 \openin 1 \tocreadfilename\space
6625 \ifeof 1 \else
6626 \readtocfile
6628 \vfill \eject
6629 \contentsalignmacro % in case @setchapternewpage odd is in effect
6630 \ifeof 1 \else
6631 \pdfmakeoutlines
6633 \closein 1
6634 \endgroup
6635 \lastnegativepageno = \pageno
6636 \global\pageno = \savepageno
6639 % And just the chapters.
6640 \def\summarycontents{%
6641 \startcontents{\putwordShortTOC}%
6643 \let\partentry = \shortpartentry
6644 \let\numchapentry = \shortchapentry
6645 \let\appentry = \shortchapentry
6646 \let\unnchapentry = \shortunnchapentry
6647 % We want a true roman here for the page numbers.
6648 \secfonts
6649 \let\rm=\shortcontrm \let\bf=\shortcontbf
6650 \let\sl=\shortcontsl \let\tt=\shortconttt
6652 \hyphenpenalty = 10000
6653 \advance\baselineskip by 1pt % Open it up a little.
6654 \def\numsecentry##1##2##3##4{}
6655 \let\appsecentry = \numsecentry
6656 \let\unnsecentry = \numsecentry
6657 \let\numsubsecentry = \numsecentry
6658 \let\appsubsecentry = \numsecentry
6659 \let\unnsubsecentry = \numsecentry
6660 \let\numsubsubsecentry = \numsecentry
6661 \let\appsubsubsecentry = \numsecentry
6662 \let\unnsubsubsecentry = \numsecentry
6663 \openin 1 \tocreadfilename\space
6664 \ifeof 1 \else
6665 \readtocfile
6667 \closein 1
6668 \vfill \eject
6669 \contentsalignmacro % in case @setchapternewpage odd is in effect
6670 \endgroup
6671 \lastnegativepageno = \pageno
6672 \global\pageno = \savepageno
6674 \let\shortcontents = \summarycontents
6676 % Typeset the label for a chapter or appendix for the short contents.
6677 % The arg is, e.g., `A' for an appendix, or `3' for a chapter.
6679 \def\shortchaplabel#1{%
6680 % This space should be enough, since a single number is .5em, and the
6681 % widest letter (M) is 1em, at least in the Computer Modern fonts.
6682 % But use \hss just in case.
6683 % (This space doesn't include the extra space that gets added after
6684 % the label; that gets put in by \shortchapentry above.)
6686 % We'd like to right-justify chapter numbers, but that looks strange
6687 % with appendix letters. And right-justifying numbers and
6688 % left-justifying letters looks strange when there is less than 10
6689 % chapters. Have to read the whole toc once to know how many chapters
6690 % there are before deciding ...
6691 \hbox to 1em{#1\hss}%
6694 % These macros generate individual entries in the table of contents.
6695 % The first argument is the chapter or section name.
6696 % The last argument is the page number.
6697 % The arguments in between are the chapter number, section number, ...
6699 % Parts, in the main contents. Replace the part number, which doesn't
6700 % exist, with an empty box. Let's hope all the numbers have the same width.
6701 % Also ignore the page number, which is conventionally not printed.
6702 \def\numeralbox{\setbox0=\hbox{8}\hbox to \wd0{\hfil}}
6703 \def\partentry#1#2#3#4{\dochapentry{\numeralbox\labelspace#1}{}}
6705 % Parts, in the short toc.
6706 \def\shortpartentry#1#2#3#4{%
6707 \penalty-300
6708 \vskip.5\baselineskip plus.15\baselineskip minus.1\baselineskip
6709 \shortchapentry{{\bf #1}}{\numeralbox}{}{}%
6712 % Chapters, in the main contents.
6713 \def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}}
6715 % Chapters, in the short toc.
6716 % See comments in \dochapentry re vbox and related settings.
6717 \def\shortchapentry#1#2#3#4{%
6718 \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#4\egroup}%
6721 % Appendices, in the main contents.
6722 % Need the word Appendix, and a fixed-size box.
6724 \def\appendixbox#1{%
6725 % We use M since it's probably the widest letter.
6726 \setbox0 = \hbox{\putwordAppendix{} M}%
6727 \hbox to \wd0{\putwordAppendix{} #1\hss}}
6729 \def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\hskip.7em#1}{#4}}
6731 % Unnumbered chapters.
6732 \def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}}
6733 \def\shortunnchapentry#1#2#3#4{\tocentry{#1}{\doshortpageno\bgroup#4\egroup}}
6735 % Sections.
6736 \def\numsecentry#1#2#3#4{\dosecentry{#2\labelspace#1}{#4}}
6737 \let\appsecentry=\numsecentry
6738 \def\unnsecentry#1#2#3#4{\dosecentry{#1}{#4}}
6740 % Subsections.
6741 \def\numsubsecentry#1#2#3#4{\dosubsecentry{#2\labelspace#1}{#4}}
6742 \let\appsubsecentry=\numsubsecentry
6743 \def\unnsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}}
6745 % And subsubsections.
6746 \def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#2\labelspace#1}{#4}}
6747 \let\appsubsubsecentry=\numsubsubsecentry
6748 \def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#4}}
6750 % This parameter controls the indentation of the various levels.
6751 % Same as \defaultparindent.
6752 \newdimen\tocindent \tocindent = 15pt
6754 % Now for the actual typesetting. In all these, #1 is the text and #2 is the
6755 % page number.
6757 % If the toc has to be broken over pages, we want it to be at chapters
6758 % if at all possible; hence the \penalty.
6759 \def\dochapentry#1#2{%
6760 \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip
6761 \begingroup
6762 % Move the page numbers slightly to the right
6763 \advance\entryrightmargin by -0.05em
6764 \chapentryfonts
6765 \tocentry{#1}{\dopageno\bgroup#2\egroup}%
6766 \endgroup
6767 \nobreak\vskip .25\baselineskip plus.1\baselineskip
6770 \def\dosecentry#1#2{\begingroup
6771 \secentryfonts \leftskip=\tocindent
6772 \tocentry{#1}{\dopageno\bgroup#2\egroup}%
6773 \endgroup}
6775 \def\dosubsecentry#1#2{\begingroup
6776 \subsecentryfonts \leftskip=2\tocindent
6777 \tocentry{#1}{\dopageno\bgroup#2\egroup}%
6778 \endgroup}
6780 \def\dosubsubsecentry#1#2{\begingroup
6781 \subsubsecentryfonts \leftskip=3\tocindent
6782 \tocentry{#1}{\dopageno\bgroup#2\egroup}%
6783 \endgroup}
6785 % We use the same \entry macro as for the index entries.
6786 \let\tocentry = \entry
6788 % Space between chapter (or whatever) number and the title.
6789 \def\labelspace{\hskip1em \relax}
6791 \def\dopageno#1{{\rm #1}}
6792 \def\doshortpageno#1{{\rm #1}}
6794 \def\chapentryfonts{\secfonts \rm}
6795 \def\secentryfonts{\textfonts}
6796 \def\subsecentryfonts{\textfonts}
6797 \def\subsubsecentryfonts{\textfonts}
6800 \message{environments,}
6801 % @foo ... @end foo.
6803 % @tex ... @end tex escapes into raw TeX temporarily.
6804 % One exception: @ is still an escape character, so that @end tex works.
6805 % But \@ or @@ will get a plain @ character.
6807 \envdef\tex{%
6808 \setupmarkupstyle{tex}%
6809 \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
6810 \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
6811 \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie
6812 \catcode `\%=14
6813 \catcode `\+=\other
6814 \catcode `\"=\other
6815 \catcode `\|=\other
6816 \catcode `\<=\other
6817 \catcode `\>=\other
6818 \catcode `\`=\other
6819 \catcode `\'=\other
6820 \escapechar=`\\
6822 % ' is active in math mode (mathcode"8000). So reset it, and all our
6823 % other math active characters (just in case), to plain's definitions.
6824 \mathactive
6826 % Inverse of the list at the beginning of the file.
6827 \let\b=\ptexb
6828 \let\bullet=\ptexbullet
6829 \let\c=\ptexc
6830 \let\,=\ptexcomma
6831 \let\.=\ptexdot
6832 \let\dots=\ptexdots
6833 \let\equiv=\ptexequiv
6834 \let\!=\ptexexclam
6835 \let\i=\ptexi
6836 \let\indent=\ptexindent
6837 \let\noindent=\ptexnoindent
6838 \let\{=\ptexlbrace
6839 \let\+=\tabalign
6840 \let\}=\ptexrbrace
6841 \let\/=\ptexslash
6842 \let\sp=\ptexsp
6843 \let\*=\ptexstar
6844 %\let\sup=\ptexsup % do not redefine, we want @sup to work in math mode
6845 \let\t=\ptext
6846 \expandafter \let\csname top\endcsname=\ptextop % we've made it outer
6847 \let\frenchspacing=\plainfrenchspacing
6849 \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
6850 \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}%
6851 \def\@{@}%
6853 % There is no need to define \Etex.
6855 % Define @lisp ... @end lisp.
6856 % @lisp environment forms a group so it can rebind things,
6857 % including the definition of @end lisp (which normally is erroneous).
6859 % Amount to narrow the margins by for @lisp.
6860 \newskip\lispnarrowing \lispnarrowing=0.4in
6862 % This is the definition that ^^M gets inside @lisp, @example, and other
6863 % such environments. \null is better than a space, since it doesn't
6864 % have any width.
6865 \def\lisppar{\null\endgraf}
6867 % This space is always present above and below environments.
6868 \newskip\envskipamount \envskipamount = 0pt
6870 % Make spacing and below environment symmetrical. We use \parskip here
6871 % to help in doing that, since in @example-like environments \parskip
6872 % is reset to zero; thus the \afterenvbreak inserts no space -- but the
6873 % start of the next paragraph will insert \parskip.
6875 \def\aboveenvbreak{{%
6876 % =10000 instead of <10000 because of a special case in \itemzzz and
6877 % \sectionheading, q.v.
6878 \ifnum \lastpenalty=10000 \else
6879 \advance\envskipamount by \parskip
6880 \endgraf
6881 \ifdim\lastskip<\envskipamount
6882 \removelastskip
6883 \ifnum\lastpenalty<10000
6884 % Penalize breaking before the environment, because preceding text
6885 % often leads into it.
6886 \penalty100
6888 \vskip\envskipamount
6893 \def\afterenvbreak{{%
6894 % =10000 instead of <10000 because of a special case in \itemzzz and
6895 % \sectionheading, q.v.
6896 \ifnum \lastpenalty=10000 \else
6897 \advance\envskipamount by \parskip
6898 \endgraf
6899 \ifdim\lastskip<\envskipamount
6900 \removelastskip
6901 % it's not a good place to break if the last penalty was \nobreak
6902 % or better ...
6903 \ifnum\lastpenalty<10000 \penalty-50 \fi
6904 \vskip\envskipamount
6909 % \nonarrowing is a flag. If "set", @lisp etc don't narrow margins; it will
6910 % also clear it, so that its embedded environments do the narrowing again.
6911 \let\nonarrowing=\relax
6913 % @cartouche ... @end cartouche: draw rectangle w/rounded corners around
6914 % environment contents.
6915 \font\circle=lcircle10
6916 \newdimen\circthick
6917 \newdimen\cartouter\newdimen\cartinner
6918 \newskip\normbskip\newskip\normpskip\newskip\normlskip
6919 \circthick=\fontdimen8\circle
6921 \def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth
6922 \def\ctr{{\hskip 6pt\circle\char'010}}
6923 \def\cbl{{\circle\char'012\hskip -6pt}}
6924 \def\cbr{{\hskip 6pt\circle\char'011}}
6925 \def\carttop{\hbox to \cartouter{\hskip\lskip
6926 \ctl\leaders\hrule height\circthick\hfil\ctr
6927 \hskip\rskip}}
6928 \def\cartbot{\hbox to \cartouter{\hskip\lskip
6929 \cbl\leaders\hrule height\circthick\hfil\cbr
6930 \hskip\rskip}}
6932 \newskip\lskip\newskip\rskip
6934 \envdef\cartouche{%
6935 \ifhmode\par\fi % can't be in the midst of a paragraph.
6936 \startsavinginserts
6937 \lskip=\leftskip \rskip=\rightskip
6938 \leftskip=0pt\rightskip=0pt % we want these *outside*.
6939 \cartinner=\hsize \advance\cartinner by-\lskip
6940 \advance\cartinner by-\rskip
6941 \cartouter=\hsize
6942 \advance\cartouter by 18.4pt % allow for 3pt kerns on either
6943 % side, and for 6pt waste from
6944 % each corner char, and rule thickness
6945 \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
6947 % If this cartouche directly follows a sectioning command, we need the
6948 % \parskip glue (backspaced over by default) or the cartouche can
6949 % collide with the section heading.
6950 \ifnum\lastpenalty>10000 \vskip\parskip \penalty\lastpenalty \fi
6952 \setbox\groupbox=\vbox\bgroup
6953 \baselineskip=0pt\parskip=0pt\lineskip=0pt
6954 \carttop
6955 \hbox\bgroup
6956 \hskip\lskip
6957 \vrule\kern3pt
6958 \vbox\bgroup
6959 \kern3pt
6960 \hsize=\cartinner
6961 \baselineskip=\normbskip
6962 \lineskip=\normlskip
6963 \parskip=\normpskip
6964 \vskip -\parskip
6965 \comment % For explanation, see the end of def\group.
6967 \def\Ecartouche{%
6968 \ifhmode\par\fi
6969 \kern3pt
6970 \egroup
6971 \kern3pt\vrule
6972 \hskip\rskip
6973 \egroup
6974 \cartbot
6975 \egroup
6976 \addgroupbox
6977 \checkinserts
6981 % This macro is called at the beginning of all the @example variants,
6982 % inside a group.
6983 \newdimen\nonfillparindent
6984 \def\nonfillstart{%
6985 \aboveenvbreak
6986 \ifdim\hfuzz < 12pt \hfuzz = 12pt \fi % Don't be fussy
6987 \sepspaces % Make spaces be word-separators rather than space tokens.
6988 \let\par = \lisppar % don't ignore blank lines
6989 \obeylines % each line of input is a line of output
6990 \parskip = 0pt
6991 % Turn off paragraph indentation but redefine \indent to emulate
6992 % the normal \indent.
6993 \nonfillparindent=\parindent
6994 \parindent = 0pt
6995 \let\indent\nonfillindent
6997 \emergencystretch = 0pt % don't try to avoid overfull boxes
6998 \ifx\nonarrowing\relax
6999 \advance \leftskip by \lispnarrowing
7000 \exdentamount=\lispnarrowing
7001 \else
7002 \let\nonarrowing = \relax
7004 \let\exdent=\nofillexdent
7007 \begingroup
7008 \obeyspaces
7009 % We want to swallow spaces (but not other tokens) after the fake
7010 % @indent in our nonfill-environments, where spaces are normally
7011 % active and set to @tie, resulting in them not being ignored after
7012 % @indent.
7013 \gdef\nonfillindent{\futurelet\temp\nonfillindentcheck}%
7014 \gdef\nonfillindentcheck{%
7015 \ifx\temp %
7016 \expandafter\nonfillindentgobble%
7017 \else%
7018 \leavevmode\nonfillindentbox%
7019 \fi%
7021 \endgroup
7022 \def\nonfillindentgobble#1{\nonfillindent}
7023 \def\nonfillindentbox{\hbox to \nonfillparindent{\hss}}
7025 % If you want all examples etc. small: @set dispenvsize small.
7026 % If you want even small examples the full size: @set dispenvsize nosmall.
7027 % This affects the following displayed environments:
7028 % @example, @display, @format, @lisp
7030 \def\smallword{small}
7031 \def\nosmallword{nosmall}
7032 \let\SETdispenvsize\relax
7033 \def\setnormaldispenv{%
7034 \ifx\SETdispenvsize\smallword
7035 % end paragraph for sake of leading, in case document has no blank
7036 % line. This is redundant with what happens in \aboveenvbreak, but
7037 % we need to do it before changing the fonts, and it's inconvenient
7038 % to change the fonts afterward.
7039 \ifnum \lastpenalty=10000 \else \endgraf \fi
7040 \smallexamplefonts \rm
7043 \def\setsmalldispenv{%
7044 \ifx\SETdispenvsize\nosmallword
7045 \else
7046 \ifnum \lastpenalty=10000 \else \endgraf \fi
7047 \smallexamplefonts \rm
7051 % We often define two environments, @foo and @smallfoo.
7052 % Let's do it in one command. #1 is the env name, #2 the definition.
7053 \def\makedispenvdef#1#2{%
7054 \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2}%
7055 \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2}%
7056 \expandafter\let\csname E#1\endcsname \afterenvbreak
7057 \expandafter\let\csname Esmall#1\endcsname \afterenvbreak
7060 % Define two environment synonyms (#1 and #2) for an environment.
7061 \def\maketwodispenvdef#1#2#3{%
7062 \makedispenvdef{#1}{#3}%
7063 \makedispenvdef{#2}{#3}%
7066 % @lisp: indented, narrowed, typewriter font;
7067 % @example: same as @lisp.
7069 % @smallexample and @smalllisp: use smaller fonts.
7070 % Originally contributed by Pavel@xerox.
7072 \maketwodispenvdef{lisp}{example}{%
7073 \nonfillstart
7074 \tt\setupmarkupstyle{example}%
7075 \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
7076 \gobble % eat return
7078 % @display/@smalldisplay: same as @lisp except keep current font.
7080 \makedispenvdef{display}{%
7081 \nonfillstart
7082 \gobble
7085 % @format/@smallformat: same as @display except don't narrow margins.
7087 \makedispenvdef{format}{%
7088 \let\nonarrowing = t%
7089 \nonfillstart
7090 \gobble
7093 % @flushleft: same as @format, but doesn't obey \SETdispenvsize.
7094 \envdef\flushleft{%
7095 \let\nonarrowing = t%
7096 \nonfillstart
7097 \gobble
7099 \let\Eflushleft = \afterenvbreak
7101 % @flushright.
7103 \envdef\flushright{%
7104 \let\nonarrowing = t%
7105 \nonfillstart
7106 \advance\leftskip by 0pt plus 1fill\relax
7107 \gobble
7109 \let\Eflushright = \afterenvbreak
7112 % @raggedright does more-or-less normal line breaking but no right
7113 % justification. From plain.tex. Don't stretch around special
7114 % characters in urls in this environment, since the stretch at the right
7115 % should be enough.
7116 \envdef\raggedright{%
7117 \rightskip0pt plus2.4em \spaceskip.3333em \xspaceskip.5em\relax
7118 \def\urefprestretchamount{0pt}%
7119 \def\urefpoststretchamount{0pt}%
7121 \let\Eraggedright\par
7123 \envdef\raggedleft{%
7124 \parindent=0pt \leftskip0pt plus2em
7125 \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt
7126 \hbadness=10000 % Last line will usually be underfull, so turn off
7127 % badness reporting.
7129 \let\Eraggedleft\par
7131 \envdef\raggedcenter{%
7132 \parindent=0pt \rightskip0pt plus1em \leftskip0pt plus1em
7133 \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt
7134 \hbadness=10000 % Last line will usually be underfull, so turn off
7135 % badness reporting.
7137 \let\Eraggedcenter\par
7140 % @quotation does normal linebreaking (hence we can't use \nonfillstart)
7141 % and narrows the margins. We keep \parskip nonzero in general, since
7142 % we're doing normal filling. So, when using \aboveenvbreak and
7143 % \afterenvbreak, temporarily make \parskip 0.
7145 \makedispenvdef{quotation}{\quotationstart}
7147 \def\quotationstart{%
7148 \indentedblockstart % same as \indentedblock, but increase right margin too.
7149 \ifx\nonarrowing\relax
7150 \advance\rightskip by \lispnarrowing
7152 \parsearg\quotationlabel
7155 % We have retained a nonzero parskip for the environment, since we're
7156 % doing normal filling.
7158 \def\Equotation{%
7159 \par
7160 \ifx\quotationauthor\thisisundefined\else
7161 % indent a bit.
7162 \leftline{\kern 2\leftskip \sl ---\quotationauthor}%
7164 {\parskip=0pt \afterenvbreak}%
7166 \def\Esmallquotation{\Equotation}
7168 % If we're given an argument, typeset it in bold with a colon after.
7169 \def\quotationlabel#1{%
7170 \def\temp{#1}%
7171 \ifx\temp\empty \else
7172 {\bf #1: }%
7176 % @indentedblock is like @quotation, but indents only on the left and
7177 % has no optional argument.
7179 \makedispenvdef{indentedblock}{\indentedblockstart}
7181 \def\indentedblockstart{%
7182 {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
7183 \parindent=0pt
7185 % @cartouche defines \nonarrowing to inhibit narrowing at next level down.
7186 \ifx\nonarrowing\relax
7187 \advance\leftskip by \lispnarrowing
7188 \exdentamount = \lispnarrowing
7189 \else
7190 \let\nonarrowing = \relax
7194 % Keep a nonzero parskip for the environment, since we're doing normal filling.
7196 \def\Eindentedblock{%
7197 \par
7198 {\parskip=0pt \afterenvbreak}%
7200 \def\Esmallindentedblock{\Eindentedblock}
7203 % LaTeX-like @verbatim...@end verbatim and @verb{<char>...<char>}
7204 % If we want to allow any <char> as delimiter,
7205 % we need the curly braces so that makeinfo sees the @verb command, eg:
7206 % `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org
7208 % [Knuth]: Donald Ervin Knuth, 1996. The TeXbook.
7210 % [Knuth] p.344; only we need to do the other characters Texinfo sets
7211 % active too. Otherwise, they get lost as the first character on a
7212 % verbatim line.
7213 \def\dospecials{%
7214 \do\ \do\\\do\{\do\}\do\$\do\&%
7215 \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~%
7216 \do\<\do\>\do\|\do\@\do+\do\"%
7217 % Don't do the quotes -- if we do, @set txicodequoteundirected and
7218 % @set txicodequotebacktick will not have effect on @verb and
7219 % @verbatim, and ?` and !` ligatures won't get disabled.
7220 %\do\`\do\'%
7223 % [Knuth] p. 380
7224 \def\uncatcodespecials{%
7225 \def\do##1{\catcode`##1=\other}\dospecials}
7227 % Setup for the @verb command.
7229 % Eight spaces for a tab
7230 \begingroup
7231 \catcode`\^^I=\active
7232 \gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }}
7233 \endgroup
7235 \def\setupverb{%
7236 \tt % easiest (and conventionally used) font for verbatim
7237 \def\par{\leavevmode\endgraf}%
7238 \setupmarkupstyle{verb}%
7239 \tabeightspaces
7240 % Respect line breaks,
7241 % print special symbols as themselves, and
7242 % make each space count
7243 % must do in this order:
7244 \obeylines \uncatcodespecials \sepspaces
7247 % Setup for the @verbatim environment
7249 % Real tab expansion.
7250 \newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount
7252 % We typeset each line of the verbatim in an \hbox, so we can handle
7253 % tabs. The \global is in case the verbatim line starts with an accent,
7254 % or some other command that starts with a begin-group. Otherwise, the
7255 % entire \verbbox would disappear at the corresponding end-group, before
7256 % it is typeset. Meanwhile, we can't have nested verbatim commands
7257 % (can we?), so the \global won't be overwriting itself.
7258 \newbox\verbbox
7259 \def\starttabbox{\global\setbox\verbbox=\hbox\bgroup}
7261 \begingroup
7262 \catcode`\^^I=\active
7263 \gdef\tabexpand{%
7264 \catcode`\^^I=\active
7265 \def^^I{\leavevmode\egroup
7266 \dimen\verbbox=\wd\verbbox % the width so far, or since the previous tab
7267 \divide\dimen\verbbox by\tabw
7268 \multiply\dimen\verbbox by\tabw % compute previous multiple of \tabw
7269 \advance\dimen\verbbox by\tabw % advance to next multiple of \tabw
7270 \wd\verbbox=\dimen\verbbox \box\verbbox \starttabbox
7273 \endgroup
7275 % start the verbatim environment.
7276 \def\setupverbatim{%
7277 \let\nonarrowing = t%
7278 \nonfillstart
7279 \tt % easiest (and conventionally used) font for verbatim
7280 % The \leavevmode here is for blank lines. Otherwise, we would
7281 % never \starttabox and the \egroup would end verbatim mode.
7282 \def\par{\leavevmode\egroup\box\verbbox\endgraf}%
7283 \tabexpand
7284 \setupmarkupstyle{verbatim}%
7285 % Respect line breaks,
7286 % print special symbols as themselves, and
7287 % make each space count.
7288 % Must do in this order:
7289 \obeylines \uncatcodespecials \sepspaces
7290 \everypar{\starttabbox}%
7293 % Do the @verb magic: verbatim text is quoted by unique
7294 % delimiter characters. Before first delimiter expect a
7295 % right brace, after last delimiter expect closing brace:
7297 % \def\doverb'{'<char>#1<char>'}'{#1}
7299 % [Knuth] p. 382; only eat outer {}
7300 \begingroup
7301 \catcode`[=1\catcode`]=2\catcode`\{=\other\catcode`\}=\other
7302 \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next]
7303 \endgroup
7305 \def\verb{\begingroup\setupverb\doverb}
7308 % Do the @verbatim magic: define the macro \doverbatim so that
7309 % the (first) argument ends when '@end verbatim' is reached, ie:
7311 % \def\doverbatim#1@end verbatim{#1}
7313 % For Texinfo it's a lot easier than for LaTeX,
7314 % because texinfo's \verbatim doesn't stop at '\end{verbatim}':
7315 % we need not redefine '\', '{' and '}'.
7317 % Inspired by LaTeX's verbatim command set [latex.ltx]
7319 \begingroup
7320 \catcode`\ =\active
7321 \obeylines %
7322 % ignore everything up to the first ^^M, that's the newline at the end
7323 % of the @verbatim input line itself. Otherwise we get an extra blank
7324 % line in the output.
7325 \xdef\doverbatim#1^^M#2@end verbatim{#2\noexpand\end\gobble verbatim}%
7326 % We really want {...\end verbatim} in the body of the macro, but
7327 % without the active space; thus we have to use \xdef and \gobble.
7328 \endgroup
7330 \envdef\verbatim{%
7331 \setupverbatim\doverbatim
7333 \let\Everbatim = \afterenvbreak
7336 % @verbatiminclude FILE - insert text of file in verbatim environment.
7338 \def\verbatiminclude{\parseargusing\filenamecatcodes\doverbatiminclude}
7340 \def\doverbatiminclude#1{%
7342 \makevalueexpandable
7343 \setupverbatim
7344 \indexnofonts % Allow `@@' and other weird things in file names.
7345 \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}%
7346 \input #1
7347 \afterenvbreak
7351 % @copying ... @end copying.
7352 % Save the text away for @insertcopying later.
7354 % We save the uninterpreted tokens, rather than creating a box.
7355 % Saving the text in a box would be much easier, but then all the
7356 % typesetting commands (@smallbook, font changes, etc.) have to be done
7357 % beforehand -- and a) we want @copying to be done first in the source
7358 % file; b) letting users define the frontmatter in as flexible order as
7359 % possible is desirable.
7361 \def\copying{\checkenv{}\begingroup\scanargctxt\docopying}
7362 \def\docopying#1@end copying{\endgroup\def\copyingtext{#1}}
7364 \def\insertcopying{%
7365 \begingroup
7366 \parindent = 0pt % paragraph indentation looks wrong on title page
7367 \scanexp\copyingtext
7368 \endgroup
7372 \message{defuns,}
7373 % @defun etc.
7375 \newskip\defbodyindent \defbodyindent=.4in
7376 \newskip\defargsindent \defargsindent=50pt
7377 \newskip\deflastargmargin \deflastargmargin=18pt
7378 \newcount\defunpenalty
7380 % Start the processing of @deffn:
7381 \def\startdefun{%
7382 \ifnum\lastpenalty<10000
7383 \medbreak
7384 \defunpenalty=10003 % Will keep this @deffn together with the
7385 % following @def command, see below.
7386 \else
7387 % If there are two @def commands in a row, we'll have a \nobreak,
7388 % which is there to keep the function description together with its
7389 % header. But if there's nothing but headers, we need to allow a
7390 % break somewhere. Check specifically for penalty 10002, inserted
7391 % by \printdefunline, instead of 10000, since the sectioning
7392 % commands also insert a nobreak penalty, and we don't want to allow
7393 % a break between a section heading and a defun.
7395 % As a further refinement, we avoid "club" headers by signalling
7396 % with penalty of 10003 after the very first @deffn in the
7397 % sequence (see above), and penalty of 10002 after any following
7398 % @def command.
7399 \ifnum\lastpenalty=10002 \penalty2000 \else \defunpenalty=10002 \fi
7401 % Similarly, after a section heading, do not allow a break.
7402 % But do insert the glue.
7403 \medskip % preceded by discardable penalty, so not a breakpoint
7406 \parindent=0in
7407 \advance\leftskip by \defbodyindent
7408 \exdentamount=\defbodyindent
7411 \def\dodefunx#1{%
7412 % First, check whether we are in the right environment:
7413 \checkenv#1%
7415 % As above, allow line break if we have multiple x headers in a row.
7416 % It's not a great place, though.
7417 \ifnum\lastpenalty=10002 \penalty3000 \else \defunpenalty=10002 \fi
7419 % And now, it's time to reuse the body of the original defun:
7420 \expandafter\gobbledefun#1%
7422 \def\gobbledefun#1\startdefun{}
7424 % \printdefunline \deffnheader{text}
7426 \def\printdefunline#1#2{%
7427 \begingroup
7428 % call \deffnheader:
7429 #1#2 \endheader
7430 % common ending:
7431 \interlinepenalty = 10000
7432 \advance\rightskip by 0pt plus 1fil\relax
7433 \endgraf
7434 \nobreak\vskip -\parskip
7435 \penalty\defunpenalty % signal to \startdefun and \dodefunx
7436 % Some of the @defun-type tags do not enable magic parentheses,
7437 % rendering the following check redundant. But we don't optimize.
7438 \checkparencounts
7439 \endgroup
7442 \def\Edefun{\endgraf\medbreak}
7444 % \makedefun{deffn} creates \deffn, \deffnx and \Edeffn;
7445 % the only thing remaining is to define \deffnheader.
7447 \def\makedefun#1{%
7448 \expandafter\let\csname E#1\endcsname = \Edefun
7449 \edef\temp{\noexpand\domakedefun
7450 \makecsname{#1}\makecsname{#1x}\makecsname{#1header}}%
7451 \temp
7454 % \domakedefun \deffn \deffnx \deffnheader { (defn. of \deffnheader) }
7456 % Define \deffn and \deffnx, without parameters.
7457 % \deffnheader has to be defined explicitly.
7459 \def\domakedefun#1#2#3{%
7460 \envdef#1{%
7461 \startdefun
7462 \doingtypefnfalse % distinguish typed functions from all else
7463 \parseargusing\activeparens{\printdefunline#3}%
7465 \def#2{\dodefunx#1}%
7466 \def#3%
7469 \newif\ifdoingtypefn % doing typed function?
7470 \newif\ifrettypeownline % typeset return type on its own line?
7472 % @deftypefnnewline on|off says whether the return type of typed functions
7473 % are printed on their own line. This affects @deftypefn, @deftypefun,
7474 % @deftypeop, and @deftypemethod.
7476 \parseargdef\deftypefnnewline{%
7477 \def\temp{#1}%
7478 \ifx\temp\onword
7479 \expandafter\let\csname SETtxideftypefnnl\endcsname
7480 = \empty
7481 \else\ifx\temp\offword
7482 \expandafter\let\csname SETtxideftypefnnl\endcsname
7483 = \relax
7484 \else
7485 \errhelp = \EMsimple
7486 \errmessage{Unknown @txideftypefnnl value `\temp',
7487 must be on|off}%
7488 \fi\fi
7491 % Untyped functions:
7493 % @deffn category name args
7494 \makedefun{deffn}{\deffngeneral{}}
7496 % @deffn category class name args
7497 \makedefun{defop}#1 {\defopon{#1\ \putwordon}}
7499 % \defopon {category on}class name args
7500 \def\defopon#1#2 {\deffngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} }
7502 % \deffngeneral {subind}category name args
7504 \def\deffngeneral#1#2 #3 #4\endheader{%
7505 % Remember that \dosubind{fn}{foo}{} is equivalent to \doind{fn}{foo}.
7506 \dosubind{fn}{\code{#3}}{#1}%
7507 \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}%
7510 % Typed functions:
7512 % @deftypefn category type name args
7513 \makedefun{deftypefn}{\deftypefngeneral{}}
7515 % @deftypeop category class type name args
7516 \makedefun{deftypeop}#1 {\deftypeopon{#1\ \putwordon}}
7518 % \deftypeopon {category on}class type name args
7519 \def\deftypeopon#1#2 {\deftypefngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} }
7521 % \deftypefngeneral {subind}category type name args
7523 \def\deftypefngeneral#1#2 #3 #4 #5\endheader{%
7524 \dosubind{fn}{\code{#4}}{#1}%
7525 \doingtypefntrue
7526 \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
7529 % Typed variables:
7531 % @deftypevr category type var args
7532 \makedefun{deftypevr}{\deftypecvgeneral{}}
7534 % @deftypecv category class type var args
7535 \makedefun{deftypecv}#1 {\deftypecvof{#1\ \putwordof}}
7537 % \deftypecvof {category of}class type var args
7538 \def\deftypecvof#1#2 {\deftypecvgeneral{\putwordof\ \code{#2}}{#1\ \code{#2}} }
7540 % \deftypecvgeneral {subind}category type var args
7542 \def\deftypecvgeneral#1#2 #3 #4 #5\endheader{%
7543 \dosubind{vr}{\code{#4}}{#1}%
7544 \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
7547 % Untyped variables:
7549 % @defvr category var args
7550 \makedefun{defvr}#1 {\deftypevrheader{#1} {} }
7552 % @defcv category class var args
7553 \makedefun{defcv}#1 {\defcvof{#1\ \putwordof}}
7555 % \defcvof {category of}class var args
7556 \def\defcvof#1#2 {\deftypecvof{#1}#2 {} }
7558 % Types:
7560 % @deftp category name args
7561 \makedefun{deftp}#1 #2 #3\endheader{%
7562 \doind{tp}{\code{#2}}%
7563 \defname{#1}{}{#2}\defunargs{#3\unskip}%
7566 % Remaining @defun-like shortcuts:
7567 \makedefun{defun}{\deffnheader{\putwordDeffunc} }
7568 \makedefun{defmac}{\deffnheader{\putwordDefmac} }
7569 \makedefun{defspec}{\deffnheader{\putwordDefspec} }
7570 \makedefun{deftypefun}{\deftypefnheader{\putwordDeffunc} }
7571 \makedefun{defvar}{\defvrheader{\putwordDefvar} }
7572 \makedefun{defopt}{\defvrheader{\putwordDefopt} }
7573 \makedefun{deftypevar}{\deftypevrheader{\putwordDefvar} }
7574 \makedefun{defmethod}{\defopon\putwordMethodon}
7575 \makedefun{deftypemethod}{\deftypeopon\putwordMethodon}
7576 \makedefun{defivar}{\defcvof\putwordInstanceVariableof}
7577 \makedefun{deftypeivar}{\deftypecvof\putwordInstanceVariableof}
7579 % \defname, which formats the name of the @def (not the args).
7580 % #1 is the category, such as "Function".
7581 % #2 is the return type, if any.
7582 % #3 is the function name.
7584 % We are followed by (but not passed) the arguments, if any.
7586 \def\defname#1#2#3{%
7587 \par
7588 % Get the values of \leftskip and \rightskip as they were outside the @def...
7589 \advance\leftskip by -\defbodyindent
7591 % Determine if we are typesetting the return type of a typed function
7592 % on a line by itself.
7593 \rettypeownlinefalse
7594 \ifdoingtypefn % doing a typed function specifically?
7595 % then check user option for putting return type on its own line:
7596 \expandafter\ifx\csname SETtxideftypefnnl\endcsname\relax \else
7597 \rettypeownlinetrue
7601 % How we'll format the category name. Putting it in brackets helps
7602 % distinguish it from the body text that may end up on the next line
7603 % just below it.
7604 \def\temp{#1}%
7605 \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi}
7607 % Figure out line sizes for the paragraph shape. We'll always have at
7608 % least two.
7609 \tempnum = 2
7611 % The first line needs space for \box0; but if \rightskip is nonzero,
7612 % we need only space for the part of \box0 which exceeds it:
7613 \dimen0=\hsize \advance\dimen0 by -\wd0 \advance\dimen0 by \rightskip
7615 % If doing a return type on its own line, we'll have another line.
7616 \ifrettypeownline
7617 \advance\tempnum by 1
7618 \def\maybeshapeline{0in \hsize}%
7619 \else
7620 \def\maybeshapeline{}%
7623 % The continuations:
7624 \dimen2=\hsize \advance\dimen2 by -\defargsindent
7626 % The final paragraph shape:
7627 \parshape \tempnum 0in \dimen0 \maybeshapeline \defargsindent \dimen2
7629 % Put the category name at the right margin.
7630 \noindent
7631 \hbox to 0pt{%
7632 \hfil\box0 \kern-\hsize
7633 % \hsize has to be shortened this way:
7634 \kern\leftskip
7635 % Intentionally do not respect \rightskip, since we need the space.
7638 % Allow all lines to be underfull without complaint:
7639 \tolerance=10000 \hbadness=10000
7640 \exdentamount=\defbodyindent
7642 % defun fonts. We use typewriter by default (used to be bold) because:
7643 % . we're printing identifiers, they should be in tt in principle.
7644 % . in languages with many accents, such as Czech or French, it's
7645 % common to leave accents off identifiers. The result looks ok in
7646 % tt, but exceedingly strange in rm.
7647 % . we don't want -- and --- to be treated as ligatures.
7648 % . this still does not fix the ?` and !` ligatures, but so far no
7649 % one has made identifiers using them :).
7650 \df \tt
7651 \def\temp{#2}% text of the return type
7652 \ifx\temp\empty\else
7653 \tclose{\temp}% typeset the return type
7654 \ifrettypeownline
7655 % put return type on its own line; prohibit line break following:
7656 \hfil\vadjust{\nobreak}\break
7657 \else
7658 \space % type on same line, so just followed by a space
7660 \fi % no return type
7661 #3% output function name
7663 {\rm\enskip}% hskip 0.5 em of \tenrm
7665 \boldbrax
7666 % arguments will be output next, if any.
7669 % Print arguments in slanted roman (not ttsl), inconsistently with using
7670 % tt for the name. This is because literal text is sometimes needed in
7671 % the argument list (groff manual), and ttsl and tt are not very
7672 % distinguishable. Prevent hyphenation at `-' chars.
7674 \def\defunargs#1{%
7675 % use sl by default (not ttsl),
7676 % tt for the names.
7677 \df \sl \hyphenchar\font=0
7679 % On the other hand, if an argument has two dashes (for instance), we
7680 % want a way to get ttsl. We used to recommend @var for that, so
7681 % leave the code in, but it's strange for @var to lead to typewriter.
7682 % Nowadays we recommend @code, since the difference between a ttsl hyphen
7683 % and a tt hyphen is pretty tiny. @code also disables ?` !`.
7684 \def\var##1{{\setupmarkupstyle{var}\ttslanted{##1}}}%
7686 \sl\hyphenchar\font=45
7689 % We want ()&[] to print specially on the defun line.
7691 \def\activeparens{%
7692 \catcode`\(=\active \catcode`\)=\active
7693 \catcode`\[=\active \catcode`\]=\active
7694 \catcode`\&=\active
7697 % Make control sequences which act like normal parenthesis chars.
7698 \let\lparen = ( \let\rparen = )
7700 % Be sure that we always have a definition for `(', etc. For example,
7701 % if the fn name has parens in it, \boldbrax will not be in effect yet,
7702 % so TeX would otherwise complain about undefined control sequence.
7704 \activeparens
7705 \global\let(=\lparen \global\let)=\rparen
7706 \global\let[=\lbrack \global\let]=\rbrack
7707 \global\let& = \&
7709 \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}
7710 \gdef\magicamp{\let&=\amprm}
7713 \newcount\parencount
7715 % If we encounter &foo, then turn on ()-hacking afterwards
7716 \newif\ifampseen
7717 \def\amprm#1 {\ampseentrue{\bf\&#1 }}
7719 \def\parenfont{%
7720 \ifampseen
7721 % At the first level, print parens in roman,
7722 % otherwise use the default font.
7723 \ifnum \parencount=1 \rm \fi
7724 \else
7725 % The \sf parens (in \boldbrax) actually are a little bolder than
7726 % the contained text. This is especially needed for [ and ] .
7730 \def\infirstlevel#1{%
7731 \ifampseen
7732 \ifnum\parencount=1
7737 \def\bfafterword#1 {#1 \bf}
7739 \def\opnr{%
7740 \global\advance\parencount by 1
7741 {\parenfont(}%
7742 \infirstlevel \bfafterword
7744 \def\clnr{%
7745 {\parenfont)}%
7746 \infirstlevel \sl
7747 \global\advance\parencount by -1
7750 \newcount\brackcount
7751 \def\lbrb{%
7752 \global\advance\brackcount by 1
7753 {\bf[}%
7755 \def\rbrb{%
7756 {\bf]}%
7757 \global\advance\brackcount by -1
7760 \def\checkparencounts{%
7761 \ifnum\parencount=0 \else \badparencount \fi
7762 \ifnum\brackcount=0 \else \badbrackcount \fi
7764 % these should not use \errmessage; the glibc manual, at least, actually
7765 % has such constructs (when documenting function pointers).
7766 \def\badparencount{%
7767 \message{Warning: unbalanced parentheses in @def...}%
7768 \global\parencount=0
7770 \def\badbrackcount{%
7771 \message{Warning: unbalanced square brackets in @def...}%
7772 \global\brackcount=0
7776 \message{macros,}
7777 % @macro.
7779 % To do this right we need a feature of e-TeX, \scantokens,
7780 % which we arrange to emulate with a temporary file in ordinary TeX.
7781 \ifx\eTeXversion\thisisundefined
7782 \newwrite\macscribble
7783 \def\scantokens#1{%
7784 \toks0={#1}%
7785 \immediate\openout\macscribble=\jobname.tmp
7786 \immediate\write\macscribble{\the\toks0}%
7787 \immediate\closeout\macscribble
7788 \input \jobname.tmp
7792 \let\aftermacroxxx\relax
7793 \def\aftermacro{\aftermacroxxx}
7795 % alias because \c means cedilla in @tex or @math
7796 \let\texinfoc=\c
7798 % Used at the time of macro expansion.
7799 % Argument is macro body with arguments substituted
7800 \def\scanmacro#1{%
7801 \newlinechar`\^^M
7802 \def\xprocessmacroarg{\eatspaces}%
7804 % Process the macro body under the current catcode regime.
7805 \scantokens{#1\texinfoc}\aftermacro%
7807 % The \c is to remove the \newlinechar added by \scantokens, and
7808 % can be noticed by \parsearg.
7809 % The \aftermacro allows a \comment at the end of the macro definition
7810 % to duplicate itself past the final \newlinechar added by \scantokens:
7811 % this is used in the definition of \group to comment out a newline. We
7812 % don't do the same for \c to support Texinfo files with macros that ended
7813 % with a @c, which should no longer be necessary.
7814 % We avoid surrounding the call to \scantokens with \bgroup and \egroup
7815 % to allow macros to open or close groups themselves.
7818 % Used for copying and captions
7819 \def\scanexp#1{%
7820 \bgroup
7821 % Undo catcode changes of \startcontents and \printindex
7822 % When called from @insertcopying or (short)caption, we need active
7823 % backslash to get it printed correctly.
7824 % FIXME: This may not be needed.
7825 %\catcode`\@=0 \catcode`\\=\active \escapechar=`\@
7826 \edef\temp{\noexpand\scanmacro{#1}}%
7827 \temp
7828 \egroup
7831 \newcount\paramno % Count of parameters
7832 \newtoks\macname % Macro name
7833 \newif\ifrecursive % Is it recursive?
7835 % List of all defined macros in the form
7836 % \definedummyword\macro1\definedummyword\macro2...
7837 % Currently is also contains all @aliases; the list can be split
7838 % if there is a need.
7839 \def\macrolist{}
7841 % Add the macro to \macrolist
7842 \def\addtomacrolist#1{\expandafter \addtomacrolistxxx \csname#1\endcsname}
7843 \def\addtomacrolistxxx#1{%
7844 \toks0 = \expandafter{\macrolist\definedummyword#1}%
7845 \xdef\macrolist{\the\toks0}%
7848 % Utility routines.
7849 % This does \let #1 = #2, with \csnames; that is,
7850 % \let \csname#1\endcsname = \csname#2\endcsname
7851 % (except of course we have to play expansion games).
7853 \def\cslet#1#2{%
7854 \expandafter\let
7855 \csname#1\expandafter\endcsname
7856 \csname#2\endcsname
7859 % Trim leading and trailing spaces off a string.
7860 % Concepts from aro-bend problem 15 (see CTAN).
7861 {\catcode`\@=11
7862 \gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }}
7863 \gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@}
7864 \gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @}
7865 \def\unbrace#1{#1}
7866 \unbrace{\gdef\trim@@@ #1 } #2@{#1}
7869 % Trim a single trailing ^^M off a string.
7870 {\catcode`\^^M=\other \catcode`\Q=3%
7871 \gdef\eatcr #1{\eatcra #1Q^^MQ}%
7872 \gdef\eatcra#1^^MQ{\eatcrb#1Q}%
7873 \gdef\eatcrb#1Q#2Q{#1}%
7876 % Macro bodies are absorbed as an argument in a context where
7877 % all characters are catcode 10, 11 or 12, except \ which is active
7878 % (as in normal texinfo). It is necessary to change the definition of \
7879 % to recognize macro arguments; this is the job of \mbodybackslash.
7881 % Non-ASCII encodings make 8-bit characters active, so un-activate
7882 % them to avoid their expansion. Must do this non-globally, to
7883 % confine the change to the current group.
7885 % It's necessary to have hard CRs when the macro is executed. This is
7886 % done by making ^^M (\endlinechar) catcode 12 when reading the macro
7887 % body, and then making it the \newlinechar in \scanmacro.
7889 \def\scanctxt{% used as subroutine
7890 \catcode`\"=\other
7891 \catcode`\+=\other
7892 \catcode`\<=\other
7893 \catcode`\>=\other
7894 \catcode`\^=\other
7895 \catcode`\_=\other
7896 \catcode`\|=\other
7897 \catcode`\~=\other
7898 \ifx\declaredencoding\ascii \else \setcharscatcodeothernonglobal \fi
7901 \def\scanargctxt{% used for copying and captions, not macros.
7902 \scanctxt
7903 \catcode`\@=\other
7904 \catcode`\\=\other
7905 \catcode`\^^M=\other
7908 \def\macrobodyctxt{% used for @macro definitions
7909 \scanctxt
7910 \catcode`\ =\other
7911 \catcode`\@=\other
7912 \catcode`\{=\other
7913 \catcode`\}=\other
7914 \catcode`\^^M=\other
7915 \usembodybackslash
7918 % Used when scanning braced macro arguments. Note, however, that catcode
7919 % changes here are ineffectual if the macro invocation was nested inside
7920 % an argument to another Texinfo command.
7921 \def\macroargctxt{%
7922 \scanctxt
7923 \catcode`\ =\active
7924 \catcode`\^^M=\other
7925 \catcode`\\=\active
7928 \def\macrolineargctxt{% used for whole-line arguments without braces
7929 \scanctxt
7930 \catcode`\{=\other
7931 \catcode`\}=\other
7934 % \mbodybackslash is the definition of \ in @macro bodies.
7935 % It maps \foo\ => \csname macarg.foo\endcsname => #N
7936 % where N is the macro parameter number.
7937 % We define \csname macarg.\endcsname to be \realbackslash, so
7938 % \\ in macro replacement text gets you a backslash.
7940 {\catcode`@=0 @catcode`@\=@active
7941 @gdef@usembodybackslash{@let\=@mbodybackslash}
7942 @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname}
7944 \expandafter\def\csname macarg.\endcsname{\realbackslash}
7946 \def\margbackslash#1{\char`\#1 }
7948 \def\macro{\recursivefalse\parsearg\macroxxx}
7949 \def\rmacro{\recursivetrue\parsearg\macroxxx}
7951 \def\macroxxx#1{%
7952 \getargs{#1}% now \macname is the macname and \argl the arglist
7953 \ifx\argl\empty % no arguments
7954 \paramno=0\relax
7955 \else
7956 \expandafter\parsemargdef \argl;%
7957 \if\paramno>256\relax
7958 \ifx\eTeXversion\thisisundefined
7959 \errhelp = \EMsimple
7960 \errmessage{You need eTeX to compile a file with macros with more than 256 arguments}
7964 \if1\csname ismacro.\the\macname\endcsname
7965 \message{Warning: redefining \the\macname}%
7966 \else
7967 \expandafter\ifx\csname \the\macname\endcsname \relax
7968 \else \errmessage{Macro name \the\macname\space already defined}\fi
7969 \global\cslet{macsave.\the\macname}{\the\macname}%
7970 \global\expandafter\let\csname ismacro.\the\macname\endcsname=1%
7971 \addtomacrolist{\the\macname}%
7973 \begingroup \macrobodyctxt
7974 \ifrecursive \expandafter\parsermacbody
7975 \else \expandafter\parsemacbody
7976 \fi}
7978 \parseargdef\unmacro{%
7979 \if1\csname ismacro.#1\endcsname
7980 \global\cslet{#1}{macsave.#1}%
7981 \global\expandafter\let \csname ismacro.#1\endcsname=0%
7982 % Remove the macro name from \macrolist:
7983 \begingroup
7984 \expandafter\let\csname#1\endcsname \relax
7985 \let\definedummyword\unmacrodo
7986 \xdef\macrolist{\macrolist}%
7987 \endgroup
7988 \else
7989 \errmessage{Macro #1 not defined}%
7993 % Called by \do from \dounmacro on each macro. The idea is to omit any
7994 % macro definitions that have been changed to \relax.
7996 \def\unmacrodo#1{%
7997 \ifx #1\relax
7998 % remove this
7999 \else
8000 \noexpand\definedummyword \noexpand#1%
8004 % \getargs -- Parse the arguments to a @macro line. Set \macname to
8005 % the name of the macro, and \argl to the braced argument list.
8006 \def\getargs#1{\getargsxxx#1{}}
8007 \def\getargsxxx#1#{\getmacname #1 \relax\getmacargs}
8008 \def\getmacname#1 #2\relax{\macname={#1}}
8009 \def\getmacargs#1{\def\argl{#1}}
8010 % This made use of the feature that if the last token of a
8011 % <parameter list> is #, then the preceding argument is delimited by
8012 % an opening brace, and that opening brace is not consumed.
8014 % Parse the optional {params} list to @macro or @rmacro.
8015 % Set \paramno to the number of arguments,
8016 % and \paramlist to a parameter text for the macro (e.g. #1,#2,#3 for a
8017 % three-param macro.) Define \macarg.BLAH for each BLAH in the params
8018 % list to some hook where the argument is to be expanded. If there are
8019 % less than 10 arguments that hook is to be replaced by ##N where N
8020 % is the position in that list, that is to say the macro arguments are to be
8021 % defined `a la TeX in the macro body.
8023 % That gets used by \mbodybackslash (above).
8025 % If there are 10 or more arguments, a different technique is used: see
8026 % \parsemmanyargdef.
8028 \def\parsemargdef#1;{%
8029 \paramno=0\def\paramlist{}%
8030 \let\hash\relax
8031 % \hash is redefined to `#' later to get it into definitions
8032 \let\processmacroarg\relax
8033 \parsemargdefxxx#1,;,%
8034 \ifnum\paramno<10\relax\else
8035 \paramno0\relax
8036 \parsemmanyargdef@@#1,;,% 10 or more arguments
8039 \def\parsemargdefxxx#1,{%
8040 \if#1;\let\next=\relax
8041 \else \let\next=\parsemargdefxxx
8042 \advance\paramno by 1
8043 \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname
8044 {\processmacroarg{\hash\the\paramno}}%
8045 \edef\paramlist{\paramlist\hash\the\paramno,}%
8046 \fi\next}
8048 % \parsemacbody, \parsermacbody
8050 % Read recursive and nonrecursive macro bodies. (They're different since
8051 % rec and nonrec macros end differently.)
8053 % We are in \macrobodyctxt, and the \xdef causes backslashshes in the macro
8054 % body to be transformed.
8055 % Set \macrobody to the body of the macro, and call \defmacro.
8057 {\catcode`\ =\other\long\gdef\parsemacbody#1@end macro{%
8058 \xdef\macrobody{\eatcr{#1}}\endgroup\defmacro}}%
8059 {\catcode`\ =\other\long\gdef\parsermacbody#1@end rmacro{%
8060 \xdef\macrobody{\eatcr{#1}}\endgroup\defmacro}}%
8062 % Make @ a letter, so that we can make private-to-Texinfo macro names.
8063 \edef\texiatcatcode{\the\catcode`\@}
8064 \catcode `@=11\relax
8066 %%%%%%%%%%%%%% Code for > 10 arguments only %%%%%%%%%%%%%%%%%%
8068 % If there are 10 or more arguments, a different technique is used, where the
8069 % hook remains in the body, and when macro is to be expanded the body is
8070 % processed again to replace the arguments.
8072 % In that case, the hook is \the\toks N-1, and we simply set \toks N-1 to the
8073 % argument N value and then \edef the body (nothing else will expand because of
8074 % the catcode regime under which the body was input).
8076 % If you compile with TeX (not eTeX), and you have macros with 10 or more
8077 % arguments, no macro can have more than 256 arguments (else error).
8079 % In case that there are 10 or more arguments we parse again the arguments
8080 % list to set new definitions for the \macarg.BLAH macros corresponding to
8081 % each BLAH argument. It was anyhow needed to parse already once this list
8082 % in order to count the arguments, and as macros with at most 9 arguments
8083 % are by far more frequent than macro with 10 or more arguments, defining
8084 % twice the \macarg.BLAH macros does not cost too much processing power.
8085 \def\parsemmanyargdef@@#1,{%
8086 \if#1;\let\next=\relax
8087 \else
8088 \let\next=\parsemmanyargdef@@
8089 \edef\tempb{\eatspaces{#1}}%
8090 \expandafter\def\expandafter\tempa
8091 \expandafter{\csname macarg.\tempb\endcsname}%
8092 % Note that we need some extra \noexpand\noexpand, this is because we
8093 % don't want \the to be expanded in the \parsermacbody as it uses an
8094 % \xdef .
8095 \expandafter\edef\tempa
8096 {\noexpand\noexpand\noexpand\the\toks\the\paramno}%
8097 \advance\paramno by 1\relax
8098 \fi\next}
8101 \let\endargs@\relax
8102 \let\nil@\relax
8103 \def\nilm@{\nil@}%
8104 \long\def\nillm@{\nil@}%
8106 % This macro is expanded during the Texinfo macro expansion, not during its
8107 % definition. It gets all the arguments' values and assigns them to macros
8108 % macarg.ARGNAME
8110 % #1 is the macro name
8111 % #2 is the list of argument names
8112 % #3 is the list of argument values
8113 \def\getargvals@#1#2#3{%
8114 \def\macargdeflist@{}%
8115 \def\saveparamlist@{#2}% Need to keep a copy for parameter expansion.
8116 \def\paramlist{#2,\nil@}%
8117 \def\macroname{#1}%
8118 \begingroup
8119 \macroargctxt
8120 \def\argvaluelist{#3,\nil@}%
8121 \def\@tempa{#3}%
8122 \ifx\@tempa\empty
8123 \setemptyargvalues@
8124 \else
8125 \getargvals@@
8128 \def\getargvals@@{%
8129 \ifx\paramlist\nilm@
8130 % Some sanity check needed here that \argvaluelist is also empty.
8131 \ifx\argvaluelist\nillm@
8132 \else
8133 \errhelp = \EMsimple
8134 \errmessage{Too many arguments in macro `\macroname'!}%
8136 \let\next\macargexpandinbody@
8137 \else
8138 \ifx\argvaluelist\nillm@
8139 % No more arguments values passed to macro. Set remaining named-arg
8140 % macros to empty.
8141 \let\next\setemptyargvalues@
8142 \else
8143 % pop current arg name into \@tempb
8144 \def\@tempa##1{\pop@{\@tempb}{\paramlist}##1\endargs@}%
8145 \expandafter\@tempa\expandafter{\paramlist}%
8146 % pop current argument value into \@tempc
8147 \def\@tempa##1{\longpop@{\@tempc}{\argvaluelist}##1\endargs@}%
8148 \expandafter\@tempa\expandafter{\argvaluelist}%
8149 % Here \@tempb is the current arg name and \@tempc is the current arg value.
8150 % First place the new argument macro definition into \@tempd
8151 \expandafter\macname\expandafter{\@tempc}%
8152 \expandafter\let\csname macarg.\@tempb\endcsname\relax
8153 \expandafter\def\expandafter\@tempe\expandafter{%
8154 \csname macarg.\@tempb\endcsname}%
8155 \edef\@tempd{\long\def\@tempe{\the\macname}}%
8156 \push@\@tempd\macargdeflist@
8157 \let\next\getargvals@@
8160 \next
8163 \def\push@#1#2{%
8164 \expandafter\expandafter\expandafter\def
8165 \expandafter\expandafter\expandafter#2%
8166 \expandafter\expandafter\expandafter{%
8167 \expandafter#1#2}%
8170 % Replace arguments by their values in the macro body, and place the result
8171 % in macro \@tempa.
8173 \def\macvalstoargs@{%
8174 % To do this we use the property that token registers that are \the'ed
8175 % within an \edef expand only once. So we are going to place all argument
8176 % values into respective token registers.
8178 % First we save the token context, and initialize argument numbering.
8179 \begingroup
8180 \paramno0\relax
8181 % Then, for each argument number #N, we place the corresponding argument
8182 % value into a new token list register \toks#N
8183 \expandafter\putargsintokens@\saveparamlist@,;,%
8184 % Then, we expand the body so that argument are replaced by their
8185 % values. The trick for values not to be expanded themselves is that they
8186 % are within tokens and that tokens expand only once in an \edef .
8187 \edef\@tempc{\csname mac.\macroname .body\endcsname}%
8188 % Now we restore the token stack pointer to free the token list registers
8189 % which we have used, but we make sure that expanded body is saved after
8190 % group.
8191 \expandafter
8192 \endgroup
8193 \expandafter\def\expandafter\@tempa\expandafter{\@tempc}%
8196 % Define the named-macro outside of this group and then close this group.
8198 \def\macargexpandinbody@{%
8199 \expandafter
8200 \endgroup
8201 \macargdeflist@
8202 % First the replace in body the macro arguments by their values, the result
8203 % is in \@tempa .
8204 \macvalstoargs@
8205 % Then we point at the \norecurse or \gobble (for recursive) macro value
8206 % with \@tempb .
8207 \expandafter\let\expandafter\@tempb\csname mac.\macroname .recurse\endcsname
8208 % Depending on whether it is recursive or not, we need some tailing
8209 % \egroup .
8210 \ifx\@tempb\gobble
8211 \let\@tempc\relax
8212 \else
8213 \let\@tempc\egroup
8215 % And now we do the real job:
8216 \edef\@tempd{\noexpand\@tempb{\macroname}\noexpand\scanmacro{\@tempa}\@tempc}%
8217 \@tempd
8220 \def\putargsintokens@#1,{%
8221 \if#1;\let\next\relax
8222 \else
8223 \let\next\putargsintokens@
8224 % First we allocate the new token list register, and give it a temporary
8225 % alias \@tempb .
8226 \toksdef\@tempb\the\paramno
8227 % Then we place the argument value into that token list register.
8228 \expandafter\let\expandafter\@tempa\csname macarg.#1\endcsname
8229 \expandafter\@tempb\expandafter{\@tempa}%
8230 \advance\paramno by 1\relax
8232 \next
8235 % Trailing missing arguments are set to empty.
8237 \def\setemptyargvalues@{%
8238 \ifx\paramlist\nilm@
8239 \let\next\macargexpandinbody@
8240 \else
8241 \expandafter\setemptyargvaluesparser@\paramlist\endargs@
8242 \let\next\setemptyargvalues@
8244 \next
8247 \def\setemptyargvaluesparser@#1,#2\endargs@{%
8248 \expandafter\def\expandafter\@tempa\expandafter{%
8249 \expandafter\def\csname macarg.#1\endcsname{}}%
8250 \push@\@tempa\macargdeflist@
8251 \def\paramlist{#2}%
8254 % #1 is the element target macro
8255 % #2 is the list macro
8256 % #3,#4\endargs@ is the list value
8257 \def\pop@#1#2#3,#4\endargs@{%
8258 \def#1{#3}%
8259 \def#2{#4}%
8261 \long\def\longpop@#1#2#3,#4\endargs@{%
8262 \long\def#1{#3}%
8263 \long\def#2{#4}%
8267 %%%%%%%%%%%%%% End of code for > 10 arguments %%%%%%%%%%%%%%%%%%
8271 % Remove following spaces at the expansion stage.
8272 % This works because spaces are discarded before each argument when TeX is
8273 % getting the arguments for a macro.
8274 % This must not be immediately followed by a }.
8275 \long\def\gobblespaces#1{#1}
8277 % This defines a Texinfo @macro or @rmacro, called by \parsemacbody.
8278 % \macrobody has the body of the macro in it, with placeholders for
8279 % its parameters, looking like "\processmacroarg{\hash 1}".
8280 % \paramno is the number of parameters
8281 % \paramlist is a TeX parameter text, e.g. "#1,#2,#3,"
8282 % There are eight cases: recursive and nonrecursive macros of zero, one,
8283 % up to nine, and many arguments.
8284 % \xdef is used so that macro definitions will survive the file
8285 % they're defined in: @include reads the file inside a group.
8287 \def\defmacro{%
8288 \let\hash=##% convert placeholders to macro parameter chars
8289 \ifnum\paramno=1
8290 \def\processmacroarg{\gobblespaces}%
8291 % This removes the pair of braces around the argument. We don't
8292 % use \eatspaces, because this can cause ends of lines to be lost
8293 % when the argument to \eatspaces is read, leading to line-based
8294 % commands like "@itemize" not being read correctly.
8295 \else
8296 \def\processmacroarg{\xprocessmacroarg}%
8297 \let\xprocessmacroarg\relax
8299 \ifrecursive %%%%%%%%%%%%%% Recursive %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8300 \ifcase\paramno
8302 \expandafter\xdef\csname\the\macname\endcsname{%
8303 \noexpand\scanmacro{\macrobody}}%
8304 \or % 1
8305 \expandafter\xdef\csname\the\macname\endcsname{%
8306 \bgroup
8307 \noexpand\braceorline
8308 \expandafter\noexpand\csname\the\macname @@@\endcsname}%
8309 \expandafter\xdef\csname\the\macname @@@\endcsname##1{%
8310 \expandafter\noexpand\csname\the\macname @@@@\endcsname{%
8311 \noexpand\gobblespaces##1\empty}%
8312 % The \empty is for \gobblespaces in case #1 is empty
8314 \expandafter\xdef\csname\the\macname @@@@\endcsname##1{%
8315 \egroup\noexpand\scanmacro{\macrobody}}%
8316 \else
8317 \ifnum\paramno<10\relax % at most 9
8318 % See non-recursive section below for comments
8319 \expandafter\xdef\csname\the\macname\endcsname{%
8320 \bgroup
8321 \noexpand\expandafter
8322 \noexpand\macroargctxt
8323 \noexpand\expandafter
8324 \expandafter\noexpand\csname\the\macname @@\endcsname}%
8325 \expandafter\xdef\csname\the\macname @@\endcsname##1{%
8326 \noexpand\passargtomacro
8327 \expandafter\noexpand\csname\the\macname @@@\endcsname{##1,}}%
8328 \expandafter\xdef\csname\the\macname @@@\endcsname##1{%
8329 \expandafter\noexpand\csname\the\macname @@@@\endcsname ##1}%
8330 \expandafter\expandafter
8331 \expandafter\xdef
8332 \expandafter\expandafter
8333 \csname\the\macname @@@@\endcsname\paramlist{%
8334 \egroup\noexpand\scanmacro{\macrobody}}%
8335 \else % 10 or more
8336 \expandafter\xdef\csname\the\macname\endcsname{%
8337 \noexpand\getargvals@{\the\macname}{\argl}%
8339 \global\expandafter\let\csname mac.\the\macname .body\endcsname\macrobody
8340 \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\gobble
8343 \else %%%%%%%%%%%%%%%%%%%%%% Non-recursive %%%%%%%%%%%%%%%%%%%%%%%%%%
8344 \ifcase\paramno
8346 \expandafter\xdef\csname\the\macname\endcsname{%
8347 \noexpand\scanmacro{\macrobody}}%
8348 \or % 1
8349 \expandafter\xdef\csname\the\macname\endcsname{%
8350 \bgroup
8351 \noexpand\braceorline
8352 \expandafter\noexpand\csname\the\macname @@@\endcsname}%
8353 \expandafter\xdef\csname\the\macname @@@\endcsname##1{%
8354 \expandafter\noexpand\csname\the\macname @@@@\endcsname{%
8355 \noexpand\gobblespaces##1\empty}%
8356 % The \empty is for \gobblespaces in case #1 is empty
8358 \expandafter\xdef\csname\the\macname @@@@\endcsname##1{%
8359 \egroup
8360 \noexpand\scanmacro{\macrobody}%
8362 \else % at most 9
8363 \ifnum\paramno<10\relax
8364 % @MACNAME sets the context for reading the macro argument
8365 % @MACNAME@@ gets the argument, processes backslashes and appends a
8366 % comma.
8367 % @MACNAME@@@ removes braces surrounding the argument list.
8368 % @MACNAME@@@@ scans the macro body with arguments substituted.
8369 \expandafter\xdef\csname\the\macname\endcsname{%
8370 \bgroup
8371 \noexpand\expandafter % This \expandafter skip any spaces after the
8372 \noexpand\macroargctxt % macro before we change the catcode of space.
8373 \noexpand\expandafter
8374 \expandafter\noexpand\csname\the\macname @@\endcsname}%
8375 \expandafter\xdef\csname\the\macname @@\endcsname##1{%
8376 \noexpand\passargtomacro
8377 \expandafter\noexpand\csname\the\macname @@@\endcsname{##1,}}%
8378 \expandafter\xdef\csname\the\macname @@@\endcsname##1{%
8379 \expandafter\noexpand\csname\the\macname @@@@\endcsname ##1}%
8380 \expandafter\expandafter
8381 \expandafter\xdef
8382 \expandafter\expandafter
8383 \csname\the\macname @@@@\endcsname\paramlist{%
8384 \egroup\noexpand\scanmacro{\macrobody}}%
8385 \else % 10 or more:
8386 \expandafter\xdef\csname\the\macname\endcsname{%
8387 \noexpand\getargvals@{\the\macname}{\argl}%
8389 \global\expandafter\let\csname mac.\the\macname .body\endcsname\macrobody
8390 \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\norecurse
8393 \fi}
8395 \catcode `\@\texiatcatcode\relax % end private-to-Texinfo catcodes
8397 \def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}}
8400 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8402 {\catcode`\@=0 \catcode`\\=13 % We need to manipulate \ so use @ as escape
8403 @catcode`@_=11 % private names
8404 @catcode`@!=11 % used as argument separator
8406 % \passargtomacro#1#2 -
8407 % Call #1 with a list of tokens #2, with any doubled backslashes in #2
8408 % compressed to one.
8410 % This implementation works by expansion, and not execution (so we cannot use
8411 % \def or similar). This reduces the risk of this failing in contexts where
8412 % complete expansion is done with no execution (for example, in writing out to
8413 % an auxiliary file for an index entry).
8415 % State is kept in the input stream: the argument passed to
8416 % @look_ahead, @gobble_and_check_finish and @add_segment is
8418 % THE_MACRO ARG_RESULT ! {PENDING_BS} NEXT_TOKEN (... rest of input)
8420 % where:
8421 % THE_MACRO - name of the macro we want to call
8422 % ARG_RESULT - argument list we build to pass to that macro
8423 % PENDING_BS - either a backslash or nothing
8424 % NEXT_TOKEN - used to look ahead in the input stream to see what's coming next
8426 @gdef@passargtomacro#1#2{%
8427 @add_segment #1!{}@relax#2\@_finish\%
8429 @gdef@_finish{@_finishx} @global@let@_finishx@relax
8431 % #1 - THE_MACRO ARG_RESULT
8432 % #2 - PENDING_BS
8433 % #3 - NEXT_TOKEN
8434 % #4 used to look ahead
8436 % If the next token is not a backslash, process the rest of the argument;
8437 % otherwise, remove the next token.
8438 @gdef@look_ahead#1!#2#3#4{%
8439 @ifx#4\%
8440 @expandafter@gobble_and_check_finish
8441 @else
8442 @expandafter@add_segment
8443 @fi#1!{#2}#4#4%
8446 % #1 - THE_MACRO ARG_RESULT
8447 % #2 - PENDING_BS
8448 % #3 - NEXT_TOKEN
8449 % #4 should be a backslash, which is gobbled.
8450 % #5 looks ahead
8452 % Double backslash found. Add a single backslash, and look ahead.
8453 @gdef@gobble_and_check_finish#1!#2#3#4#5{%
8454 @add_segment#1\!{}#5#5%
8457 @gdef@is_fi{@fi}
8459 % #1 - THE_MACRO ARG_RESULT
8460 % #2 - PENDING_BS
8461 % #3 - NEXT_TOKEN
8462 % #4 is input stream until next backslash
8464 % Input stream is either at the start of the argument, or just after a
8465 % backslash sequence, either a lone backslash, or a doubled backslash.
8466 % NEXT_TOKEN contains the first token in the input stream: if it is \finish,
8467 % finish; otherwise, append to ARG_RESULT the segment of the argument up until
8468 % the next backslash. PENDING_BACKSLASH contains a backslash to represent
8469 % a backslash just before the start of the input stream that has not been
8470 % added to ARG_RESULT.
8471 @gdef@add_segment#1!#2#3#4\{%
8472 @ifx#3@_finish
8473 @call_the_macro#1!%
8474 @else
8475 % append the pending backslash to the result, followed by the next segment
8476 @expandafter@is_fi@look_ahead#1#2#4!{\}@fi
8477 % this @fi is discarded by @look_ahead.
8478 % we can't get rid of it with \expandafter because we don't know how
8479 % long #4 is.
8482 % #1 - THE_MACRO
8483 % #2 - ARG_RESULT
8484 % #3 discards the res of the conditional in @add_segment, and @is_fi ends the
8485 % conditional.
8486 @gdef@call_the_macro#1#2!#3@fi{@is_fi #1{#2}}
8489 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8491 % \braceorline MAC is used for a one-argument macro MAC. It checks
8492 % whether the next non-whitespace character is a {. It sets the context
8493 % for reading the argument (slightly different in the two cases). Then,
8494 % to read the argument, in the whole-line case, it then calls the regular
8495 % \parsearg MAC; in the lbrace case, it calls \passargtomacro MAC.
8497 \def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx}
8498 \def\braceorlinexxx{%
8499 \ifx\nchar\bgroup
8500 \macroargctxt
8501 \expandafter\passargtomacro
8502 \else
8503 \macrolineargctxt\expandafter\parsearg
8504 \fi \macnamexxx}
8507 % @alias.
8508 % We need some trickery to remove the optional spaces around the equal
8509 % sign. Make them active and then expand them all to nothing.
8511 \def\alias{\parseargusing\obeyspaces\aliasxxx}
8512 \def\aliasxxx #1{\aliasyyy#1\relax}
8513 \def\aliasyyy #1=#2\relax{%
8515 \expandafter\let\obeyedspace=\empty
8516 \addtomacrolist{#1}%
8517 \xdef\next{\global\let\makecsname{#1}=\makecsname{#2}}%
8519 \next
8523 \message{cross references,}
8525 \newwrite\auxfile
8526 \newif\ifhavexrefs % True if xref values are known.
8527 \newif\ifwarnedxrefs % True if we warned once that they aren't known.
8529 % @inforef is relatively simple.
8530 \def\inforef #1{\inforefzzz #1,,,,**}
8531 \def\inforefzzz #1,#2,#3,#4**{%
8532 \putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
8533 node \samp{\ignorespaces#1{}}}
8535 % @node's only job in TeX is to define \lastnode, which is used in
8536 % cross-references. The @node line might or might not have commas, and
8537 % might or might not have spaces before the first comma, like:
8538 % @node foo , bar , ...
8539 % We don't want such trailing spaces in the node name.
8541 \parseargdef\node{\checkenv{}\donode #1 ,\finishnodeparse}
8543 % also remove a trailing comma, in case of something like this:
8544 % @node Help-Cross, , , Cross-refs
8545 \def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse}
8546 \def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}}
8548 \let\nwnode=\node
8549 \let\lastnode=\empty
8551 % Write a cross-reference definition for the current node. #1 is the
8552 % type (Ynumbered, Yappendix, Ynothing).
8554 \def\donoderef#1{%
8555 \ifx\lastnode\empty\else
8556 \setref{\lastnode}{#1}%
8557 \global\let\lastnode=\empty
8561 % @anchor{NAME} -- define xref target at arbitrary point.
8563 \newcount\savesfregister
8565 \def\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi}
8566 \def\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi}
8567 \def\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces}
8569 % \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an
8570 % anchor), which consists of three parts:
8571 % 1) NAME-title - the current sectioning name taken from \lastsection,
8572 % or the anchor name.
8573 % 2) NAME-snt - section number and type, passed as the SNT arg, or
8574 % empty for anchors.
8575 % 3) NAME-pg - the page number.
8577 % This is called from \donoderef, \anchor, and \dofloat. In the case of
8578 % floats, there is an additional part, which is not written here:
8579 % 4) NAME-lof - the text as it should appear in a @listoffloats.
8581 \def\setref#1#2{%
8582 \pdfmkdest{#1}%
8583 \iflinks
8585 \requireauxfile
8586 \atdummies % preserve commands, but don't expand them
8587 \edef\writexrdef##1##2{%
8588 \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef
8589 ##1}{##2}}% these are parameters of \writexrdef
8591 \toks0 = \expandafter{\lastsection}%
8592 \immediate \writexrdef{title}{\the\toks0 }%
8593 \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc.
8594 \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, at \shipout
8599 % @xrefautosectiontitle on|off says whether @section(ing) names are used
8600 % automatically in xrefs, if the third arg is not explicitly specified.
8601 % This was provided as a "secret" @set xref-automatic-section-title
8602 % variable, now it's official.
8604 \parseargdef\xrefautomaticsectiontitle{%
8605 \def\temp{#1}%
8606 \ifx\temp\onword
8607 \expandafter\let\csname SETxref-automatic-section-title\endcsname
8608 = \empty
8609 \else\ifx\temp\offword
8610 \expandafter\let\csname SETxref-automatic-section-title\endcsname
8611 = \relax
8612 \else
8613 \errhelp = \EMsimple
8614 \errmessage{Unknown @xrefautomaticsectiontitle value `\temp',
8615 must be on|off}%
8616 \fi\fi
8619 % \f
8620 % @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is
8621 % the node name, #2 the name of the Info cross-reference, #3 the printed
8622 % node name, #4 the name of the Info file, #5 the name of the printed
8623 % manual. All but the node name can be omitted.
8625 \def\pxref{\putwordsee{} \xrefXX}
8626 \def\xref{\putwordSee{} \xrefXX}
8627 \def\ref{\xrefXX}
8629 \def\xrefXX#1{\def\xrefXXarg{#1}\futurelet\tokenafterxref\xrefXXX}
8630 \def\xrefXXX{\expandafter\xrefX\expandafter[\xrefXXarg,,,,,,,]}
8632 \newbox\toprefbox
8633 \newbox\printedrefnamebox
8634 \newbox\infofilenamebox
8635 \newbox\printedmanualbox
8637 \def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
8638 \unsepspaces
8640 % Get args without leading/trailing spaces.
8641 \def\printedrefname{\ignorespaces #3}%
8642 \setbox\printedrefnamebox = \hbox{\printedrefname\unskip}%
8644 \def\infofilename{\ignorespaces #4}%
8645 \setbox\infofilenamebox = \hbox{\infofilename\unskip}%
8647 \def\printedmanual{\ignorespaces #5}%
8648 \setbox\printedmanualbox = \hbox{\printedmanual\unskip}%
8650 % If the printed reference name (arg #3) was not explicitly given in
8651 % the @xref, figure out what we want to use.
8652 \ifdim \wd\printedrefnamebox = 0pt
8653 % No printed node name was explicitly given.
8654 \expandafter\ifx\csname SETxref-automatic-section-title\endcsname \relax
8655 % Not auto section-title: use node name inside the square brackets.
8656 \def\printedrefname{\ignorespaces #1}%
8657 \else
8658 % Auto section-title: use chapter/section title inside
8659 % the square brackets if we have it.
8660 \ifdim \wd\printedmanualbox > 0pt
8661 % It is in another manual, so we don't have it; use node name.
8662 \def\printedrefname{\ignorespaces #1}%
8663 \else
8664 \ifhavexrefs
8665 % We (should) know the real title if we have the xref values.
8666 \def\printedrefname{\refx{#1-title}{}}%
8667 \else
8668 % Otherwise just copy the Info node name.
8669 \def\printedrefname{\ignorespaces #1}%
8670 \fi%
8675 % Make link in pdf output.
8676 \ifpdf
8677 {\indexnofonts
8678 \turnoffactive
8679 \makevalueexpandable
8680 % This expands tokens, so do it after making catcode changes, so _
8681 % etc. don't get their TeX definitions. This ignores all spaces in
8682 % #4, including (wrongly) those in the middle of the filename.
8683 \getfilename{#4}%
8685 % This (wrongly) does not take account of leading or trailing
8686 % spaces in #1, which should be ignored.
8687 \edef\pdfxrefdest{#1}%
8688 \ifx\pdfxrefdest\empty
8689 \def\pdfxrefdest{Top}% no empty targets
8690 \else
8691 \txiescapepdf\pdfxrefdest % escape PDF special chars
8694 \leavevmode
8695 \startlink attr{/Border [0 0 0]}%
8696 \ifnum\filenamelength>0
8697 goto file{\the\filename.pdf} name{\pdfxrefdest}%
8698 \else
8699 goto name{\pdfmkpgn{\pdfxrefdest}}%
8702 \setcolor{\linkcolor}%
8705 % Have to otherify everything special to allow the \csname to
8706 % include an _ in the xref name, etc.
8707 \indexnofonts
8708 \turnoffactive
8709 \expandafter\global\expandafter\let\expandafter\Xthisreftitle
8710 \csname XR#1-title\endcsname
8713 % Float references are printed completely differently: "Figure 1.2"
8714 % instead of "[somenode], p.3". \iffloat distinguishes them by
8715 % \Xthisreftitle being set to a magic string.
8716 \iffloat\Xthisreftitle
8717 % If the user specified the print name (third arg) to the ref,
8718 % print it instead of our usual "Figure 1.2".
8719 \ifdim\wd\printedrefnamebox = 0pt
8720 \refx{#1-snt}{}%
8721 \else
8722 \printedrefname
8725 % If the user also gave the printed manual name (fifth arg), append
8726 % "in MANUALNAME".
8727 \ifdim \wd\printedmanualbox > 0pt
8728 \space \putwordin{} \cite{\printedmanual}%
8730 \else
8731 % node/anchor (non-float) references.
8733 % If we use \unhbox to print the node names, TeX does not insert
8734 % empty discretionaries after hyphens, which means that it will not
8735 % find a line break at a hyphen in a node names. Since some manuals
8736 % are best written with fairly long node names, containing hyphens,
8737 % this is a loss. Therefore, we give the text of the node name
8738 % again, so it is as if TeX is seeing it for the first time.
8740 \ifdim \wd\printedmanualbox > 0pt
8741 % Cross-manual reference with a printed manual name.
8743 \crossmanualxref{\cite{\printedmanual\unskip}}%
8745 \else\ifdim \wd\infofilenamebox > 0pt
8746 % Cross-manual reference with only an info filename (arg 4), no
8747 % printed manual name (arg 5). This is essentially the same as
8748 % the case above; we output the filename, since we have nothing else.
8750 \crossmanualxref{\code{\infofilename\unskip}}%
8752 \else
8753 % Reference within this manual.
8755 % _ (for example) has to be the character _ for the purposes of the
8756 % control sequence corresponding to the node, but it has to expand
8757 % into the usual \leavevmode...\vrule stuff for purposes of
8758 % printing. So we \turnoffactive for the \refx-snt, back on for the
8759 % printing, back off for the \refx-pg.
8760 {\turnoffactive
8761 % Only output a following space if the -snt ref is nonempty; for
8762 % @unnumbered and @anchor, it won't be.
8763 \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}%
8764 \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
8766 % output the `[mynode]' via the macro below so it can be overridden.
8767 \xrefprintnodename\printedrefname
8769 % But we always want a comma and a space:
8770 ,\space
8772 % output the `page 3'.
8773 \turnoffactive \putwordpage\tie\refx{#1-pg}{}%
8774 % Add a , if xref followed by a space
8775 \if\space\noexpand\tokenafterxref ,%
8776 \else\ifx\ \tokenafterxref ,% @TAB
8777 \else\ifx\*\tokenafterxref ,% @*
8778 \else\ifx\ \tokenafterxref ,% @SPACE
8779 \else\ifx\
8780 \tokenafterxref ,% @NL
8781 \else\ifx\tie\tokenafterxref ,% @tie
8782 \fi\fi\fi\fi\fi\fi
8783 \fi\fi
8785 \endlink
8786 \endgroup}
8788 % Output a cross-manual xref to #1. Used just above (twice).
8790 % Only include the text "Section ``foo'' in" if the foo is neither
8791 % missing or Top. Thus, @xref{,,,foo,The Foo Manual} outputs simply
8792 % "see The Foo Manual", the idea being to refer to the whole manual.
8794 % But, this being TeX, we can't easily compare our node name against the
8795 % string "Top" while ignoring the possible spaces before and after in
8796 % the input. By adding the arbitrary 7sp below, we make it much less
8797 % likely that a real node name would have the same width as "Top" (e.g.,
8798 % in a monospaced font). Hopefully it will never happen in practice.
8800 % For the same basic reason, we retypeset the "Top" at every
8801 % reference, since the current font is indeterminate.
8803 \def\crossmanualxref#1{%
8804 \setbox\toprefbox = \hbox{Top\kern7sp}%
8805 \setbox2 = \hbox{\ignorespaces \printedrefname \unskip \kern7sp}%
8806 \ifdim \wd2 > 7sp % nonempty?
8807 \ifdim \wd2 = \wd\toprefbox \else % same as Top?
8808 \putwordSection{} ``\printedrefname'' \putwordin{}\space
8814 % This macro is called from \xrefX for the `[nodename]' part of xref
8815 % output. It's a separate macro only so it can be changed more easily,
8816 % since square brackets don't work well in some documents. Particularly
8817 % one that Bob is working on :).
8819 \def\xrefprintnodename#1{[#1]}
8821 % Things referred to by \setref.
8823 \def\Ynothing{}
8824 \def\Yomitfromtoc{}
8825 \def\Ynumbered{%
8826 \ifnum\secno=0
8827 \putwordChapter@tie \the\chapno
8828 \else \ifnum\subsecno=0
8829 \putwordSection@tie \the\chapno.\the\secno
8830 \else \ifnum\subsubsecno=0
8831 \putwordSection@tie \the\chapno.\the\secno.\the\subsecno
8832 \else
8833 \putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno
8834 \fi\fi\fi
8836 \def\Yappendix{%
8837 \ifnum\secno=0
8838 \putwordAppendix@tie @char\the\appendixno{}%
8839 \else \ifnum\subsecno=0
8840 \putwordSection@tie @char\the\appendixno.\the\secno
8841 \else \ifnum\subsubsecno=0
8842 \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno
8843 \else
8844 \putwordSection@tie
8845 @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno
8846 \fi\fi\fi
8849 % Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
8850 % If its value is nonempty, SUFFIX is output afterward.
8852 \def\refx#1#2{%
8853 \requireauxfile
8855 \indexnofonts
8856 \otherbackslash
8857 \expandafter\global\expandafter\let\expandafter\thisrefX
8858 \csname XR#1\endcsname
8860 \ifx\thisrefX\relax
8861 % If not defined, say something at least.
8862 \angleleft un\-de\-fined\angleright
8863 \iflinks
8864 \ifhavexrefs
8865 {\toks0 = {#1}% avoid expansion of possibly-complex value
8866 \message{\linenumber Undefined cross reference `\the\toks0'.}}%
8867 \else
8868 \ifwarnedxrefs\else
8869 \global\warnedxrefstrue
8870 \message{Cross reference values unknown; you must run TeX again.}%
8874 \else
8875 % It's defined, so just use it.
8876 \thisrefX
8878 #2% Output the suffix in any case.
8881 % This is the macro invoked by entries in the aux file. Usually it's
8882 % just a \def (we prepend XR to the control sequence name to avoid
8883 % collisions). But if this is a float type, we have more work to do.
8885 \def\xrdef#1#2{%
8886 {% The node name might contain 8-bit characters, which in our current
8887 % implementation are changed to commands like @'e. Don't let these
8888 % mess up the control sequence name.
8889 \indexnofonts
8890 \turnoffactive
8891 \xdef\safexrefname{#1}%
8894 \expandafter\gdef\csname XR\safexrefname\endcsname{#2}% remember this xref
8896 % Was that xref control sequence that we just defined for a float?
8897 \expandafter\iffloat\csname XR\safexrefname\endcsname
8898 % it was a float, and we have the (safe) float type in \iffloattype.
8899 \expandafter\let\expandafter\floatlist
8900 \csname floatlist\iffloattype\endcsname
8902 % Is this the first time we've seen this float type?
8903 \expandafter\ifx\floatlist\relax
8904 \toks0 = {\do}% yes, so just \do
8905 \else
8906 % had it before, so preserve previous elements in list.
8907 \toks0 = \expandafter{\floatlist\do}%
8910 % Remember this xref in the control sequence \floatlistFLOATTYPE,
8911 % for later use in \listoffloats.
8912 \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0
8913 {\safexrefname}}%
8917 % If working on a large document in chapters, it is convenient to
8918 % be able to disable indexing, cross-referencing, and contents, for test runs.
8919 % This is done with @novalidate at the beginning of the file.
8921 \newif\iflinks \linkstrue % by default we want the aux files.
8922 \let\novalidate = \linksfalse
8924 % Used when writing to the aux file, or when using data from it.
8925 \def\requireauxfile{%
8926 \iflinks
8927 \tryauxfile
8928 % Open the new aux file. TeX will close it automatically at exit.
8929 \immediate\openout\auxfile=\jobname.aux
8931 \global\let\requireauxfile=\relax % Only do this once.
8934 % Read the last existing aux file, if any. No error if none exists.
8936 \def\tryauxfile{%
8937 \openin 1 \jobname.aux
8938 \ifeof 1 \else
8939 \readdatafile{aux}%
8940 \global\havexrefstrue
8942 \closein 1
8945 \def\setupdatafile{%
8946 \catcode`\^^@=\other
8947 \catcode`\^^A=\other
8948 \catcode`\^^B=\other
8949 \catcode`\^^C=\other
8950 \catcode`\^^D=\other
8951 \catcode`\^^E=\other
8952 \catcode`\^^F=\other
8953 \catcode`\^^G=\other
8954 \catcode`\^^H=\other
8955 \catcode`\^^K=\other
8956 \catcode`\^^L=\other
8957 \catcode`\^^N=\other
8958 \catcode`\^^P=\other
8959 \catcode`\^^Q=\other
8960 \catcode`\^^R=\other
8961 \catcode`\^^S=\other
8962 \catcode`\^^T=\other
8963 \catcode`\^^U=\other
8964 \catcode`\^^V=\other
8965 \catcode`\^^W=\other
8966 \catcode`\^^X=\other
8967 \catcode`\^^Z=\other
8968 \catcode`\^^[=\other
8969 \catcode`\^^\=\other
8970 \catcode`\^^]=\other
8971 \catcode`\^^^=\other
8972 \catcode`\^^_=\other
8973 % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc.
8974 % in xref tags, i.e., node names. But since ^^e4 notation isn't
8975 % supported in the main text, it doesn't seem desirable. Furthermore,
8976 % that is not enough: for node names that actually contain a ^
8977 % character, we would end up writing a line like this: 'xrdef {'hat
8978 % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first
8979 % argument, and \hat is not an expandable control sequence. It could
8980 % all be worked out, but why? Either we support ^^ or we don't.
8982 % The other change necessary for this was to define \auxhat:
8983 % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter
8984 % and then to call \auxhat in \setq.
8986 \catcode`\^=\other
8988 % Special characters. Should be turned off anyway, but...
8989 \catcode`\~=\other
8990 \catcode`\[=\other
8991 \catcode`\]=\other
8992 \catcode`\"=\other
8993 \catcode`\_=\other
8994 \catcode`\|=\other
8995 \catcode`\<=\other
8996 \catcode`\>=\other
8997 \catcode`\$=\other
8998 \catcode`\#=\other
8999 \catcode`\&=\other
9000 \catcode`\%=\other
9001 \catcode`+=\other % avoid \+ for paranoia even though we've turned it off
9003 % This is to support \ in node names and titles, since the \
9004 % characters end up in a \csname. It's easier than
9005 % leaving it active and making its active definition an actual \
9006 % character. What I don't understand is why it works in the *value*
9007 % of the xrdef. Seems like it should be a catcode12 \, and that
9008 % should not typeset properly. But it works, so I'm moving on for
9009 % now. --karl, 15jan04.
9010 \catcode`\\=\other
9012 % Make the characters 128-255 be printing characters.
9013 {\setcharscatcodeothernonglobal}%
9015 % @ is our escape character in .aux files, and we need braces.
9016 \catcode`\{=1
9017 \catcode`\}=2
9018 \catcode`\@=0
9021 \def\readdatafile#1{%
9022 \begingroup
9023 \setupdatafile
9024 \input\jobname.#1
9025 \endgroup}
9028 \message{insertions,}
9029 % including footnotes.
9031 \newcount \footnoteno
9033 % The trailing space in the following definition for supereject is
9034 % vital for proper filling; pages come out unaligned when you do a
9035 % pagealignmacro call if that space before the closing brace is
9036 % removed. (Generally, numeric constants should always be followed by a
9037 % space to prevent strange expansion errors.)
9038 \def\supereject{\par\penalty -20000\footnoteno =0 }
9040 % @footnotestyle is meaningful for Info output only.
9041 \let\footnotestyle=\comment
9043 {\catcode `\@=11
9045 % Auto-number footnotes. Otherwise like plain.
9046 \gdef\footnote{%
9047 \global\advance\footnoteno by \@ne
9048 \edef\thisfootno{$^{\the\footnoteno}$}%
9050 % In case the footnote comes at the end of a sentence, preserve the
9051 % extra spacing after we do the footnote number.
9052 \let\@sf\empty
9053 \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi
9055 % Remove inadvertent blank space before typesetting the footnote number.
9056 \unskip
9057 \thisfootno\@sf
9058 \dofootnote
9061 % Don't bother with the trickery in plain.tex to not require the
9062 % footnote text as a parameter. Our footnotes don't need to be so general.
9064 % Oh yes, they do; otherwise, @ifset (and anything else that uses
9065 % \parseargline) fails inside footnotes because the tokens are fixed when
9066 % the footnote is read. --karl, 16nov96.
9068 \gdef\dofootnote{%
9069 \insert\footins\bgroup
9071 % Nested footnotes are not supported in TeX, that would take a lot
9072 % more work. (\startsavinginserts does not suffice.)
9073 \let\footnote=\errfootnotenest
9075 % We want to typeset this text as a normal paragraph, even if the
9076 % footnote reference occurs in (for example) a display environment.
9077 % So reset some parameters.
9078 \hsize=\txipagewidth
9079 \interlinepenalty\interfootnotelinepenalty
9080 \splittopskip\ht\strutbox % top baseline for broken footnotes
9081 \splitmaxdepth\dp\strutbox
9082 \floatingpenalty\@MM
9083 \leftskip\z@skip
9084 \rightskip\z@skip
9085 \spaceskip\z@skip
9086 \xspaceskip\z@skip
9087 \parindent\defaultparindent
9089 \smallfonts \rm
9091 % Because we use hanging indentation in footnotes, a @noindent appears
9092 % to exdent this text, so make it be a no-op. makeinfo does not use
9093 % hanging indentation so @noindent can still be needed within footnote
9094 % text after an @example or the like (not that this is good style).
9095 \let\noindent = \relax
9097 % Hang the footnote text off the number. Use \everypar in case the
9098 % footnote extends for more than one paragraph.
9099 \everypar = {\hang}%
9100 \textindent{\thisfootno}%
9102 % Don't crash into the line above the footnote text. Since this
9103 % expands into a box, it must come within the paragraph, lest it
9104 % provide a place where TeX can split the footnote.
9105 \footstrut
9107 % Invoke rest of plain TeX footnote routine.
9108 \futurelet\next\fo@t
9110 }%end \catcode `\@=11
9112 \def\errfootnotenest{%
9113 \errhelp=\EMsimple
9114 \errmessage{Nested footnotes not supported in texinfo.tex,
9115 even though they work in makeinfo; sorry}
9118 \def\errfootnoteheading{%
9119 \errhelp=\EMsimple
9120 \errmessage{Footnotes in chapters, sections, etc., are not supported}
9123 % In case a @footnote appears in a vbox, save the footnote text and create
9124 % the real \insert just after the vbox finished. Otherwise, the insertion
9125 % would be lost.
9126 % Similarly, if a @footnote appears inside an alignment, save the footnote
9127 % text to a box and make the \insert when a row of the table is finished.
9128 % And the same can be done for other insert classes. --kasal, 16nov03.
9130 % Replace the \insert primitive by a cheating macro.
9131 % Deeper inside, just make sure that the saved insertions are not spilled
9132 % out prematurely.
9134 \def\startsavinginserts{%
9135 \ifx \insert\ptexinsert
9136 \let\insert\saveinsert
9137 \else
9138 \let\checkinserts\relax
9142 % This \insert replacement works for both \insert\footins{foo} and
9143 % \insert\footins\bgroup foo\egroup, but it doesn't work for \insert27{foo}.
9145 \def\saveinsert#1{%
9146 \edef\next{\noexpand\savetobox \makeSAVEname#1}%
9147 \afterassignment\next
9148 % swallow the left brace
9149 \let\temp =
9151 \def\makeSAVEname#1{\makecsname{SAVE\expandafter\gobble\string#1}}
9152 \def\savetobox#1{\global\setbox#1 = \vbox\bgroup \unvbox#1}
9154 \def\checksaveins#1{\ifvoid#1\else \placesaveins#1\fi}
9156 \def\placesaveins#1{%
9157 \ptexinsert \csname\expandafter\gobblesave\string#1\endcsname
9158 {\box#1}%
9161 % eat @SAVE -- beware, all of them have catcode \other:
9163 \def\dospecials{\do S\do A\do V\do E} \uncatcodespecials % ;-)
9164 \gdef\gobblesave @SAVE{}
9167 % initialization:
9168 \def\newsaveins #1{%
9169 \edef\next{\noexpand\newsaveinsX \makeSAVEname#1}%
9170 \next
9172 \def\newsaveinsX #1{%
9173 \csname newbox\endcsname #1%
9174 \expandafter\def\expandafter\checkinserts\expandafter{\checkinserts
9175 \checksaveins #1}%
9178 % initialize:
9179 \let\checkinserts\empty
9180 \newsaveins\footins
9181 \newsaveins\margin
9184 % @image. We use the macros from epsf.tex to support this.
9185 % If epsf.tex is not installed and @image is used, we complain.
9187 % Check for and read epsf.tex up front. If we read it only at @image
9188 % time, we might be inside a group, and then its definitions would get
9189 % undone and the next image would fail.
9190 \openin 1 = epsf.tex
9191 \ifeof 1 \else
9192 % Do not bother showing banner with epsf.tex v2.7k (available in
9193 % doc/epsf.tex and on ctan).
9194 \def\epsfannounce{\toks0 = }%
9195 \input epsf.tex
9197 \closein 1
9199 % We will only complain once about lack of epsf.tex.
9200 \newif\ifwarnednoepsf
9201 \newhelp\noepsfhelp{epsf.tex must be installed for images to
9202 work. It is also included in the Texinfo distribution, or you can get
9203 it from ftp://tug.org/tex/epsf.tex.}
9205 \def\image#1{%
9206 \ifx\epsfbox\thisisundefined
9207 \ifwarnednoepsf \else
9208 \errhelp = \noepsfhelp
9209 \errmessage{epsf.tex not found, images will be ignored}%
9210 \global\warnednoepsftrue
9212 \else
9213 \imagexxx #1,,,,,\finish
9217 % Arguments to @image:
9218 % #1 is (mandatory) image filename; we tack on .eps extension.
9219 % #2 is (optional) width, #3 is (optional) height.
9220 % #4 is (ignored optional) html alt text.
9221 % #5 is (ignored optional) extension.
9222 % #6 is just the usual extra ignored arg for parsing stuff.
9223 \newif\ifimagevmode
9224 \def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup
9225 \catcode`\^^M = 5 % in case we're inside an example
9226 \normalturnoffactive % allow _ et al. in names
9227 \def\xprocessmacroarg{\eatspaces}% in case we are being used via a macro
9228 % If the image is by itself, center it.
9229 \ifvmode
9230 \imagevmodetrue
9231 \else \ifx\centersub\centerV
9232 % for @center @image, we need a vbox so we can have our vertical space
9233 \imagevmodetrue
9234 \vbox\bgroup % vbox has better behavior than vtop herev
9235 \fi\fi
9237 \ifimagevmode
9238 \nobreak\medskip
9239 % Usually we'll have text after the image which will insert
9240 % \parskip glue, so insert it here too to equalize the space
9241 % above and below.
9242 \nobreak\vskip\parskip
9243 \nobreak
9246 % Leave vertical mode so that indentation from an enclosing
9247 % environment such as @quotation is respected.
9248 % However, if we're at the top level, we don't want the
9249 % normal paragraph indentation.
9250 % On the other hand, if we are in the case of @center @image, we don't
9251 % want to start a paragraph, which will create a hsize-width box and
9252 % eradicate the centering.
9253 \ifx\centersub\centerV\else \noindent \fi
9255 % Output the image.
9256 \ifpdf
9257 % For pdfTeX and LuaTeX <= 0.80
9258 \dopdfimage{#1}{#2}{#3}%
9259 \else
9260 \ifx\XeTeXrevision\thisisundefined
9261 % For epsf.tex
9262 % \epsfbox itself resets \epsf?size at each figure.
9263 \setbox0 = \hbox{\ignorespaces #2}%
9264 \ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
9265 \setbox0 = \hbox{\ignorespaces #3}%
9266 \ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
9267 \epsfbox{#1.eps}%
9268 \else
9269 % For XeTeX
9270 \doxeteximage{#1}{#2}{#3}%
9274 \ifimagevmode
9275 \medskip % space after a standalone image
9276 \fi
9277 \ifx\centersub\centerV \egroup \fi
9278 \endgroup}
9281 % @float FLOATTYPE,LABEL,LOC ... @end float for displayed figures, tables,
9282 % etc. We don't actually implement floating yet, we always include the
9283 % float "here". But it seemed the best name for the future.
9285 \envparseargdef\float{\eatcommaspace\eatcommaspace\dofloat#1, , ,\finish}
9287 % There may be a space before second and/or third parameter; delete it.
9288 \def\eatcommaspace#1, {#1,}
9290 % #1 is the optional FLOATTYPE, the text label for this float, typically
9291 % "Figure", "Table", "Example", etc. Can't contain commas. If omitted,
9292 % this float will not be numbered and cannot be referred to.
9294 % #2 is the optional xref label. Also must be present for the float to
9295 % be referable.
9297 % #3 is the optional positioning argument; for now, it is ignored. It
9298 % will somehow specify the positions allowed to float to (here, top, bottom).
9300 % We keep a separate counter for each FLOATTYPE, which we reset at each
9301 % chapter-level command.
9302 \let\resetallfloatnos=\empty
9304 \def\dofloat#1,#2,#3,#4\finish{%
9305 \let\thiscaption=\empty
9306 \let\thisshortcaption=\empty
9308 % don't lose footnotes inside @float.
9310 % BEWARE: when the floats start float, we have to issue warning whenever an
9311 % insert appears inside a float which could possibly float. --kasal, 26may04
9313 \startsavinginserts
9315 % We can't be used inside a paragraph.
9316 \par
9318 \vtop\bgroup
9319 \def\floattype{#1}%
9320 \def\floatlabel{#2}%
9321 \def\floatloc{#3}% we do nothing with this yet.
9323 \ifx\floattype\empty
9324 \let\safefloattype=\empty
9325 \else
9327 % the floattype might have accents or other special characters,
9328 % but we need to use it in a control sequence name.
9329 \indexnofonts
9330 \turnoffactive
9331 \xdef\safefloattype{\floattype}%
9335 % If label is given but no type, we handle that as the empty type.
9336 \ifx\floatlabel\empty \else
9337 % We want each FLOATTYPE to be numbered separately (Figure 1,
9338 % Table 1, Figure 2, ...). (And if no label, no number.)
9340 \expandafter\getfloatno\csname\safefloattype floatno\endcsname
9341 \global\advance\floatno by 1
9344 % This magic value for \lastsection is output by \setref as the
9345 % XREFLABEL-title value. \xrefX uses it to distinguish float
9346 % labels (which have a completely different output format) from
9347 % node and anchor labels. And \xrdef uses it to construct the
9348 % lists of floats.
9350 \edef\lastsection{\floatmagic=\safefloattype}%
9351 \setref{\floatlabel}{Yfloat}%
9355 % start with \parskip glue, I guess.
9356 \vskip\parskip
9358 % Don't suppress indentation if a float happens to start a section.
9359 \restorefirstparagraphindent
9362 % we have these possibilities:
9363 % @float Foo,lbl & @caption{Cap}: Foo 1.1: Cap
9364 % @float Foo,lbl & no caption: Foo 1.1
9365 % @float Foo & @caption{Cap}: Foo: Cap
9366 % @float Foo & no caption: Foo
9367 % @float ,lbl & Caption{Cap}: 1.1: Cap
9368 % @float ,lbl & no caption: 1.1
9369 % @float & @caption{Cap}: Cap
9370 % @float & no caption:
9372 \def\Efloat{%
9373 \let\floatident = \empty
9375 % In all cases, if we have a float type, it comes first.
9376 \ifx\floattype\empty \else \def\floatident{\floattype}\fi
9378 % If we have an xref label, the number comes next.
9379 \ifx\floatlabel\empty \else
9380 \ifx\floattype\empty \else % if also had float type, need tie first.
9381 \appendtomacro\floatident{\tie}%
9383 % the number.
9384 \appendtomacro\floatident{\chaplevelprefix\the\floatno}%
9387 % Start the printed caption with what we've constructed in
9388 % \floatident, but keep it separate; we need \floatident again.
9389 \let\captionline = \floatident
9391 \ifx\thiscaption\empty \else
9392 \ifx\floatident\empty \else
9393 \appendtomacro\captionline{: }% had ident, so need a colon between
9396 % caption text.
9397 \appendtomacro\captionline{\scanexp\thiscaption}%
9400 % If we have anything to print, print it, with space before.
9401 % Eventually this needs to become an \insert.
9402 \ifx\captionline\empty \else
9403 \vskip.5\parskip
9404 \captionline
9406 % Space below caption.
9407 \vskip\parskip
9410 % If have an xref label, write the list of floats info. Do this
9411 % after the caption, to avoid chance of it being a breakpoint.
9412 \ifx\floatlabel\empty \else
9413 % Write the text that goes in the lof to the aux file as
9414 % \floatlabel-lof. Besides \floatident, we include the short
9415 % caption if specified, else the full caption if specified, else nothing.
9417 \requireauxfile
9418 \atdummies
9420 % since we read the caption text in the macro world, where ^^M
9421 % is turned into a normal character, we have to scan it back, so
9422 % we don't write the literal three characters "^^M" into the aux file.
9423 \scanexp{%
9424 \xdef\noexpand\gtemp{%
9425 \ifx\thisshortcaption\empty
9426 \thiscaption
9427 \else
9428 \thisshortcaption
9432 \immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident
9433 \ifx\gtemp\empty \else : \gtemp \fi}}%
9436 \egroup % end of \vtop
9438 % place the captured inserts
9440 % BEWARE: when the floats start floating, we have to issue warning
9441 % whenever an insert appears inside a float which could possibly
9442 % float. --kasal, 26may04
9444 \checkinserts
9447 % Append the tokens #2 to the definition of macro #1, not expanding either.
9449 \def\appendtomacro#1#2{%
9450 \expandafter\def\expandafter#1\expandafter{#1#2}%
9453 % @caption, @shortcaption
9455 \def\caption{\docaption\thiscaption}
9456 \def\shortcaption{\docaption\thisshortcaption}
9457 \def\docaption{\checkenv\float \bgroup\scanargctxt\defcaption}
9458 \def\defcaption#1#2{\egroup \def#1{#2}}
9460 % The parameter is the control sequence identifying the counter we are
9461 % going to use. Create it if it doesn't exist and assign it to \floatno.
9462 \def\getfloatno#1{%
9463 \ifx#1\relax
9464 % Haven't seen this figure type before.
9465 \csname newcount\endcsname #1%
9467 % Remember to reset this floatno at the next chap.
9468 \expandafter\gdef\expandafter\resetallfloatnos
9469 \expandafter{\resetallfloatnos #1=0 }%
9471 \let\floatno#1%
9474 % \setref calls this to get the XREFLABEL-snt value. We want an @xref
9475 % to the FLOATLABEL to expand to "Figure 3.1". We call \setref when we
9476 % first read the @float command.
9478 \def\Yfloat{\floattype@tie \chaplevelprefix\the\floatno}%
9480 % Magic string used for the XREFLABEL-title value, so \xrefX can
9481 % distinguish floats from other xref types.
9482 \def\floatmagic{!!float!!}
9484 % #1 is the control sequence we are passed; we expand into a conditional
9485 % which is true if #1 represents a float ref. That is, the magic
9486 % \lastsection value which we \setref above.
9488 \def\iffloat#1{\expandafter\doiffloat#1==\finish}
9490 % #1 is (maybe) the \floatmagic string. If so, #2 will be the
9491 % (safe) float type for this float. We set \iffloattype to #2.
9493 \def\doiffloat#1=#2=#3\finish{%
9494 \def\temp{#1}%
9495 \def\iffloattype{#2}%
9496 \ifx\temp\floatmagic
9499 % @listoffloats FLOATTYPE - print a list of floats like a table of contents.
9501 \parseargdef\listoffloats{%
9502 \def\floattype{#1}% floattype
9504 % the floattype might have accents or other special characters,
9505 % but we need to use it in a control sequence name.
9506 \indexnofonts
9507 \turnoffactive
9508 \xdef\safefloattype{\floattype}%
9511 % \xrdef saves the floats as a \do-list in \floatlistSAFEFLOATTYPE.
9512 \expandafter\ifx\csname floatlist\safefloattype\endcsname \relax
9513 \ifhavexrefs
9514 % if the user said @listoffloats foo but never @float foo.
9515 \message{\linenumber No `\safefloattype' floats to list.}%
9517 \else
9518 \begingroup
9519 \leftskip=\tocindent % indent these entries like a toc
9520 \let\do=\listoffloatsdo
9521 \csname floatlist\safefloattype\endcsname
9522 \endgroup
9526 % This is called on each entry in a list of floats. We're passed the
9527 % xref label, in the form LABEL-title, which is how we save it in the
9528 % aux file. We strip off the -title and look up \XRLABEL-lof, which
9529 % has the text we're supposed to typeset here.
9531 % Figures without xref labels will not be included in the list (since
9532 % they won't appear in the aux file).
9534 \def\listoffloatsdo#1{\listoffloatsdoentry#1\finish}
9535 \def\listoffloatsdoentry#1-title\finish{{%
9536 % Can't fully expand XR#1-lof because it can contain anything. Just
9537 % pass the control sequence. On the other hand, XR#1-pg is just the
9538 % page number, and we want to fully expand that so we can get a link
9539 % in pdf output.
9540 \toksA = \expandafter{\csname XR#1-lof\endcsname}%
9542 % use the same \entry macro we use to generate the TOC and index.
9543 \edef\writeentry{\noexpand\entry{\the\toksA}{\csname XR#1-pg\endcsname}}%
9544 \writeentry
9548 \message{localization,}
9550 % For single-language documents, @documentlanguage is usually given very
9551 % early, just after @documentencoding. Single argument is the language
9552 % (de) or locale (de_DE) abbreviation.
9555 \catcode`\_ = \active
9556 \globaldefs=1
9557 \parseargdef\documentlanguage{%
9558 \tex % read txi-??.tex file in plain TeX.
9559 % Read the file by the name they passed if it exists.
9560 \let_ = \normalunderscore % normal _ character for filename test
9561 \openin 1 txi-#1.tex
9562 \ifeof 1
9563 \documentlanguagetrywithoutunderscore #1_\finish
9564 \else
9565 \globaldefs = 1 % everything in the txi-LL files needs to persist
9566 \input txi-#1.tex
9568 \closein 1
9569 \endgroup % end raw TeX
9572 % If they passed de_DE, and txi-de_DE.tex doesn't exist,
9573 % try txi-de.tex.
9575 \gdef\documentlanguagetrywithoutunderscore#1_#2\finish{%
9576 \openin 1 txi-#1.tex
9577 \ifeof 1
9578 \errhelp = \nolanghelp
9579 \errmessage{Cannot read language file txi-#1.tex}%
9580 \else
9581 \globaldefs = 1 % everything in the txi-LL files needs to persist
9582 \input txi-#1.tex
9584 \closein 1
9586 }% end of special _ catcode
9588 \newhelp\nolanghelp{The given language definition file cannot be found or
9589 is empty. Maybe you need to install it? Putting it in the current
9590 directory should work if nowhere else does.}
9592 % This macro is called from txi-??.tex files; the first argument is the
9593 % \language name to set (without the "\lang@" prefix), the second and
9594 % third args are \{left,right}hyphenmin.
9596 % The language names to pass are determined when the format is built.
9597 % See the etex.log file created at that time, e.g.,
9598 % /usr/local/texlive/2008/texmf-var/web2c/pdftex/etex.log.
9600 % With TeX Live 2008, etex now includes hyphenation patterns for all
9601 % available languages. This means we can support hyphenation in
9602 % Texinfo, at least to some extent. (This still doesn't solve the
9603 % accented characters problem.)
9605 \catcode`@=11
9606 \def\txisetlanguage#1#2#3{%
9607 % do not set the language if the name is undefined in the current TeX.
9608 \expandafter\ifx\csname lang@#1\endcsname \relax
9609 \message{no patterns for #1}%
9610 \else
9611 \global\language = \csname lang@#1\endcsname
9613 % but there is no harm in adjusting the hyphenmin values regardless.
9614 \global\lefthyphenmin = #2\relax
9615 \global\righthyphenmin = #3\relax
9618 % XeTeX and LuaTeX can handle native Unicode.
9619 % Their default I/O is UTF-8 sequence instead of byte-wise.
9620 % Other TeX engine (pdfTeX etc.) I/O is byte-wise.
9622 \newif\iftxinativeunicodecapable
9623 \newif\iftxiusebytewiseio
9625 \ifx\XeTeXrevision\thisisundefined
9626 \ifx\luatexversion\thisisundefined
9627 \txinativeunicodecapablefalse
9628 \txiusebytewiseiotrue
9629 \else
9630 \txinativeunicodecapabletrue
9631 \txiusebytewiseiofalse
9633 \else
9634 \txinativeunicodecapabletrue
9635 \txiusebytewiseiofalse
9638 % Set I/O by bytes instead of UTF-8 sequence for XeTeX and LuaTex
9639 % for non-UTF-8 (byte-wise) encodings.
9641 \def\setbytewiseio{%
9642 \ifx\XeTeXrevision\thisisundefined
9643 \else
9644 \XeTeXdefaultencoding "bytes" % For subsequent files to be read
9645 \XeTeXinputencoding "bytes" % For document root file
9646 % Unfortunately, there seems to be no corresponding XeTeX command for
9647 % output encoding. This is a problem for auxiliary index and TOC files.
9648 % The only solution would be perhaps to write out @U{...} sequences in
9649 % place of non-ASCII characters.
9652 \ifx\luatexversion\thisisundefined
9653 \else
9654 \directlua{
9655 local utf8_char, byte, gsub = unicode.utf8.char, string.byte, string.gsub
9656 local function convert_char (char)
9657 return utf8_char(byte(char))
9660 local function convert_line (line)
9661 return gsub(line, ".", convert_char)
9664 callback.register("process_input_buffer", convert_line)
9666 local function convert_line_out (line)
9667 local line_out = ""
9668 for c in string.utfvalues(line) do
9669 line_out = line_out .. string.char(c)
9671 return line_out
9674 callback.register("process_output_buffer", convert_line_out)
9678 \txiusebytewiseiotrue
9682 % Helpers for encodings.
9683 % Set the catcode of characters 128 through 255 to the specified number.
9685 \def\setnonasciicharscatcode#1{%
9686 \count255=128
9687 \loop\ifnum\count255<256
9688 \global\catcode\count255=#1\relax
9689 \advance\count255 by 1
9690 \repeat
9693 \def\setnonasciicharscatcodenonglobal#1{%
9694 \count255=128
9695 \loop\ifnum\count255<256
9696 \catcode\count255=#1\relax
9697 \advance\count255 by 1
9698 \repeat
9701 % @documentencoding sets the definition of non-ASCII characters
9702 % according to the specified encoding.
9704 \def\documentencoding{\parseargusing\filenamecatcodes\documentencodingzzz}
9705 \def\documentencodingzzz#1{%
9707 % Encoding being declared for the document.
9708 \def\declaredencoding{\csname #1.enc\endcsname}%
9710 % Supported encodings: names converted to tokens in order to be able
9711 % to compare them with \ifx.
9712 \def\ascii{\csname US-ASCII.enc\endcsname}%
9713 \def\latnine{\csname ISO-8859-15.enc\endcsname}%
9714 \def\latone{\csname ISO-8859-1.enc\endcsname}%
9715 \def\lattwo{\csname ISO-8859-2.enc\endcsname}%
9716 \def\utfeight{\csname UTF-8.enc\endcsname}%
9718 \ifx \declaredencoding \ascii
9719 \asciichardefs
9721 \else \ifx \declaredencoding \lattwo
9722 \iftxinativeunicodecapable
9723 \setbytewiseio
9725 \setnonasciicharscatcode\active
9726 \lattwochardefs
9728 \else \ifx \declaredencoding \latone
9729 \iftxinativeunicodecapable
9730 \setbytewiseio
9732 \setnonasciicharscatcode\active
9733 \latonechardefs
9735 \else \ifx \declaredencoding \latnine
9736 \iftxinativeunicodecapable
9737 \setbytewiseio
9739 \setnonasciicharscatcode\active
9740 \latninechardefs
9742 \else \ifx \declaredencoding \utfeight
9743 \iftxinativeunicodecapable
9744 % For native Unicode (XeTeX and LuaTeX)
9745 \nativeunicodechardefs
9746 \else
9747 % For UTF-8 byte sequence (TeX, eTeX and pdfTeX)
9748 \setnonasciicharscatcode\active
9749 % since we already invoked \utfeightchardefs at the top level
9750 % (below), do not re-invoke it, then our check for duplicated
9751 % definitions triggers. Making non-ascii chars active is enough.
9754 \else
9755 \message{Ignoring unknown document encoding: #1.}%
9757 \fi % utfeight
9758 \fi % latnine
9759 \fi % latone
9760 \fi % lattwo
9761 \fi % ascii
9764 % emacs-page
9765 % A message to be logged when using a character that isn't available
9766 % the default font encoding (OT1).
9768 \def\missingcharmsg#1{\message{Character missing, sorry: #1.}}
9770 % Take account of \c (plain) vs. \, (Texinfo) difference.
9771 \def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi}
9773 % First, make active non-ASCII characters in order for them to be
9774 % correctly categorized when TeX reads the replacement text of
9775 % macros containing the character definitions.
9776 \setnonasciicharscatcode\active
9778 % Latin1 (ISO-8859-1) character definitions.
9779 \def\latonechardefs{%
9780 \gdef^^a0{\tie}
9781 \gdef^^a1{\exclamdown}
9782 \gdef^^a2{{\tcfont \char162}} % cent
9783 \gdef^^a3{\pounds}
9784 \gdef^^a4{{\tcfont \char164}} % currency
9785 \gdef^^a5{{\tcfont \char165}} % yen
9786 \gdef^^a6{{\tcfont \char166}} % broken bar
9787 \gdef^^a7{\S}
9788 \gdef^^a8{\"{}}
9789 \gdef^^a9{\copyright}
9790 \gdef^^aa{\ordf}
9791 \gdef^^ab{\guillemetleft}
9792 \gdef^^ac{\ensuremath\lnot}
9793 \gdef^^ad{\-}
9794 \gdef^^ae{\registeredsymbol}
9795 \gdef^^af{\={}}
9797 \gdef^^b0{\textdegree}
9798 \gdef^^b1{$\pm$}
9799 \gdef^^b2{$^2$}
9800 \gdef^^b3{$^3$}
9801 \gdef^^b4{\'{}}
9802 \gdef^^b5{$\mu$}
9803 \gdef^^b6{\P}
9804 \gdef^^b7{\ensuremath\cdot}
9805 \gdef^^b8{\cedilla\ }
9806 \gdef^^b9{$^1$}
9807 \gdef^^ba{\ordm}
9808 \gdef^^bb{\guillemetright}
9809 \gdef^^bc{$1\over4$}
9810 \gdef^^bd{$1\over2$}
9811 \gdef^^be{$3\over4$}
9812 \gdef^^bf{\questiondown}
9814 \gdef^^c0{\`A}
9815 \gdef^^c1{\'A}
9816 \gdef^^c2{\^A}
9817 \gdef^^c3{\~A}
9818 \gdef^^c4{\"A}
9819 \gdef^^c5{\ringaccent A}
9820 \gdef^^c6{\AE}
9821 \gdef^^c7{\cedilla C}
9822 \gdef^^c8{\`E}
9823 \gdef^^c9{\'E}
9824 \gdef^^ca{\^E}
9825 \gdef^^cb{\"E}
9826 \gdef^^cc{\`I}
9827 \gdef^^cd{\'I}
9828 \gdef^^ce{\^I}
9829 \gdef^^cf{\"I}
9831 \gdef^^d0{\DH}
9832 \gdef^^d1{\~N}
9833 \gdef^^d2{\`O}
9834 \gdef^^d3{\'O}
9835 \gdef^^d4{\^O}
9836 \gdef^^d5{\~O}
9837 \gdef^^d6{\"O}
9838 \gdef^^d7{$\times$}
9839 \gdef^^d8{\O}
9840 \gdef^^d9{\`U}
9841 \gdef^^da{\'U}
9842 \gdef^^db{\^U}
9843 \gdef^^dc{\"U}
9844 \gdef^^dd{\'Y}
9845 \gdef^^de{\TH}
9846 \gdef^^df{\ss}
9848 \gdef^^e0{\`a}
9849 \gdef^^e1{\'a}
9850 \gdef^^e2{\^a}
9851 \gdef^^e3{\~a}
9852 \gdef^^e4{\"a}
9853 \gdef^^e5{\ringaccent a}
9854 \gdef^^e6{\ae}
9855 \gdef^^e7{\cedilla c}
9856 \gdef^^e8{\`e}
9857 \gdef^^e9{\'e}
9858 \gdef^^ea{\^e}
9859 \gdef^^eb{\"e}
9860 \gdef^^ec{\`{\dotless i}}
9861 \gdef^^ed{\'{\dotless i}}
9862 \gdef^^ee{\^{\dotless i}}
9863 \gdef^^ef{\"{\dotless i}}
9865 \gdef^^f0{\dh}
9866 \gdef^^f1{\~n}
9867 \gdef^^f2{\`o}
9868 \gdef^^f3{\'o}
9869 \gdef^^f4{\^o}
9870 \gdef^^f5{\~o}
9871 \gdef^^f6{\"o}
9872 \gdef^^f7{$\div$}
9873 \gdef^^f8{\o}
9874 \gdef^^f9{\`u}
9875 \gdef^^fa{\'u}
9876 \gdef^^fb{\^u}
9877 \gdef^^fc{\"u}
9878 \gdef^^fd{\'y}
9879 \gdef^^fe{\th}
9880 \gdef^^ff{\"y}
9883 % Latin9 (ISO-8859-15) encoding character definitions.
9884 \def\latninechardefs{%
9885 % Encoding is almost identical to Latin1.
9886 \latonechardefs
9888 \gdef^^a4{\euro}
9889 \gdef^^a6{\v S}
9890 \gdef^^a8{\v s}
9891 \gdef^^b4{\v Z}
9892 \gdef^^b8{\v z}
9893 \gdef^^bc{\OE}
9894 \gdef^^bd{\oe}
9895 \gdef^^be{\"Y}
9898 % Latin2 (ISO-8859-2) character definitions.
9899 \def\lattwochardefs{%
9900 \gdef^^a0{\tie}
9901 \gdef^^a1{\ogonek{A}}
9902 \gdef^^a2{\u{}}
9903 \gdef^^a3{\L}
9904 \gdef^^a4{\missingcharmsg{CURRENCY SIGN}}
9905 \gdef^^a5{\v L}
9906 \gdef^^a6{\'S}
9907 \gdef^^a7{\S}
9908 \gdef^^a8{\"{}}
9909 \gdef^^a9{\v S}
9910 \gdef^^aa{\cedilla S}
9911 \gdef^^ab{\v T}
9912 \gdef^^ac{\'Z}
9913 \gdef^^ad{\-}
9914 \gdef^^ae{\v Z}
9915 \gdef^^af{\dotaccent Z}
9917 \gdef^^b0{\textdegree}
9918 \gdef^^b1{\ogonek{a}}
9919 \gdef^^b2{\ogonek{ }}
9920 \gdef^^b3{\l}
9921 \gdef^^b4{\'{}}
9922 \gdef^^b5{\v l}
9923 \gdef^^b6{\'s}
9924 \gdef^^b7{\v{}}
9925 \gdef^^b8{\cedilla\ }
9926 \gdef^^b9{\v s}
9927 \gdef^^ba{\cedilla s}
9928 \gdef^^bb{\v t}
9929 \gdef^^bc{\'z}
9930 \gdef^^bd{\H{}}
9931 \gdef^^be{\v z}
9932 \gdef^^bf{\dotaccent z}
9934 \gdef^^c0{\'R}
9935 \gdef^^c1{\'A}
9936 \gdef^^c2{\^A}
9937 \gdef^^c3{\u A}
9938 \gdef^^c4{\"A}
9939 \gdef^^c5{\'L}
9940 \gdef^^c6{\'C}
9941 \gdef^^c7{\cedilla C}
9942 \gdef^^c8{\v C}
9943 \gdef^^c9{\'E}
9944 \gdef^^ca{\ogonek{E}}
9945 \gdef^^cb{\"E}
9946 \gdef^^cc{\v E}
9947 \gdef^^cd{\'I}
9948 \gdef^^ce{\^I}
9949 \gdef^^cf{\v D}
9951 \gdef^^d0{\DH}
9952 \gdef^^d1{\'N}
9953 \gdef^^d2{\v N}
9954 \gdef^^d3{\'O}
9955 \gdef^^d4{\^O}
9956 \gdef^^d5{\H O}
9957 \gdef^^d6{\"O}
9958 \gdef^^d7{$\times$}
9959 \gdef^^d8{\v R}
9960 \gdef^^d9{\ringaccent U}
9961 \gdef^^da{\'U}
9962 \gdef^^db{\H U}
9963 \gdef^^dc{\"U}
9964 \gdef^^dd{\'Y}
9965 \gdef^^de{\cedilla T}
9966 \gdef^^df{\ss}
9968 \gdef^^e0{\'r}
9969 \gdef^^e1{\'a}
9970 \gdef^^e2{\^a}
9971 \gdef^^e3{\u a}
9972 \gdef^^e4{\"a}
9973 \gdef^^e5{\'l}
9974 \gdef^^e6{\'c}
9975 \gdef^^e7{\cedilla c}
9976 \gdef^^e8{\v c}
9977 \gdef^^e9{\'e}
9978 \gdef^^ea{\ogonek{e}}
9979 \gdef^^eb{\"e}
9980 \gdef^^ec{\v e}
9981 \gdef^^ed{\'{\dotless{i}}}
9982 \gdef^^ee{\^{\dotless{i}}}
9983 \gdef^^ef{\v d}
9985 \gdef^^f0{\dh}
9986 \gdef^^f1{\'n}
9987 \gdef^^f2{\v n}
9988 \gdef^^f3{\'o}
9989 \gdef^^f4{\^o}
9990 \gdef^^f5{\H o}
9991 \gdef^^f6{\"o}
9992 \gdef^^f7{$\div$}
9993 \gdef^^f8{\v r}
9994 \gdef^^f9{\ringaccent u}
9995 \gdef^^fa{\'u}
9996 \gdef^^fb{\H u}
9997 \gdef^^fc{\"u}
9998 \gdef^^fd{\'y}
9999 \gdef^^fe{\cedilla t}
10000 \gdef^^ff{\dotaccent{}}
10003 % UTF-8 character definitions.
10005 % This code to support UTF-8 is based on LaTeX's utf8.def, with some
10006 % changes for Texinfo conventions. It is included here under the GPL by
10007 % permission from Frank Mittelbach and the LaTeX team.
10009 \newcount\countUTFx
10010 \newcount\countUTFy
10011 \newcount\countUTFz
10013 \gdef\UTFviiiTwoOctets#1#2{\expandafter
10014 \UTFviiiDefined\csname u8:#1\string #2\endcsname}
10016 \gdef\UTFviiiThreeOctets#1#2#3{\expandafter
10017 \UTFviiiDefined\csname u8:#1\string #2\string #3\endcsname}
10019 \gdef\UTFviiiFourOctets#1#2#3#4{\expandafter
10020 \UTFviiiDefined\csname u8:#1\string #2\string #3\string #4\endcsname}
10022 \gdef\UTFviiiDefined#1{%
10023 \ifx #1\relax
10024 \message{\linenumber Unicode char \string #1 not defined for Texinfo}%
10025 \else
10026 \expandafter #1%
10030 \begingroup
10031 \catcode`\~13
10032 \catcode`\"12
10034 \def\UTFviiiLoop{%
10035 \global\catcode\countUTFx\active
10036 \uccode`\~\countUTFx
10037 \uppercase\expandafter{\UTFviiiTmp}%
10038 \advance\countUTFx by 1
10039 \ifnum\countUTFx < \countUTFy
10040 \expandafter\UTFviiiLoop
10041 \fi}
10043 \countUTFx = "C2
10044 \countUTFy = "E0
10045 \def\UTFviiiTmp{%
10046 \xdef~{\noexpand\UTFviiiTwoOctets\string~}}
10047 \UTFviiiLoop
10049 \countUTFx = "E0
10050 \countUTFy = "F0
10051 \def\UTFviiiTmp{%
10052 \xdef~{\noexpand\UTFviiiThreeOctets\string~}}
10053 \UTFviiiLoop
10055 \countUTFx = "F0
10056 \countUTFy = "F4
10057 \def\UTFviiiTmp{%
10058 \xdef~{\noexpand\UTFviiiFourOctets\string~}}
10059 \UTFviiiLoop
10060 \endgroup
10062 \def\globallet{\global\let} % save some \expandafter's below
10064 % @U{xxxx} to produce U+xxxx, if we support it.
10065 \def\U#1{%
10066 \expandafter\ifx\csname uni:#1\endcsname \relax
10067 \iftxinativeunicodecapable
10068 % Any Unicode characters can be used by native Unicode.
10069 % However, if the font does not have the glyph, the letter will miss.
10070 \begingroup
10071 \uccode`\.="#1\relax
10072 \uppercase{.}
10073 \endgroup
10074 \else
10075 \errhelp = \EMsimple
10076 \errmessage{Unicode character U+#1 not supported, sorry}%
10078 \else
10079 \csname uni:#1\endcsname
10083 % For UTF-8 byte sequence (TeX, e-TeX and pdfTeX)
10084 % Definition macro to replace the Unicode character
10085 % Definition macro that is used by @U command
10087 \begingroup
10088 \catcode`\"=12
10089 \catcode`\<=12
10090 \catcode`\.=12
10091 \catcode`\,=12
10092 \catcode`\;=12
10093 \catcode`\!=12
10094 \catcode`\~=13
10095 \gdef\DeclareUnicodeCharacterUTFviii#1#2{%
10096 \countUTFz = "#1\relax
10097 %\wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}%
10098 \begingroup
10099 \parseXMLCharref
10100 \def\UTFviiiTwoOctets##1##2{%
10101 \csname u8:##1\string ##2\endcsname}%
10102 \def\UTFviiiThreeOctets##1##2##3{%
10103 \csname u8:##1\string ##2\string ##3\endcsname}%
10104 \def\UTFviiiFourOctets##1##2##3##4{%
10105 \csname u8:##1\string ##2\string ##3\string ##4\endcsname}%
10106 \expandafter\expandafter\expandafter\expandafter
10107 \expandafter\expandafter\expandafter
10108 \gdef\UTFviiiTmp{#2}%
10110 \expandafter\ifx\csname uni:#1\endcsname \relax \else
10111 \message{Internal error, already defined: #1}%
10114 % define an additional control sequence for this code point.
10115 \expandafter\globallet\csname uni:#1\endcsname \UTFviiiTmp
10116 \endgroup}
10118 \gdef\parseXMLCharref{%
10119 \ifnum\countUTFz < "A0\relax
10120 \errhelp = \EMsimple
10121 \errmessage{Cannot define Unicode char value < 00A0}%
10122 \else\ifnum\countUTFz < "800\relax
10123 \parseUTFviiiA,%
10124 \parseUTFviiiB C\UTFviiiTwoOctets.,%
10125 \else\ifnum\countUTFz < "10000\relax
10126 \parseUTFviiiA;%
10127 \parseUTFviiiA,%
10128 \parseUTFviiiB E\UTFviiiThreeOctets.{,;}%
10129 \else
10130 \parseUTFviiiA;%
10131 \parseUTFviiiA,%
10132 \parseUTFviiiA!%
10133 \parseUTFviiiB F\UTFviiiFourOctets.{!,;}%
10134 \fi\fi\fi
10137 \gdef\parseUTFviiiA#1{%
10138 \countUTFx = \countUTFz
10139 \divide\countUTFz by 64
10140 \countUTFy = \countUTFz
10141 \multiply\countUTFz by 64
10142 \advance\countUTFx by -\countUTFz
10143 \advance\countUTFx by 128
10144 \uccode `#1\countUTFx
10145 \countUTFz = \countUTFy}
10147 \gdef\parseUTFviiiB#1#2#3#4{%
10148 \advance\countUTFz by "#10\relax
10149 \uccode `#3\countUTFz
10150 \uppercase{\gdef\UTFviiiTmp{#2#3#4}}}
10151 \endgroup
10153 % For native Unicode (XeTeX and LuaTeX)
10154 % Definition macro that is set catcode other non global
10156 \def\DeclareUnicodeCharacterNativeOther#1#2{%
10157 \catcode"#1=\other
10160 % https://en.wikipedia.org/wiki/Plane_(Unicode)#Basic_M
10161 % U+0000..U+007F = https://en.wikipedia.org/wiki/Basic_Latin_(Unicode_block)
10162 % U+0080..U+00FF = https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)
10163 % U+0100..U+017F = https://en.wikipedia.org/wiki/Latin_Extended-A
10164 % U+0180..U+024F = https://en.wikipedia.org/wiki/Latin_Extended-B
10166 % Many of our renditions are less than wonderful, and all the missing
10167 % characters are available somewhere. Loading the necessary fonts
10168 % awaits user request. We can't truly support Unicode without
10169 % reimplementing everything that's been done in LaTeX for many years,
10170 % plus probably using luatex or xetex, and who knows what else.
10171 % We won't be doing that here in this simple file. But we can try to at
10172 % least make most of the characters not bomb out.
10174 \def\unicodechardefs{%
10175 \DeclareUnicodeCharacter{00A0}{\tie}%
10176 \DeclareUnicodeCharacter{00A1}{\exclamdown}%
10177 \DeclareUnicodeCharacter{00A2}{{\tcfont \char162}}% 0242=cent
10178 \DeclareUnicodeCharacter{00A3}{\pounds}%
10179 \DeclareUnicodeCharacter{00A4}{{\tcfont \char164}}% 0244=currency
10180 \DeclareUnicodeCharacter{00A5}{{\tcfont \char165}}% 0245=yen
10181 \DeclareUnicodeCharacter{00A6}{{\tcfont \char166}}% 0246=brokenbar
10182 \DeclareUnicodeCharacter{00A7}{\S}%
10183 \DeclareUnicodeCharacter{00A8}{\"{ }}%
10184 \DeclareUnicodeCharacter{00A9}{\copyright}%
10185 \DeclareUnicodeCharacter{00AA}{\ordf}%
10186 \DeclareUnicodeCharacter{00AB}{\guillemetleft}%
10187 \DeclareUnicodeCharacter{00AC}{\ensuremath\lnot}%
10188 \DeclareUnicodeCharacter{00AD}{\-}%
10189 \DeclareUnicodeCharacter{00AE}{\registeredsymbol}%
10190 \DeclareUnicodeCharacter{00AF}{\={ }}%
10192 \DeclareUnicodeCharacter{00B0}{\ringaccent{ }}%
10193 \DeclareUnicodeCharacter{00B1}{\ensuremath\pm}%
10194 \DeclareUnicodeCharacter{00B2}{$^2$}%
10195 \DeclareUnicodeCharacter{00B3}{$^3$}%
10196 \DeclareUnicodeCharacter{00B4}{\'{ }}%
10197 \DeclareUnicodeCharacter{00B5}{$\mu$}%
10198 \DeclareUnicodeCharacter{00B6}{\P}%
10199 \DeclareUnicodeCharacter{00B7}{\ensuremath\cdot}%
10200 \DeclareUnicodeCharacter{00B8}{\cedilla{ }}%
10201 \DeclareUnicodeCharacter{00B9}{$^1$}%
10202 \DeclareUnicodeCharacter{00BA}{\ordm}%
10203 \DeclareUnicodeCharacter{00BB}{\guillemetright}%
10204 \DeclareUnicodeCharacter{00BC}{$1\over4$}%
10205 \DeclareUnicodeCharacter{00BD}{$1\over2$}%
10206 \DeclareUnicodeCharacter{00BE}{$3\over4$}%
10207 \DeclareUnicodeCharacter{00BF}{\questiondown}%
10209 \DeclareUnicodeCharacter{00C0}{\`A}%
10210 \DeclareUnicodeCharacter{00C1}{\'A}%
10211 \DeclareUnicodeCharacter{00C2}{\^A}%
10212 \DeclareUnicodeCharacter{00C3}{\~A}%
10213 \DeclareUnicodeCharacter{00C4}{\"A}%
10214 \DeclareUnicodeCharacter{00C5}{\AA}%
10215 \DeclareUnicodeCharacter{00C6}{\AE}%
10216 \DeclareUnicodeCharacter{00C7}{\cedilla{C}}%
10217 \DeclareUnicodeCharacter{00C8}{\`E}%
10218 \DeclareUnicodeCharacter{00C9}{\'E}%
10219 \DeclareUnicodeCharacter{00CA}{\^E}%
10220 \DeclareUnicodeCharacter{00CB}{\"E}%
10221 \DeclareUnicodeCharacter{00CC}{\`I}%
10222 \DeclareUnicodeCharacter{00CD}{\'I}%
10223 \DeclareUnicodeCharacter{00CE}{\^I}%
10224 \DeclareUnicodeCharacter{00CF}{\"I}%
10226 \DeclareUnicodeCharacter{00D0}{\DH}%
10227 \DeclareUnicodeCharacter{00D1}{\~N}%
10228 \DeclareUnicodeCharacter{00D2}{\`O}%
10229 \DeclareUnicodeCharacter{00D3}{\'O}%
10230 \DeclareUnicodeCharacter{00D4}{\^O}%
10231 \DeclareUnicodeCharacter{00D5}{\~O}%
10232 \DeclareUnicodeCharacter{00D6}{\"O}%
10233 \DeclareUnicodeCharacter{00D7}{\ensuremath\times}%
10234 \DeclareUnicodeCharacter{00D8}{\O}%
10235 \DeclareUnicodeCharacter{00D9}{\`U}%
10236 \DeclareUnicodeCharacter{00DA}{\'U}%
10237 \DeclareUnicodeCharacter{00DB}{\^U}%
10238 \DeclareUnicodeCharacter{00DC}{\"U}%
10239 \DeclareUnicodeCharacter{00DD}{\'Y}%
10240 \DeclareUnicodeCharacter{00DE}{\TH}%
10241 \DeclareUnicodeCharacter{00DF}{\ss}%
10243 \DeclareUnicodeCharacter{00E0}{\`a}%
10244 \DeclareUnicodeCharacter{00E1}{\'a}%
10245 \DeclareUnicodeCharacter{00E2}{\^a}%
10246 \DeclareUnicodeCharacter{00E3}{\~a}%
10247 \DeclareUnicodeCharacter{00E4}{\"a}%
10248 \DeclareUnicodeCharacter{00E5}{\aa}%
10249 \DeclareUnicodeCharacter{00E6}{\ae}%
10250 \DeclareUnicodeCharacter{00E7}{\cedilla{c}}%
10251 \DeclareUnicodeCharacter{00E8}{\`e}%
10252 \DeclareUnicodeCharacter{00E9}{\'e}%
10253 \DeclareUnicodeCharacter{00EA}{\^e}%
10254 \DeclareUnicodeCharacter{00EB}{\"e}%
10255 \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}}%
10256 \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}}%
10257 \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}}%
10258 \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}}%
10260 \DeclareUnicodeCharacter{00F0}{\dh}%
10261 \DeclareUnicodeCharacter{00F1}{\~n}%
10262 \DeclareUnicodeCharacter{00F2}{\`o}%
10263 \DeclareUnicodeCharacter{00F3}{\'o}%
10264 \DeclareUnicodeCharacter{00F4}{\^o}%
10265 \DeclareUnicodeCharacter{00F5}{\~o}%
10266 \DeclareUnicodeCharacter{00F6}{\"o}%
10267 \DeclareUnicodeCharacter{00F7}{\ensuremath\div}%
10268 \DeclareUnicodeCharacter{00F8}{\o}%
10269 \DeclareUnicodeCharacter{00F9}{\`u}%
10270 \DeclareUnicodeCharacter{00FA}{\'u}%
10271 \DeclareUnicodeCharacter{00FB}{\^u}%
10272 \DeclareUnicodeCharacter{00FC}{\"u}%
10273 \DeclareUnicodeCharacter{00FD}{\'y}%
10274 \DeclareUnicodeCharacter{00FE}{\th}%
10275 \DeclareUnicodeCharacter{00FF}{\"y}%
10277 \DeclareUnicodeCharacter{0100}{\=A}%
10278 \DeclareUnicodeCharacter{0101}{\=a}%
10279 \DeclareUnicodeCharacter{0102}{\u{A}}%
10280 \DeclareUnicodeCharacter{0103}{\u{a}}%
10281 \DeclareUnicodeCharacter{0104}{\ogonek{A}}%
10282 \DeclareUnicodeCharacter{0105}{\ogonek{a}}%
10283 \DeclareUnicodeCharacter{0106}{\'C}%
10284 \DeclareUnicodeCharacter{0107}{\'c}%
10285 \DeclareUnicodeCharacter{0108}{\^C}%
10286 \DeclareUnicodeCharacter{0109}{\^c}%
10287 \DeclareUnicodeCharacter{010A}{\dotaccent{C}}%
10288 \DeclareUnicodeCharacter{010B}{\dotaccent{c}}%
10289 \DeclareUnicodeCharacter{010C}{\v{C}}%
10290 \DeclareUnicodeCharacter{010D}{\v{c}}%
10291 \DeclareUnicodeCharacter{010E}{\v{D}}%
10292 \DeclareUnicodeCharacter{010F}{d'}%
10294 \DeclareUnicodeCharacter{0110}{\DH}%
10295 \DeclareUnicodeCharacter{0111}{\dh}%
10296 \DeclareUnicodeCharacter{0112}{\=E}%
10297 \DeclareUnicodeCharacter{0113}{\=e}%
10298 \DeclareUnicodeCharacter{0114}{\u{E}}%
10299 \DeclareUnicodeCharacter{0115}{\u{e}}%
10300 \DeclareUnicodeCharacter{0116}{\dotaccent{E}}%
10301 \DeclareUnicodeCharacter{0117}{\dotaccent{e}}%
10302 \DeclareUnicodeCharacter{0118}{\ogonek{E}}%
10303 \DeclareUnicodeCharacter{0119}{\ogonek{e}}%
10304 \DeclareUnicodeCharacter{011A}{\v{E}}%
10305 \DeclareUnicodeCharacter{011B}{\v{e}}%
10306 \DeclareUnicodeCharacter{011C}{\^G}%
10307 \DeclareUnicodeCharacter{011D}{\^g}%
10308 \DeclareUnicodeCharacter{011E}{\u{G}}%
10309 \DeclareUnicodeCharacter{011F}{\u{g}}%
10311 \DeclareUnicodeCharacter{0120}{\dotaccent{G}}%
10312 \DeclareUnicodeCharacter{0121}{\dotaccent{g}}%
10313 \DeclareUnicodeCharacter{0122}{\cedilla{G}}%
10314 \DeclareUnicodeCharacter{0123}{\cedilla{g}}%
10315 \DeclareUnicodeCharacter{0124}{\^H}%
10316 \DeclareUnicodeCharacter{0125}{\^h}%
10317 \DeclareUnicodeCharacter{0126}{\missingcharmsg{H WITH STROKE}}%
10318 \DeclareUnicodeCharacter{0127}{\missingcharmsg{h WITH STROKE}}%
10319 \DeclareUnicodeCharacter{0128}{\~I}%
10320 \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}}%
10321 \DeclareUnicodeCharacter{012A}{\=I}%
10322 \DeclareUnicodeCharacter{012B}{\={\dotless{i}}}%
10323 \DeclareUnicodeCharacter{012C}{\u{I}}%
10324 \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}}%
10325 \DeclareUnicodeCharacter{012E}{\ogonek{I}}%
10326 \DeclareUnicodeCharacter{012F}{\ogonek{i}}%
10328 \DeclareUnicodeCharacter{0130}{\dotaccent{I}}%
10329 \DeclareUnicodeCharacter{0131}{\dotless{i}}%
10330 \DeclareUnicodeCharacter{0132}{IJ}%
10331 \DeclareUnicodeCharacter{0133}{ij}%
10332 \DeclareUnicodeCharacter{0134}{\^J}%
10333 \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}}%
10334 \DeclareUnicodeCharacter{0136}{\cedilla{K}}%
10335 \DeclareUnicodeCharacter{0137}{\cedilla{k}}%
10336 \DeclareUnicodeCharacter{0138}{\ensuremath\kappa}%
10337 \DeclareUnicodeCharacter{0139}{\'L}%
10338 \DeclareUnicodeCharacter{013A}{\'l}%
10339 \DeclareUnicodeCharacter{013B}{\cedilla{L}}%
10340 \DeclareUnicodeCharacter{013C}{\cedilla{l}}%
10341 \DeclareUnicodeCharacter{013D}{L'}% should kern
10342 \DeclareUnicodeCharacter{013E}{l'}% should kern
10343 \DeclareUnicodeCharacter{013F}{L\U{00B7}}%
10345 \DeclareUnicodeCharacter{0140}{l\U{00B7}}%
10346 \DeclareUnicodeCharacter{0141}{\L}%
10347 \DeclareUnicodeCharacter{0142}{\l}%
10348 \DeclareUnicodeCharacter{0143}{\'N}%
10349 \DeclareUnicodeCharacter{0144}{\'n}%
10350 \DeclareUnicodeCharacter{0145}{\cedilla{N}}%
10351 \DeclareUnicodeCharacter{0146}{\cedilla{n}}%
10352 \DeclareUnicodeCharacter{0147}{\v{N}}%
10353 \DeclareUnicodeCharacter{0148}{\v{n}}%
10354 \DeclareUnicodeCharacter{0149}{'n}%
10355 \DeclareUnicodeCharacter{014A}{\missingcharmsg{ENG}}%
10356 \DeclareUnicodeCharacter{014B}{\missingcharmsg{eng}}%
10357 \DeclareUnicodeCharacter{014C}{\=O}%
10358 \DeclareUnicodeCharacter{014D}{\=o}%
10359 \DeclareUnicodeCharacter{014E}{\u{O}}%
10360 \DeclareUnicodeCharacter{014F}{\u{o}}%
10362 \DeclareUnicodeCharacter{0150}{\H{O}}%
10363 \DeclareUnicodeCharacter{0151}{\H{o}}%
10364 \DeclareUnicodeCharacter{0152}{\OE}%
10365 \DeclareUnicodeCharacter{0153}{\oe}%
10366 \DeclareUnicodeCharacter{0154}{\'R}%
10367 \DeclareUnicodeCharacter{0155}{\'r}%
10368 \DeclareUnicodeCharacter{0156}{\cedilla{R}}%
10369 \DeclareUnicodeCharacter{0157}{\cedilla{r}}%
10370 \DeclareUnicodeCharacter{0158}{\v{R}}%
10371 \DeclareUnicodeCharacter{0159}{\v{r}}%
10372 \DeclareUnicodeCharacter{015A}{\'S}%
10373 \DeclareUnicodeCharacter{015B}{\'s}%
10374 \DeclareUnicodeCharacter{015C}{\^S}%
10375 \DeclareUnicodeCharacter{015D}{\^s}%
10376 \DeclareUnicodeCharacter{015E}{\cedilla{S}}%
10377 \DeclareUnicodeCharacter{015F}{\cedilla{s}}%
10379 \DeclareUnicodeCharacter{0160}{\v{S}}%
10380 \DeclareUnicodeCharacter{0161}{\v{s}}%
10381 \DeclareUnicodeCharacter{0162}{\cedilla{T}}%
10382 \DeclareUnicodeCharacter{0163}{\cedilla{t}}%
10383 \DeclareUnicodeCharacter{0164}{\v{T}}%
10384 \DeclareUnicodeCharacter{0165}{\v{t}}%
10385 \DeclareUnicodeCharacter{0166}{\missingcharmsg{H WITH STROKE}}%
10386 \DeclareUnicodeCharacter{0167}{\missingcharmsg{h WITH STROKE}}%
10387 \DeclareUnicodeCharacter{0168}{\~U}%
10388 \DeclareUnicodeCharacter{0169}{\~u}%
10389 \DeclareUnicodeCharacter{016A}{\=U}%
10390 \DeclareUnicodeCharacter{016B}{\=u}%
10391 \DeclareUnicodeCharacter{016C}{\u{U}}%
10392 \DeclareUnicodeCharacter{016D}{\u{u}}%
10393 \DeclareUnicodeCharacter{016E}{\ringaccent{U}}%
10394 \DeclareUnicodeCharacter{016F}{\ringaccent{u}}%
10396 \DeclareUnicodeCharacter{0170}{\H{U}}%
10397 \DeclareUnicodeCharacter{0171}{\H{u}}%
10398 \DeclareUnicodeCharacter{0172}{\ogonek{U}}%
10399 \DeclareUnicodeCharacter{0173}{\ogonek{u}}%
10400 \DeclareUnicodeCharacter{0174}{\^W}%
10401 \DeclareUnicodeCharacter{0175}{\^w}%
10402 \DeclareUnicodeCharacter{0176}{\^Y}%
10403 \DeclareUnicodeCharacter{0177}{\^y}%
10404 \DeclareUnicodeCharacter{0178}{\"Y}%
10405 \DeclareUnicodeCharacter{0179}{\'Z}%
10406 \DeclareUnicodeCharacter{017A}{\'z}%
10407 \DeclareUnicodeCharacter{017B}{\dotaccent{Z}}%
10408 \DeclareUnicodeCharacter{017C}{\dotaccent{z}}%
10409 \DeclareUnicodeCharacter{017D}{\v{Z}}%
10410 \DeclareUnicodeCharacter{017E}{\v{z}}%
10411 \DeclareUnicodeCharacter{017F}{\missingcharmsg{LONG S}}%
10413 \DeclareUnicodeCharacter{01C4}{D\v{Z}}%
10414 \DeclareUnicodeCharacter{01C5}{D\v{z}}%
10415 \DeclareUnicodeCharacter{01C6}{d\v{z}}%
10416 \DeclareUnicodeCharacter{01C7}{LJ}%
10417 \DeclareUnicodeCharacter{01C8}{Lj}%
10418 \DeclareUnicodeCharacter{01C9}{lj}%
10419 \DeclareUnicodeCharacter{01CA}{NJ}%
10420 \DeclareUnicodeCharacter{01CB}{Nj}%
10421 \DeclareUnicodeCharacter{01CC}{nj}%
10422 \DeclareUnicodeCharacter{01CD}{\v{A}}%
10423 \DeclareUnicodeCharacter{01CE}{\v{a}}%
10424 \DeclareUnicodeCharacter{01CF}{\v{I}}%
10426 \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}}%
10427 \DeclareUnicodeCharacter{01D1}{\v{O}}%
10428 \DeclareUnicodeCharacter{01D2}{\v{o}}%
10429 \DeclareUnicodeCharacter{01D3}{\v{U}}%
10430 \DeclareUnicodeCharacter{01D4}{\v{u}}%
10432 \DeclareUnicodeCharacter{01E2}{\={\AE}}%
10433 \DeclareUnicodeCharacter{01E3}{\={\ae}}%
10434 \DeclareUnicodeCharacter{01E6}{\v{G}}%
10435 \DeclareUnicodeCharacter{01E7}{\v{g}}%
10436 \DeclareUnicodeCharacter{01E8}{\v{K}}%
10437 \DeclareUnicodeCharacter{01E9}{\v{k}}%
10439 \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}}%
10440 \DeclareUnicodeCharacter{01F1}{DZ}%
10441 \DeclareUnicodeCharacter{01F2}{Dz}%
10442 \DeclareUnicodeCharacter{01F3}{dz}%
10443 \DeclareUnicodeCharacter{01F4}{\'G}%
10444 \DeclareUnicodeCharacter{01F5}{\'g}%
10445 \DeclareUnicodeCharacter{01F8}{\`N}%
10446 \DeclareUnicodeCharacter{01F9}{\`n}%
10447 \DeclareUnicodeCharacter{01FC}{\'{\AE}}%
10448 \DeclareUnicodeCharacter{01FD}{\'{\ae}}%
10449 \DeclareUnicodeCharacter{01FE}{\'{\O}}%
10450 \DeclareUnicodeCharacter{01FF}{\'{\o}}%
10452 \DeclareUnicodeCharacter{021E}{\v{H}}%
10453 \DeclareUnicodeCharacter{021F}{\v{h}}%
10455 \DeclareUnicodeCharacter{0226}{\dotaccent{A}}%
10456 \DeclareUnicodeCharacter{0227}{\dotaccent{a}}%
10457 \DeclareUnicodeCharacter{0228}{\cedilla{E}}%
10458 \DeclareUnicodeCharacter{0229}{\cedilla{e}}%
10459 \DeclareUnicodeCharacter{022E}{\dotaccent{O}}%
10460 \DeclareUnicodeCharacter{022F}{\dotaccent{o}}%
10462 \DeclareUnicodeCharacter{0232}{\=Y}%
10463 \DeclareUnicodeCharacter{0233}{\=y}%
10464 \DeclareUnicodeCharacter{0237}{\dotless{j}}%
10466 \DeclareUnicodeCharacter{02DB}{\ogonek{ }}%
10468 % Greek letters upper case
10469 \DeclareUnicodeCharacter{0391}{{\it A}}%
10470 \DeclareUnicodeCharacter{0392}{{\it B}}%
10471 \DeclareUnicodeCharacter{0393}{\ensuremath{\mit\Gamma}}%
10472 \DeclareUnicodeCharacter{0394}{\ensuremath{\mit\Delta}}%
10473 \DeclareUnicodeCharacter{0395}{{\it E}}%
10474 \DeclareUnicodeCharacter{0396}{{\it Z}}%
10475 \DeclareUnicodeCharacter{0397}{{\it H}}%
10476 \DeclareUnicodeCharacter{0398}{\ensuremath{\mit\Theta}}%
10477 \DeclareUnicodeCharacter{0399}{{\it I}}%
10478 \DeclareUnicodeCharacter{039A}{{\it K}}%
10479 \DeclareUnicodeCharacter{039B}{\ensuremath{\mit\Lambda}}%
10480 \DeclareUnicodeCharacter{039C}{{\it M}}%
10481 \DeclareUnicodeCharacter{039D}{{\it N}}%
10482 \DeclareUnicodeCharacter{039E}{\ensuremath{\mit\Xi}}%
10483 \DeclareUnicodeCharacter{039F}{{\it O}}%
10484 \DeclareUnicodeCharacter{03A0}{\ensuremath{\mit\Pi}}%
10485 \DeclareUnicodeCharacter{03A1}{{\it P}}%
10486 %\DeclareUnicodeCharacter{03A2}{} % none - corresponds to final sigma
10487 \DeclareUnicodeCharacter{03A3}{\ensuremath{\mit\Sigma}}%
10488 \DeclareUnicodeCharacter{03A4}{{\it T}}%
10489 \DeclareUnicodeCharacter{03A5}{\ensuremath{\mit\Upsilon}}%
10490 \DeclareUnicodeCharacter{03A6}{\ensuremath{\mit\Phi}}%
10491 \DeclareUnicodeCharacter{03A7}{{\it X}}%
10492 \DeclareUnicodeCharacter{03A8}{\ensuremath{\mit\Psi}}%
10493 \DeclareUnicodeCharacter{03A9}{\ensuremath{\mit\Omega}}%
10495 % Vowels with accents
10496 \DeclareUnicodeCharacter{0390}{\ensuremath{\ddot{\acute\iota}}}%
10497 \DeclareUnicodeCharacter{03AC}{\ensuremath{\acute\alpha}}%
10498 \DeclareUnicodeCharacter{03AD}{\ensuremath{\acute\epsilon}}%
10499 \DeclareUnicodeCharacter{03AE}{\ensuremath{\acute\eta}}%
10500 \DeclareUnicodeCharacter{03AF}{\ensuremath{\acute\iota}}%
10501 \DeclareUnicodeCharacter{03B0}{\ensuremath{\acute{\ddot\upsilon}}}%
10503 % Standalone accent
10504 \DeclareUnicodeCharacter{0384}{\ensuremath{\acute{\ }}}%
10506 % Greek letters lower case
10507 \DeclareUnicodeCharacter{03B1}{\ensuremath\alpha}%
10508 \DeclareUnicodeCharacter{03B2}{\ensuremath\beta}%
10509 \DeclareUnicodeCharacter{03B3}{\ensuremath\gamma}%
10510 \DeclareUnicodeCharacter{03B4}{\ensuremath\delta}%
10511 \DeclareUnicodeCharacter{03B5}{\ensuremath\epsilon}%
10512 \DeclareUnicodeCharacter{03B6}{\ensuremath\zeta}%
10513 \DeclareUnicodeCharacter{03B7}{\ensuremath\eta}%
10514 \DeclareUnicodeCharacter{03B8}{\ensuremath\theta}%
10515 \DeclareUnicodeCharacter{03B9}{\ensuremath\iota}%
10516 \DeclareUnicodeCharacter{03BA}{\ensuremath\kappa}%
10517 \DeclareUnicodeCharacter{03BB}{\ensuremath\lambda}%
10518 \DeclareUnicodeCharacter{03BC}{\ensuremath\mu}%
10519 \DeclareUnicodeCharacter{03BD}{\ensuremath\nu}%
10520 \DeclareUnicodeCharacter{03BE}{\ensuremath\xi}%
10521 \DeclareUnicodeCharacter{03BF}{{\it o}}% omicron
10522 \DeclareUnicodeCharacter{03C0}{\ensuremath\pi}%
10523 \DeclareUnicodeCharacter{03C1}{\ensuremath\rho}%
10524 \DeclareUnicodeCharacter{03C2}{\ensuremath\varsigma}%
10525 \DeclareUnicodeCharacter{03C3}{\ensuremath\sigma}%
10526 \DeclareUnicodeCharacter{03C4}{\ensuremath\tau}%
10527 \DeclareUnicodeCharacter{03C5}{\ensuremath\upsilon}%
10528 \DeclareUnicodeCharacter{03C6}{\ensuremath\phi}%
10529 \DeclareUnicodeCharacter{03C7}{\ensuremath\chi}%
10530 \DeclareUnicodeCharacter{03C8}{\ensuremath\psi}%
10531 \DeclareUnicodeCharacter{03C9}{\ensuremath\omega}%
10533 % More Greek vowels with accents
10534 \DeclareUnicodeCharacter{03CA}{\ensuremath{\ddot\iota}}%
10535 \DeclareUnicodeCharacter{03CB}{\ensuremath{\ddot\upsilon}}%
10536 \DeclareUnicodeCharacter{03CC}{\ensuremath{\acute o}}%
10537 \DeclareUnicodeCharacter{03CD}{\ensuremath{\acute\upsilon}}%
10538 \DeclareUnicodeCharacter{03CE}{\ensuremath{\acute\omega}}%
10540 % Variant Greek letters
10541 \DeclareUnicodeCharacter{03D1}{\ensuremath\vartheta}%
10542 \DeclareUnicodeCharacter{03D6}{\ensuremath\varpi}%
10543 \DeclareUnicodeCharacter{03F1}{\ensuremath\varrho}%
10545 \DeclareUnicodeCharacter{1E02}{\dotaccent{B}}%
10546 \DeclareUnicodeCharacter{1E03}{\dotaccent{b}}%
10547 \DeclareUnicodeCharacter{1E04}{\udotaccent{B}}%
10548 \DeclareUnicodeCharacter{1E05}{\udotaccent{b}}%
10549 \DeclareUnicodeCharacter{1E06}{\ubaraccent{B}}%
10550 \DeclareUnicodeCharacter{1E07}{\ubaraccent{b}}%
10551 \DeclareUnicodeCharacter{1E0A}{\dotaccent{D}}%
10552 \DeclareUnicodeCharacter{1E0B}{\dotaccent{d}}%
10553 \DeclareUnicodeCharacter{1E0C}{\udotaccent{D}}%
10554 \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}}%
10555 \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}}%
10556 \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}}%
10558 \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}}%
10559 \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}}%
10561 \DeclareUnicodeCharacter{1E20}{\=G}%
10562 \DeclareUnicodeCharacter{1E21}{\=g}%
10563 \DeclareUnicodeCharacter{1E22}{\dotaccent{H}}%
10564 \DeclareUnicodeCharacter{1E23}{\dotaccent{h}}%
10565 \DeclareUnicodeCharacter{1E24}{\udotaccent{H}}%
10566 \DeclareUnicodeCharacter{1E25}{\udotaccent{h}}%
10567 \DeclareUnicodeCharacter{1E26}{\"H}%
10568 \DeclareUnicodeCharacter{1E27}{\"h}%
10570 \DeclareUnicodeCharacter{1E30}{\'K}%
10571 \DeclareUnicodeCharacter{1E31}{\'k}%
10572 \DeclareUnicodeCharacter{1E32}{\udotaccent{K}}%
10573 \DeclareUnicodeCharacter{1E33}{\udotaccent{k}}%
10574 \DeclareUnicodeCharacter{1E34}{\ubaraccent{K}}%
10575 \DeclareUnicodeCharacter{1E35}{\ubaraccent{k}}%
10576 \DeclareUnicodeCharacter{1E36}{\udotaccent{L}}%
10577 \DeclareUnicodeCharacter{1E37}{\udotaccent{l}}%
10578 \DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}}%
10579 \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}}%
10580 \DeclareUnicodeCharacter{1E3E}{\'M}%
10581 \DeclareUnicodeCharacter{1E3F}{\'m}%
10583 \DeclareUnicodeCharacter{1E40}{\dotaccent{M}}%
10584 \DeclareUnicodeCharacter{1E41}{\dotaccent{m}}%
10585 \DeclareUnicodeCharacter{1E42}{\udotaccent{M}}%
10586 \DeclareUnicodeCharacter{1E43}{\udotaccent{m}}%
10587 \DeclareUnicodeCharacter{1E44}{\dotaccent{N}}%
10588 \DeclareUnicodeCharacter{1E45}{\dotaccent{n}}%
10589 \DeclareUnicodeCharacter{1E46}{\udotaccent{N}}%
10590 \DeclareUnicodeCharacter{1E47}{\udotaccent{n}}%
10591 \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}}%
10592 \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}}%
10594 \DeclareUnicodeCharacter{1E54}{\'P}%
10595 \DeclareUnicodeCharacter{1E55}{\'p}%
10596 \DeclareUnicodeCharacter{1E56}{\dotaccent{P}}%
10597 \DeclareUnicodeCharacter{1E57}{\dotaccent{p}}%
10598 \DeclareUnicodeCharacter{1E58}{\dotaccent{R}}%
10599 \DeclareUnicodeCharacter{1E59}{\dotaccent{r}}%
10600 \DeclareUnicodeCharacter{1E5A}{\udotaccent{R}}%
10601 \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}}%
10602 \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}}%
10603 \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}}%
10605 \DeclareUnicodeCharacter{1E60}{\dotaccent{S}}%
10606 \DeclareUnicodeCharacter{1E61}{\dotaccent{s}}%
10607 \DeclareUnicodeCharacter{1E62}{\udotaccent{S}}%
10608 \DeclareUnicodeCharacter{1E63}{\udotaccent{s}}%
10609 \DeclareUnicodeCharacter{1E6A}{\dotaccent{T}}%
10610 \DeclareUnicodeCharacter{1E6B}{\dotaccent{t}}%
10611 \DeclareUnicodeCharacter{1E6C}{\udotaccent{T}}%
10612 \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}}%
10613 \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}}%
10614 \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}}%
10616 \DeclareUnicodeCharacter{1E7C}{\~V}%
10617 \DeclareUnicodeCharacter{1E7D}{\~v}%
10618 \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}}%
10619 \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}}%
10621 \DeclareUnicodeCharacter{1E80}{\`W}%
10622 \DeclareUnicodeCharacter{1E81}{\`w}%
10623 \DeclareUnicodeCharacter{1E82}{\'W}%
10624 \DeclareUnicodeCharacter{1E83}{\'w}%
10625 \DeclareUnicodeCharacter{1E84}{\"W}%
10626 \DeclareUnicodeCharacter{1E85}{\"w}%
10627 \DeclareUnicodeCharacter{1E86}{\dotaccent{W}}%
10628 \DeclareUnicodeCharacter{1E87}{\dotaccent{w}}%
10629 \DeclareUnicodeCharacter{1E88}{\udotaccent{W}}%
10630 \DeclareUnicodeCharacter{1E89}{\udotaccent{w}}%
10631 \DeclareUnicodeCharacter{1E8A}{\dotaccent{X}}%
10632 \DeclareUnicodeCharacter{1E8B}{\dotaccent{x}}%
10633 \DeclareUnicodeCharacter{1E8C}{\"X}%
10634 \DeclareUnicodeCharacter{1E8D}{\"x}%
10635 \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}}%
10636 \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}}%
10638 \DeclareUnicodeCharacter{1E90}{\^Z}%
10639 \DeclareUnicodeCharacter{1E91}{\^z}%
10640 \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}}%
10641 \DeclareUnicodeCharacter{1E93}{\udotaccent{z}}%
10642 \DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}}%
10643 \DeclareUnicodeCharacter{1E95}{\ubaraccent{z}}%
10644 \DeclareUnicodeCharacter{1E96}{\ubaraccent{h}}%
10645 \DeclareUnicodeCharacter{1E97}{\"t}%
10646 \DeclareUnicodeCharacter{1E98}{\ringaccent{w}}%
10647 \DeclareUnicodeCharacter{1E99}{\ringaccent{y}}%
10649 \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}}%
10650 \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}}%
10652 \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}}%
10653 \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}}%
10654 \DeclareUnicodeCharacter{1EBC}{\~E}%
10655 \DeclareUnicodeCharacter{1EBD}{\~e}%
10657 \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}}%
10658 \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}}%
10659 \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}}%
10660 \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}}%
10662 \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}}%
10663 \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}}%
10665 \DeclareUnicodeCharacter{1EF2}{\`Y}%
10666 \DeclareUnicodeCharacter{1EF3}{\`y}%
10667 \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}}%
10669 \DeclareUnicodeCharacter{1EF8}{\~Y}%
10670 \DeclareUnicodeCharacter{1EF9}{\~y}%
10672 % Punctuation
10673 \DeclareUnicodeCharacter{2013}{--}%
10674 \DeclareUnicodeCharacter{2014}{---}%
10675 \DeclareUnicodeCharacter{2018}{\quoteleft}%
10676 \DeclareUnicodeCharacter{2019}{\quoteright}%
10677 \DeclareUnicodeCharacter{201A}{\quotesinglbase}%
10678 \DeclareUnicodeCharacter{201C}{\quotedblleft}%
10679 \DeclareUnicodeCharacter{201D}{\quotedblright}%
10680 \DeclareUnicodeCharacter{201E}{\quotedblbase}%
10681 \DeclareUnicodeCharacter{2020}{\ensuremath\dagger}%
10682 \DeclareUnicodeCharacter{2021}{\ensuremath\ddagger}%
10683 \DeclareUnicodeCharacter{2022}{\bullet}%
10684 \DeclareUnicodeCharacter{202F}{\thinspace}%
10685 \DeclareUnicodeCharacter{2026}{\dots}%
10686 \DeclareUnicodeCharacter{2039}{\guilsinglleft}%
10687 \DeclareUnicodeCharacter{203A}{\guilsinglright}%
10689 \DeclareUnicodeCharacter{20AC}{\euro}%
10691 \DeclareUnicodeCharacter{2192}{\expansion}%
10692 \DeclareUnicodeCharacter{21D2}{\result}%
10694 % Mathematical symbols
10695 \DeclareUnicodeCharacter{2200}{\ensuremath\forall}%
10696 \DeclareUnicodeCharacter{2203}{\ensuremath\exists}%
10697 \DeclareUnicodeCharacter{2208}{\ensuremath\in}%
10698 \DeclareUnicodeCharacter{2212}{\minus}%
10699 \DeclareUnicodeCharacter{2217}{\ast}%
10700 \DeclareUnicodeCharacter{221E}{\ensuremath\infty}%
10701 \DeclareUnicodeCharacter{2225}{\ensuremath\parallel}%
10702 \DeclareUnicodeCharacter{2227}{\ensuremath\wedge}%
10703 \DeclareUnicodeCharacter{2229}{\ensuremath\cap}%
10704 \DeclareUnicodeCharacter{2261}{\equiv}%
10705 \DeclareUnicodeCharacter{2264}{\ensuremath\leq}%
10706 \DeclareUnicodeCharacter{2265}{\ensuremath\geq}%
10707 \DeclareUnicodeCharacter{2282}{\ensuremath\subset}%
10708 \DeclareUnicodeCharacter{2287}{\ensuremath\supseteq}%
10710 \DeclareUnicodeCharacter{2016}{\ensuremath\Vert}%
10711 \DeclareUnicodeCharacter{2032}{\ensuremath\prime}%
10712 \DeclareUnicodeCharacter{210F}{\ensuremath\hbar}%
10713 \DeclareUnicodeCharacter{2111}{\ensuremath\Im}%
10714 \DeclareUnicodeCharacter{2113}{\ensuremath\ell}%
10715 \DeclareUnicodeCharacter{2118}{\ensuremath\wp}%
10716 \DeclareUnicodeCharacter{211C}{\ensuremath\Re}%
10717 \DeclareUnicodeCharacter{2127}{\ensuremath\mho}%
10718 \DeclareUnicodeCharacter{2135}{\ensuremath\aleph}%
10719 \DeclareUnicodeCharacter{2190}{\ensuremath\leftarrow}%
10720 \DeclareUnicodeCharacter{2191}{\ensuremath\uparrow}%
10721 \DeclareUnicodeCharacter{2193}{\ensuremath\downarrow}%
10722 \DeclareUnicodeCharacter{2194}{\ensuremath\leftrightarrow}%
10723 \DeclareUnicodeCharacter{2195}{\ensuremath\updownarrow}%
10724 \DeclareUnicodeCharacter{2196}{\ensuremath\nwarrow}%
10725 \DeclareUnicodeCharacter{2197}{\ensuremath\nearrow}%
10726 \DeclareUnicodeCharacter{2198}{\ensuremath\searrow}%
10727 \DeclareUnicodeCharacter{2199}{\ensuremath\swarrow}%
10728 \DeclareUnicodeCharacter{21A6}{\ensuremath\mapsto}%
10729 \DeclareUnicodeCharacter{21A9}{\ensuremath\hookleftarrow}%
10730 \DeclareUnicodeCharacter{21AA}{\ensuremath\hookrightarrow}%
10731 \DeclareUnicodeCharacter{21BC}{\ensuremath\leftharpoonup}%
10732 \DeclareUnicodeCharacter{21BD}{\ensuremath\leftharpoondown}%
10733 \DeclareUnicodeCharacter{21BE}{\ensuremath\upharpoonright}%
10734 \DeclareUnicodeCharacter{21C0}{\ensuremath\rightharpoonup}%
10735 \DeclareUnicodeCharacter{21C1}{\ensuremath\rightharpoondown}%
10736 \DeclareUnicodeCharacter{21CC}{\ensuremath\rightleftharpoons}%
10737 \DeclareUnicodeCharacter{21D0}{\ensuremath\Leftarrow}%
10738 \DeclareUnicodeCharacter{21D1}{\ensuremath\Uparrow}%
10739 \DeclareUnicodeCharacter{21D3}{\ensuremath\Downarrow}%
10740 \DeclareUnicodeCharacter{21D4}{\ensuremath\Leftrightarrow}%
10741 \DeclareUnicodeCharacter{21D5}{\ensuremath\Updownarrow}%
10742 \DeclareUnicodeCharacter{21DD}{\ensuremath\leadsto}%
10743 \DeclareUnicodeCharacter{2201}{\ensuremath\complement}%
10744 \DeclareUnicodeCharacter{2202}{\ensuremath\partial}%
10745 \DeclareUnicodeCharacter{2205}{\ensuremath\emptyset}%
10746 \DeclareUnicodeCharacter{2207}{\ensuremath\nabla}%
10747 \DeclareUnicodeCharacter{2209}{\ensuremath\notin}%
10748 \DeclareUnicodeCharacter{220B}{\ensuremath\owns}%
10749 \DeclareUnicodeCharacter{220F}{\ensuremath\prod}%
10750 \DeclareUnicodeCharacter{2210}{\ensuremath\coprod}%
10751 \DeclareUnicodeCharacter{2211}{\ensuremath\sum}%
10752 \DeclareUnicodeCharacter{2213}{\ensuremath\mp}%
10753 \DeclareUnicodeCharacter{2218}{\ensuremath\circ}%
10754 \DeclareUnicodeCharacter{221A}{\ensuremath\surd}%
10755 \DeclareUnicodeCharacter{221D}{\ensuremath\propto}%
10756 \DeclareUnicodeCharacter{2220}{\ensuremath\angle}%
10757 \DeclareUnicodeCharacter{2223}{\ensuremath\mid}%
10758 \DeclareUnicodeCharacter{2228}{\ensuremath\vee}%
10759 \DeclareUnicodeCharacter{222A}{\ensuremath\cup}%
10760 \DeclareUnicodeCharacter{222B}{\ensuremath\smallint}%
10761 \DeclareUnicodeCharacter{222E}{\ensuremath\oint}%
10762 \DeclareUnicodeCharacter{223C}{\ensuremath\sim}%
10763 \DeclareUnicodeCharacter{2240}{\ensuremath\wr}%
10764 \DeclareUnicodeCharacter{2243}{\ensuremath\simeq}%
10765 \DeclareUnicodeCharacter{2245}{\ensuremath\cong}%
10766 \DeclareUnicodeCharacter{2248}{\ensuremath\approx}%
10767 \DeclareUnicodeCharacter{224D}{\ensuremath\asymp}%
10768 \DeclareUnicodeCharacter{2250}{\ensuremath\doteq}%
10769 \DeclareUnicodeCharacter{2260}{\ensuremath\neq}%
10770 \DeclareUnicodeCharacter{226A}{\ensuremath\ll}%
10771 \DeclareUnicodeCharacter{226B}{\ensuremath\gg}%
10772 \DeclareUnicodeCharacter{227A}{\ensuremath\prec}%
10773 \DeclareUnicodeCharacter{227B}{\ensuremath\succ}%
10774 \DeclareUnicodeCharacter{2283}{\ensuremath\supset}%
10775 \DeclareUnicodeCharacter{2286}{\ensuremath\subseteq}%
10776 \DeclareUnicodeCharacter{228E}{\ensuremath\uplus}%
10777 \DeclareUnicodeCharacter{228F}{\ensuremath\sqsubset}%
10778 \DeclareUnicodeCharacter{2290}{\ensuremath\sqsupset}%
10779 \DeclareUnicodeCharacter{2291}{\ensuremath\sqsubseteq}%
10780 \DeclareUnicodeCharacter{2292}{\ensuremath\sqsupseteq}%
10781 \DeclareUnicodeCharacter{2293}{\ensuremath\sqcap}%
10782 \DeclareUnicodeCharacter{2294}{\ensuremath\sqcup}%
10783 \DeclareUnicodeCharacter{2295}{\ensuremath\oplus}%
10784 \DeclareUnicodeCharacter{2296}{\ensuremath\ominus}%
10785 \DeclareUnicodeCharacter{2297}{\ensuremath\otimes}%
10786 \DeclareUnicodeCharacter{2298}{\ensuremath\oslash}%
10787 \DeclareUnicodeCharacter{2299}{\ensuremath\odot}%
10788 \DeclareUnicodeCharacter{22A2}{\ensuremath\vdash}%
10789 \DeclareUnicodeCharacter{22A3}{\ensuremath\dashv}%
10790 \DeclareUnicodeCharacter{22A4}{\ensuremath\ptextop}%
10791 \DeclareUnicodeCharacter{22A5}{\ensuremath\bot}%
10792 \DeclareUnicodeCharacter{22A8}{\ensuremath\models}%
10793 \DeclareUnicodeCharacter{22B4}{\ensuremath\unlhd}%
10794 \DeclareUnicodeCharacter{22B5}{\ensuremath\unrhd}%
10795 \DeclareUnicodeCharacter{22C0}{\ensuremath\bigwedge}%
10796 \DeclareUnicodeCharacter{22C1}{\ensuremath\bigvee}%
10797 \DeclareUnicodeCharacter{22C2}{\ensuremath\bigcap}%
10798 \DeclareUnicodeCharacter{22C3}{\ensuremath\bigcup}%
10799 \DeclareUnicodeCharacter{22C4}{\ensuremath\diamond}%
10800 \DeclareUnicodeCharacter{22C5}{\ensuremath\cdot}%
10801 \DeclareUnicodeCharacter{22C6}{\ensuremath\star}%
10802 \DeclareUnicodeCharacter{22C8}{\ensuremath\bowtie}%
10803 \DeclareUnicodeCharacter{2308}{\ensuremath\lceil}%
10804 \DeclareUnicodeCharacter{2309}{\ensuremath\rceil}%
10805 \DeclareUnicodeCharacter{230A}{\ensuremath\lfloor}%
10806 \DeclareUnicodeCharacter{230B}{\ensuremath\rfloor}%
10807 \DeclareUnicodeCharacter{2322}{\ensuremath\frown}%
10808 \DeclareUnicodeCharacter{2323}{\ensuremath\smile}%
10810 \DeclareUnicodeCharacter{25A1}{\ensuremath\Box}%
10811 \DeclareUnicodeCharacter{25B3}{\ensuremath\triangle}%
10812 \DeclareUnicodeCharacter{25B7}{\ensuremath\triangleright}%
10813 \DeclareUnicodeCharacter{25BD}{\ensuremath\bigtriangledown}%
10814 \DeclareUnicodeCharacter{25C1}{\ensuremath\triangleleft}%
10815 \DeclareUnicodeCharacter{25C7}{\ensuremath\Diamond}%
10816 \DeclareUnicodeCharacter{2660}{\ensuremath\spadesuit}%
10817 \DeclareUnicodeCharacter{2661}{\ensuremath\heartsuit}%
10818 \DeclareUnicodeCharacter{2662}{\ensuremath\diamondsuit}%
10819 \DeclareUnicodeCharacter{2663}{\ensuremath\clubsuit}%
10820 \DeclareUnicodeCharacter{266D}{\ensuremath\flat}%
10821 \DeclareUnicodeCharacter{266E}{\ensuremath\natural}%
10822 \DeclareUnicodeCharacter{266F}{\ensuremath\sharp}%
10823 \DeclareUnicodeCharacter{26AA}{\ensuremath\bigcirc}%
10824 \DeclareUnicodeCharacter{27B9}{\ensuremath\rangle}%
10825 \DeclareUnicodeCharacter{27C2}{\ensuremath\perp}%
10826 \DeclareUnicodeCharacter{27E8}{\ensuremath\langle}%
10827 \DeclareUnicodeCharacter{27F5}{\ensuremath\longleftarrow}%
10828 \DeclareUnicodeCharacter{27F6}{\ensuremath\longrightarrow}%
10829 \DeclareUnicodeCharacter{27F7}{\ensuremath\longleftrightarrow}%
10830 \DeclareUnicodeCharacter{27FC}{\ensuremath\longmapsto}%
10831 \DeclareUnicodeCharacter{29F5}{\ensuremath\setminus}%
10832 \DeclareUnicodeCharacter{2A00}{\ensuremath\bigodot}%
10833 \DeclareUnicodeCharacter{2A01}{\ensuremath\bigoplus}%
10834 \DeclareUnicodeCharacter{2A02}{\ensuremath\bigotimes}%
10835 \DeclareUnicodeCharacter{2A04}{\ensuremath\biguplus}%
10836 \DeclareUnicodeCharacter{2A06}{\ensuremath\bigsqcup}%
10837 \DeclareUnicodeCharacter{2A1D}{\ensuremath\Join}%
10838 \DeclareUnicodeCharacter{2A3F}{\ensuremath\amalg}%
10839 \DeclareUnicodeCharacter{2AAF}{\ensuremath\preceq}%
10840 \DeclareUnicodeCharacter{2AB0}{\ensuremath\succeq}%
10842 \global\mathchardef\checkmark="1370% actually the square root sign
10843 \DeclareUnicodeCharacter{2713}{\ensuremath\checkmark}%
10844 }% end of \unicodechardefs
10846 % UTF-8 byte sequence (pdfTeX) definitions (replacing and @U command)
10847 % It makes the setting that replace UTF-8 byte sequence.
10848 \def\utfeightchardefs{%
10849 \let\DeclareUnicodeCharacter\DeclareUnicodeCharacterUTFviii
10850 \unicodechardefs
10853 \newif\ifpassthroughchars
10854 \passthroughcharsfalse
10856 % For native Unicode (XeTeX and LuaTeX)
10857 % Definition macro to replace / pass-through the Unicode character
10859 \def\DeclareUnicodeCharacterNative#1#2{%
10860 \catcode"#1=\active
10861 \def\dodeclareunicodecharacternative##1##2##3{%
10862 \begingroup
10863 \uccode`\~="##2\relax
10864 \uppercase{\gdef~}{%
10865 \ifpassthroughchars
10866 ##1%
10867 \else
10868 ##3%
10871 \endgroup
10873 \begingroup
10874 \uccode`\.="#1\relax
10875 \uppercase{\def\UTFNativeTmp{.}}%
10876 \expandafter\dodeclareunicodecharacternative\UTFNativeTmp{#1}{#2}%
10877 \endgroup
10880 % Native Unicode (XeTeX and LuaTeX) character replacing definitions
10881 % It makes the setting that replace the Unicode characters.
10882 \def\nativeunicodechardefs{%
10883 \let\DeclareUnicodeCharacter\DeclareUnicodeCharacterNative
10884 \unicodechardefs
10887 % For native Unicode (XeTeX and LuaTeX). Make the character token expand
10888 % to the sequences given in \unicodechardefs for printing.
10889 \def\DeclareUnicodeCharacterNativeAtU#1#2{%
10890 \def\UTFAtUTmp{#2}
10891 \expandafter\globallet\csname uni:#1\endcsname \UTFAtUTmp
10894 % Native Unicode (XeTeX and LuaTeX) @U command definitions
10895 \def\nativeunicodechardefsatu{%
10896 \let\DeclareUnicodeCharacter\DeclareUnicodeCharacterNativeAtU
10897 \unicodechardefs
10900 % Native Unicode (XeTeX and LuaTeX) catcode other non global definitions
10901 \def\nativeunicodecharscatcodeothernonglobal{%
10902 \let\DeclareUnicodeCharacter\DeclareUnicodeCharacterNativeOther
10903 \unicodechardefs
10906 % Catcode (non-ASCII or native Unicode) are set to \other (non-global
10907 % assignments).
10908 \def\setcharscatcodeothernonglobal{%
10909 \iftxiusebytewiseio
10910 \setnonasciicharscatcodenonglobal\other
10911 \else
10912 \nativeunicodecharscatcodeothernonglobal
10916 % US-ASCII character definitions.
10917 \def\asciichardefs{% nothing need be done
10918 \relax
10921 % Redefine the active definitions of non-ASCII characters to expand to
10922 % non-active tokens with the same character code.
10923 \def\nonasciistringdefs{%
10924 \setnonasciicharscatcode\active
10925 \def\defstringchar##1{\def##1{\string##1}}%
10927 \defstringchar^^80\defstringchar^^81\defstringchar^^82\defstringchar^^83%
10928 \defstringchar^^84\defstringchar^^85\defstringchar^^86\defstringchar^^87%
10929 \defstringchar^^88\defstringchar^^89\defstringchar^^8a\defstringchar^^8b%
10930 \defstringchar^^8c\defstringchar^^8d\defstringchar^^8e\defstringchar^^8f%
10932 \defstringchar^^90\defstringchar^^91\defstringchar^^92\defstringchar^^93%
10933 \defstringchar^^94\defstringchar^^95\defstringchar^^96\defstringchar^^97%
10934 \defstringchar^^98\defstringchar^^99\defstringchar^^9a\defstringchar^^9b%
10935 \defstringchar^^9c\defstringchar^^9d\defstringchar^^9e\defstringchar^^9f%
10937 \defstringchar^^a0\defstringchar^^a1\defstringchar^^a2\defstringchar^^a3%
10938 \defstringchar^^a4\defstringchar^^a5\defstringchar^^a6\defstringchar^^a7%
10939 \defstringchar^^a8\defstringchar^^a9\defstringchar^^aa\defstringchar^^ab%
10940 \defstringchar^^ac\defstringchar^^ad\defstringchar^^ae\defstringchar^^af%
10942 \defstringchar^^b0\defstringchar^^b1\defstringchar^^b2\defstringchar^^b3%
10943 \defstringchar^^b4\defstringchar^^b5\defstringchar^^b6\defstringchar^^b7%
10944 \defstringchar^^b8\defstringchar^^b9\defstringchar^^ba\defstringchar^^bb%
10945 \defstringchar^^bc\defstringchar^^bd\defstringchar^^be\defstringchar^^bf%
10947 \defstringchar^^c0\defstringchar^^c1\defstringchar^^c2\defstringchar^^c3%
10948 \defstringchar^^c4\defstringchar^^c5\defstringchar^^c6\defstringchar^^c7%
10949 \defstringchar^^c8\defstringchar^^c9\defstringchar^^ca\defstringchar^^cb%
10950 \defstringchar^^cc\defstringchar^^cd\defstringchar^^ce\defstringchar^^cf%
10952 \defstringchar^^d0\defstringchar^^d1\defstringchar^^d2\defstringchar^^d3%
10953 \defstringchar^^d4\defstringchar^^d5\defstringchar^^d6\defstringchar^^d7%
10954 \defstringchar^^d8\defstringchar^^d9\defstringchar^^da\defstringchar^^db%
10955 \defstringchar^^dc\defstringchar^^dd\defstringchar^^de\defstringchar^^df%
10957 \defstringchar^^e0\defstringchar^^e1\defstringchar^^e2\defstringchar^^e3%
10958 \defstringchar^^e4\defstringchar^^e5\defstringchar^^e6\defstringchar^^e7%
10959 \defstringchar^^e8\defstringchar^^e9\defstringchar^^ea\defstringchar^^eb%
10960 \defstringchar^^ec\defstringchar^^ed\defstringchar^^ee\defstringchar^^ef%
10962 \defstringchar^^f0\defstringchar^^f1\defstringchar^^f2\defstringchar^^f3%
10963 \defstringchar^^f4\defstringchar^^f5\defstringchar^^f6\defstringchar^^f7%
10964 \defstringchar^^f8\defstringchar^^f9\defstringchar^^fa\defstringchar^^fb%
10965 \defstringchar^^fc\defstringchar^^fd\defstringchar^^fe\defstringchar^^ff%
10968 % Write characters literally, instead of using active definitions for
10969 % printing the correct glyphs.
10970 \def\passthroughcharacters{%
10971 \iftxiusebytewiseio
10972 \nonasciistringdefs
10973 \else
10974 \passthroughcharstrue
10979 % define all the unicode characters we know about, for the sake of @U.
10980 \iftxinativeunicodecapable
10981 \nativeunicodechardefsatu
10982 \else
10983 \utfeightchardefs
10987 % Make non-ASCII characters printable again for compatibility with
10988 % existing Texinfo documents that may use them, even without declaring a
10989 % document encoding.
10991 \setnonasciicharscatcode \other
10994 \message{formatting,}
10996 \newdimen\defaultparindent \defaultparindent = 15pt
10998 \chapheadingskip = 15pt plus 4pt minus 2pt
10999 \secheadingskip = 12pt plus 3pt minus 2pt
11000 \subsecheadingskip = 9pt plus 2pt minus 2pt
11002 % Prevent underfull vbox error messages.
11003 \vbadness = 10000
11005 % Don't be very finicky about underfull hboxes, either.
11006 \hbadness = 6666
11008 % Following George Bush, get rid of widows and orphans.
11009 \widowpenalty=10000
11010 \clubpenalty=10000
11012 % Use TeX 3.0's \emergencystretch to help line breaking, but if we're
11013 % using an old version of TeX, don't do anything. We want the amount of
11014 % stretch added to depend on the line length, hence the dependence on
11015 % \hsize. We call this whenever the paper size is set.
11017 \def\setemergencystretch{%
11018 \ifx\emergencystretch\thisisundefined
11019 % Allow us to assign to \emergencystretch anyway.
11020 \def\emergencystretch{\dimen0}%
11021 \else
11022 \emergencystretch = .15\hsize
11026 % Parameters in order: 1) textheight; 2) textwidth;
11027 % 3) voffset; 4) hoffset; 5) binding offset; 6) topskip;
11028 % 7) physical page height; 8) physical page width.
11030 % We also call \setleading{\textleading}, so the caller should define
11031 % \textleading. The caller should also set \parskip.
11033 \def\internalpagesizes#1#2#3#4#5#6#7#8{%
11034 \voffset = #3\relax
11035 \topskip = #6\relax
11036 \splittopskip = \topskip
11038 \vsize = #1\relax
11039 \advance\vsize by \topskip
11040 \outervsize = \vsize
11041 \advance\outervsize by 2\topandbottommargin
11042 \txipageheight = \vsize
11044 \hsize = #2\relax
11045 \outerhsize = \hsize
11046 \advance\outerhsize by 0.5in
11047 \txipagewidth = \hsize
11049 \normaloffset = #4\relax
11050 \bindingoffset = #5\relax
11052 \ifpdf
11053 \pdfpageheight #7\relax
11054 \pdfpagewidth #8\relax
11055 % if we don't reset these, they will remain at "1 true in" of
11056 % whatever layout pdftex was dumped with.
11057 \pdfhorigin = 1 true in
11058 \pdfvorigin = 1 true in
11061 \setleading{\textleading}
11063 \parindent = \defaultparindent
11064 \setemergencystretch
11067 % @letterpaper (the default).
11068 \def\letterpaper{{\globaldefs = 1
11069 \parskip = 3pt plus 2pt minus 1pt
11070 \textleading = 13.2pt
11072 % If page is nothing but text, make it come out even.
11073 \internalpagesizes{607.2pt}{6in}% that's 46 lines
11074 {\voffset}{.25in}%
11075 {\bindingoffset}{36pt}%
11076 {11in}{8.5in}%
11079 % Use @smallbook to reset parameters for 7x9.25 trim size.
11080 \def\smallbook{{\globaldefs = 1
11081 \parskip = 2pt plus 1pt
11082 \textleading = 12pt
11084 \internalpagesizes{7.5in}{5in}%
11085 {-.2in}{0in}%
11086 {\bindingoffset}{16pt}%
11087 {9.25in}{7in}%
11089 \lispnarrowing = 0.3in
11090 \tolerance = 700
11091 \hfuzz = 1pt
11092 \contentsrightmargin = 0pt
11093 \defbodyindent = .5cm
11096 % Use @smallerbook to reset parameters for 6x9 trim size.
11097 % (Just testing, parameters still in flux.)
11098 \def\smallerbook{{\globaldefs = 1
11099 \parskip = 1.5pt plus 1pt
11100 \textleading = 12pt
11102 \internalpagesizes{7.4in}{4.8in}%
11103 {-.2in}{-.4in}%
11104 {0pt}{14pt}%
11105 {9in}{6in}%
11107 \lispnarrowing = 0.25in
11108 \tolerance = 700
11109 \hfuzz = 1pt
11110 \contentsrightmargin = 0pt
11111 \defbodyindent = .4cm
11114 % Use @afourpaper to print on European A4 paper.
11115 \def\afourpaper{{\globaldefs = 1
11116 \parskip = 3pt plus 2pt minus 1pt
11117 \textleading = 13.2pt
11119 % Double-side printing via postscript on Laserjet 4050
11120 % prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm.
11121 % To change the settings for a different printer or situation, adjust
11122 % \normaloffset until the front-side and back-side texts align. Then
11123 % do the same for \bindingoffset. You can set these for testing in
11124 % your texinfo source file like this:
11125 % @tex
11126 % \global\normaloffset = -6mm
11127 % \global\bindingoffset = 10mm
11128 % @end tex
11129 \internalpagesizes{673.2pt}{160mm}% that's 51 lines
11130 {\voffset}{\hoffset}%
11131 {\bindingoffset}{44pt}%
11132 {297mm}{210mm}%
11134 \tolerance = 700
11135 \hfuzz = 1pt
11136 \contentsrightmargin = 0pt
11137 \defbodyindent = 5mm
11140 % Use @afivepaper to print on European A5 paper.
11141 % From romildo@urano.iceb.ufop.br, 2 July 2000.
11142 % He also recommends making @example and @lisp be small.
11143 \def\afivepaper{{\globaldefs = 1
11144 \parskip = 2pt plus 1pt minus 0.1pt
11145 \textleading = 12.5pt
11147 \internalpagesizes{160mm}{120mm}%
11148 {\voffset}{\hoffset}%
11149 {\bindingoffset}{8pt}%
11150 {210mm}{148mm}%
11152 \lispnarrowing = 0.2in
11153 \tolerance = 800
11154 \hfuzz = 1.2pt
11155 \contentsrightmargin = 0pt
11156 \defbodyindent = 2mm
11157 \tableindent = 12mm
11160 % A specific text layout, 24x15cm overall, intended for A4 paper.
11161 \def\afourlatex{{\globaldefs = 1
11162 \afourpaper
11163 \internalpagesizes{237mm}{150mm}%
11164 {\voffset}{4.6mm}%
11165 {\bindingoffset}{7mm}%
11166 {297mm}{210mm}%
11168 % Must explicitly reset to 0 because we call \afourpaper.
11169 \globaldefs = 0
11172 % Use @afourwide to print on A4 paper in landscape format.
11173 \def\afourwide{{\globaldefs = 1
11174 \afourpaper
11175 \internalpagesizes{241mm}{165mm}%
11176 {\voffset}{-2.95mm}%
11177 {\bindingoffset}{7mm}%
11178 {297mm}{210mm}%
11179 \globaldefs = 0
11182 % @pagesizes TEXTHEIGHT[,TEXTWIDTH]
11183 % Perhaps we should allow setting the margins, \topskip, \parskip,
11184 % and/or leading, also. Or perhaps we should compute them somehow.
11186 \parseargdef\pagesizes{\pagesizesyyy #1,,\finish}
11187 \def\pagesizesyyy#1,#2,#3\finish{{%
11188 \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi
11189 \globaldefs = 1
11191 \parskip = 3pt plus 2pt minus 1pt
11192 \setleading{\textleading}%
11194 \dimen0 = #1\relax
11195 \advance\dimen0 by \voffset
11197 \dimen2 = \hsize
11198 \advance\dimen2 by \normaloffset
11200 \internalpagesizes{#1}{\hsize}%
11201 {\voffset}{\normaloffset}%
11202 {\bindingoffset}{44pt}%
11203 {\dimen0}{\dimen2}%
11206 % Set default to letter.
11208 \letterpaper
11211 \message{and turning on texinfo input format.}
11213 \def^^L{\par} % remove \outer, so ^L can appear in an @comment
11215 % DEL is a comment character, in case @c does not suffice.
11216 \catcode`\^^? = 14
11218 % Define macros to output various characters with catcode for normal text.
11219 \catcode`\"=\other \def\normaldoublequote{"}
11220 \catcode`\$=\other \def\normaldollar{$}%$ font-lock fix
11221 \catcode`\+=\other \def\normalplus{+}
11222 \catcode`\<=\other \def\normalless{<}
11223 \catcode`\>=\other \def\normalgreater{>}
11224 \catcode`\^=\other \def\normalcaret{^}
11225 \catcode`\_=\other \def\normalunderscore{_}
11226 \catcode`\|=\other \def\normalverticalbar{|}
11227 \catcode`\~=\other \def\normaltilde{~}
11229 % This macro is used to make a character print one way in \tt
11230 % (where it can probably be output as-is), and another way in other fonts,
11231 % where something hairier probably needs to be done.
11233 % #1 is what to print if we are indeed using \tt; #2 is what to print
11234 % otherwise. Since all the Computer Modern typewriter fonts have zero
11235 % interword stretch (and shrink), and it is reasonable to expect all
11236 % typewriter fonts to have this, we can check that font parameter.
11238 \def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi}
11240 % Same as above, but check for italic font. Actually this also catches
11241 % non-italic slanted fonts since it is impossible to distinguish them from
11242 % italic fonts. But since this is only used by $ and it uses \sl anyway
11243 % this is not a problem.
11244 \def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi}
11246 % Set catcodes for Texinfo file
11248 % Active characters for printing the wanted glyph.
11249 % Most of these we simply print from the \tt font, but for some, we can
11250 % use math or other variants that look better in normal text.
11252 \catcode`\"=\active
11253 \def\activedoublequote{{\tt\char34}}
11254 \let"=\activedoublequote
11255 \catcode`\~=\active \def\activetilde{{\tt\char126}} \let~ = \activetilde
11256 \chardef\hatchar=`\^
11257 \catcode`\^=\active \def\activehat{{\tt \hatchar}} \let^ = \activehat
11259 \catcode`\_=\active
11260 \def_{\ifusingtt\normalunderscore\_}
11261 \def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em }
11262 \let\realunder=_
11264 \catcode`\|=\active \def|{{\tt\char124}}
11266 \chardef \less=`\<
11267 \catcode`\<=\active \def\activeless{{\tt \less}}\let< = \activeless
11268 \chardef \gtr=`\>
11269 \catcode`\>=\active \def\activegtr{{\tt \gtr}}\let> = \activegtr
11270 \catcode`\+=\active \def+{{\tt \char 43}}
11271 \catcode`\$=\active \def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix
11272 \catcode`\-=\active \let-=\normaldash
11275 % used for headline/footline in the output routine, in case the page
11276 % breaks in the middle of an @tex block.
11277 \def\texinfochars{%
11278 \let< = \activeless
11279 \let> = \activegtr
11280 \let~ = \activetilde
11281 \let^ = \activehat
11282 \markupsetuplqdefault \markupsetuprqdefault
11283 \let\b = \strong
11284 \let\i = \smartitalic
11285 % in principle, all other definitions in \tex have to be undone too.
11288 % Used sometimes to turn off (effectively) the active characters even after
11289 % parsing them.
11290 \def\turnoffactive{%
11291 \normalturnoffactive
11292 \otherbackslash
11295 \catcode`\@=0
11297 % \backslashcurfont outputs one backslash character in current font,
11298 % as in \char`\\.
11299 \global\chardef\backslashcurfont=`\\
11300 \global\let\rawbackslashxx=\backslashcurfont % let existing .??s files work
11302 % \realbackslash is an actual character `\' with catcode other, and
11303 % \doublebackslash is two of them (for the pdf outlines).
11304 {\catcode`\\=\other @gdef@realbackslash{\} @gdef@doublebackslash{\\}}
11306 % In Texinfo, backslash is an active character; it prints the backslash
11307 % in fixed width font.
11308 \catcode`\\=\active % @ for escape char from now on.
11310 % Print a typewriter backslash. For math mode, we can't simply use
11311 % \backslashcurfont: the story here is that in math mode, the \char
11312 % of \backslashcurfont ends up printing the roman \ from the math symbol
11313 % font (because \char in math mode uses the \mathcode, and plain.tex
11314 % sets \mathcode`\\="026E). Hence we use an explicit \mathchar,
11315 % which is the decimal equivalent of "715c (class 7, e.g., use \fam;
11316 % ignored family value; char position "5C). We can't use " for the
11317 % usual hex value because it has already been made active.
11319 @def@ttbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi}}
11320 @let@backslashchar = @ttbackslash % @backslashchar{} is for user documents.
11322 % \rawbackslash defines an active \ to do \backslashcurfont.
11323 % \otherbackslash defines an active \ to be a literal `\' character with
11324 % catcode other. We switch back and forth between these.
11325 @gdef@rawbackslash{@let\=@backslashcurfont}
11326 @gdef@otherbackslash{@let\=@realbackslash}
11328 % Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
11329 % the literal character `\'.
11331 {@catcode`- = @active
11332 @gdef@normalturnoffactive{%
11333 @passthroughcharacters
11334 @let-=@normaldash
11335 @let"=@normaldoublequote
11336 @let$=@normaldollar %$ font-lock fix
11337 @let+=@normalplus
11338 @let<=@normalless
11339 @let>=@normalgreater
11340 @let^=@normalcaret
11341 @let_=@normalunderscore
11342 @let|=@normalverticalbar
11343 @let~=@normaltilde
11344 @let\=@ttbackslash
11345 @markupsetuplqdefault
11346 @markupsetuprqdefault
11347 @unsepspaces
11351 % If a .fmt file is being used, characters that might appear in a file
11352 % name cannot be active until we have parsed the command line.
11353 % So turn them off again, and have @fixbackslash turn them back on.
11354 @catcode`+=@other @catcode`@_=@other
11356 % \enablebackslashhack - allow file to begin `\input texinfo'
11358 % If a .fmt file is being used, we don't want the `\input texinfo' to show up.
11359 % That is what \eatinput is for; after that, the `\' should revert to printing
11360 % a backslash.
11361 % If the file did not have a `\input texinfo', then it is turned off after
11362 % the first line; otherwise the first `\' in the file would cause an error.
11363 % This is used on the very last line of this file, texinfo.tex.
11364 % We also use @c to call @fixbackslash, in case ends of lines are hidden.
11366 @catcode`@^=7
11367 @catcode`@^^M=13@gdef@enablebackslashhack{%
11368 @global@let\ = @eatinput%
11369 @catcode`@^^M=13%
11370 @def@c{@fixbackslash@c}%
11371 % Definition for the newline at the end of this file.
11372 @def ^^M{@let^^M@secondlinenl}%
11373 % Definition for a newline in the main Texinfo file.
11374 @gdef @secondlinenl{@fixbackslash}%
11377 {@catcode`@^=7 @catcode`@^^M=13%
11378 @gdef@eatinput input texinfo#1^^M{@fixbackslash}}
11380 % Emergency active definition of newline, in case an active newline token
11381 % appears by mistake.
11382 {@catcode`@^=7 @catcode13=13%
11383 @gdef@enableemergencynewline{%
11384 @gdef^^M{%
11385 @par%
11386 %<warning: active newline>@par%
11390 @gdef@fixbackslash{%
11391 @ifx\@eatinput @let\ = @ttbackslash @fi
11392 @catcode13=5 % regular end of line
11393 @enableemergencynewline
11394 @let@c=@texinfoc
11395 % Also turn back on active characters that might appear in the input
11396 % file name, in case not using a pre-dumped format.
11397 @catcode`+=@active
11398 @catcode`@_=@active
11400 % If texinfo.cnf is present on the system, read it.
11401 % Useful for site-wide @afourpaper, etc. This macro, @fixbackslash, gets
11402 % called at the beginning of every Texinfo file. Not opening texinfo.cnf
11403 % directly in this file, texinfo.tex, makes it possible to make a format
11404 % file for Texinfo.
11406 @openin 1 texinfo.cnf
11407 @ifeof 1 @else @input texinfo.cnf @fi
11408 @closein 1
11412 % Say @foo, not \foo, in error messages.
11413 @escapechar = `@@
11415 % These (along with & and #) are made active for url-breaking, so need
11416 % active definitions as the normal characters.
11417 @def@normaldot{.}
11418 @def@normalquest{?}
11419 @def@normalslash{/}
11421 % These look ok in all fonts, so just make them not special.
11422 % @hashchar{} gets its own user-level command, because of #line.
11423 @catcode`@& = @other @def@normalamp{&}
11424 @catcode`@# = @other @def@normalhash{#}
11425 @catcode`@% = @other @def@normalpercent{%}
11427 @let @hashchar = @normalhash
11429 @c Finally, make ` and ' active, so that txicodequoteundirected and
11430 @c txicodequotebacktick work right in, e.g., @w{@code{`foo'}}. If we
11431 @c don't make ` and ' active, @code will not get them as active chars.
11432 @c Do this last of all since we use ` in the previous @catcode assignments.
11433 @catcode`@'=@active
11434 @catcode`@`=@active
11435 @markupsetuplqdefault
11436 @markupsetuprqdefault
11438 @c Local variables:
11439 @c eval: (add-hook 'write-file-hooks 'time-stamp)
11440 @c page-delimiter: "^\\\\message\\|emacs-page"
11441 @c time-stamp-start: "def\\\\texinfoversion{"
11442 @c time-stamp-format: "%:y-%02m-%02d.%02H"
11443 @c time-stamp-end: "}"
11444 @c End:
11446 @c vim:sw=2:
11448 @ignore
11449 arch-tag: e1b36e32-c96e-4135-a41a-0b2efa2ea115
11450 @end ignore
11451 @enablebackslashhack