beta-0.89.2
[luatex.git] / source / build-aux / texinfo.tex
blob08baf5da257486d0a8d066b025dfc2e3c706b543
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-16.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
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
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 \openin 1 uptex.tex % upTeX has UTF8-UTF16 cmap
1595 \ifeof 1
1596 % upTeX does not exist. To use UTF8-UCS2 cmap.
1597 % In this case, non-BMP characters (over U+FFFF) can not be used.
1598 \special{pdf:tounicode UTF8-UCS2}
1599 \else
1600 % upTeX exists. To use UTF8-UTF16 cmap.
1601 % Non-BMP characters (over U+FFFF) can be used.
1602 \special{pdf:tounicode UTF8-UTF16}
1607 % @image support for XeTeX
1609 \newif\ifxeteximgpdf
1610 \ifx\XeTeXrevision\thisisundefined
1611 \else
1613 % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto).
1614 \def\doxeteximage#1#2#3{%
1615 \def\xeteximagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}%
1616 \def\xeteximageheight{#3}\setbox2 = \hbox{\ignorespaces #3}%
1618 % XeTeX (and the PDF format) support .pdf, .png, .jpg (among
1619 % others). Let's try in that order, PDF first since if
1620 % someone has a scalable image, presumably better to use that than a
1621 % bitmap.
1622 \let\xeteximgext=\empty
1623 \xeteximgpdffalse
1624 \begingroup
1625 \openin 1 #1.pdf \ifeof 1
1626 \openin 1 #1.PDF \ifeof 1
1627 \openin 1 #1.png \ifeof 1
1628 \openin 1 #1.jpg \ifeof 1
1629 \openin 1 #1.jpeg \ifeof 1
1630 \openin 1 #1.JPG \ifeof 1
1631 \errmessage{Could not find image file #1 for XeTeX}%
1632 \else \gdef\xeteximgext{JPG}%
1634 \else \gdef\xeteximgext{jpeg}%
1636 \else \gdef\xeteximgext{jpg}%
1638 \else \gdef\xeteximgext{png}%
1640 \else \gdef\xeteximgext{PDF} \global\xeteximgpdftrue%
1642 \else \gdef\xeteximgext{pdf} \global\xeteximgpdftrue%
1644 \closein 1
1645 \endgroup
1647 \ifxeteximgpdf
1648 \XeTeXpdffile "#1".\xeteximgext ""
1649 \else
1650 \XeTeXpicfile "#1".\xeteximgext ""
1652 \ifdim \wd0 >0pt width \xeteximagewidth \fi
1653 \ifdim \wd2 >0pt height \xeteximageheight \fi \relax
1657 \message{fonts,}
1659 % Change the current font style to #1, remembering it in \curfontstyle.
1660 % For now, we do not accumulate font styles: @b{@i{foo}} prints foo in
1661 % italics, not bold italics.
1663 \def\setfontstyle#1{%
1664 \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd.
1665 \csname ten#1\endcsname % change the current font
1668 % Select #1 fonts with the current style.
1670 \def\selectfonts#1{\csname #1fonts\endcsname \csname\curfontstyle\endcsname}
1672 \def\rm{\fam=0 \setfontstyle{rm}}
1673 \def\it{\fam=\itfam \setfontstyle{it}}
1674 \def\sl{\fam=\slfam \setfontstyle{sl}}
1675 \def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf}
1676 \def\tt{\fam=\ttfam \setfontstyle{tt}}
1678 % Unfortunately, we have to override this for titles and the like, since
1679 % in those cases "rm" is bold. Sigh.
1680 \def\rmisbold{\rm\def\curfontstyle{bf}}
1682 % Texinfo sort of supports the sans serif font style, which plain TeX does not.
1683 % So we set up a \sf.
1684 \newfam\sffam
1685 \def\sf{\fam=\sffam \setfontstyle{sf}}
1686 \let\li = \sf % Sometimes we call it \li, not \sf.
1688 % We don't need math for this font style.
1689 \def\ttsl{\setfontstyle{ttsl}}
1692 % Set the baselineskip to #1, and the lineskip and strut size
1693 % correspondingly. There is no deep meaning behind these magic numbers
1694 % used as factors; they just match (closely enough) what Knuth defined.
1696 \def\lineskipfactor{.08333}
1697 \def\strutheightpercent{.70833}
1698 \def\strutdepthpercent {.29167}
1700 % can get a sort of poor man's double spacing by redefining this.
1701 \def\baselinefactor{1}
1703 \newdimen\textleading
1704 \def\setleading#1{%
1705 \dimen0 = #1\relax
1706 \normalbaselineskip = \baselinefactor\dimen0
1707 \normallineskip = \lineskipfactor\normalbaselineskip
1708 \normalbaselines
1709 \setbox\strutbox =\hbox{%
1710 \vrule width0pt height\strutheightpercent\baselineskip
1711 depth \strutdepthpercent \baselineskip
1715 % PDF CMaps. See also LaTeX's t1.cmap.
1717 % do nothing with this by default.
1718 \expandafter\let\csname cmapOT1\endcsname\gobble
1719 \expandafter\let\csname cmapOT1IT\endcsname\gobble
1720 \expandafter\let\csname cmapOT1TT\endcsname\gobble
1722 % if we are producing pdf, and we have \pdffontattr, then define cmaps.
1723 % (\pdffontattr was introduced many years ago, but people still run
1724 % older pdftex's; it's easy to conditionalize, so we do.)
1725 \ifpdf \ifx\pdffontattr\thisisundefined \else
1726 \begingroup
1727 \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
1728 \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
1729 %%DocumentNeededResources: ProcSet (CIDInit)
1730 %%IncludeResource: ProcSet (CIDInit)
1731 %%BeginResource: CMap (TeX-OT1-0)
1732 %%Title: (TeX-OT1-0 TeX OT1 0)
1733 %%Version: 1.000
1734 %%EndComments
1735 /CIDInit /ProcSet findresource begin
1736 12 dict begin
1737 begincmap
1738 /CIDSystemInfo
1739 << /Registry (TeX)
1740 /Ordering (OT1)
1741 /Supplement 0
1742 >> def
1743 /CMapName /TeX-OT1-0 def
1744 /CMapType 2 def
1745 1 begincodespacerange
1746 <00> <7F>
1747 endcodespacerange
1748 8 beginbfrange
1749 <00> <01> <0393>
1750 <09> <0A> <03A8>
1751 <23> <26> <0023>
1752 <28> <3B> <0028>
1753 <3F> <5B> <003F>
1754 <5D> <5E> <005D>
1755 <61> <7A> <0061>
1756 <7B> <7C> <2013>
1757 endbfrange
1758 40 beginbfchar
1759 <02> <0398>
1760 <03> <039B>
1761 <04> <039E>
1762 <05> <03A0>
1763 <06> <03A3>
1764 <07> <03D2>
1765 <08> <03A6>
1766 <0B> <00660066>
1767 <0C> <00660069>
1768 <0D> <0066006C>
1769 <0E> <006600660069>
1770 <0F> <00660066006C>
1771 <10> <0131>
1772 <11> <0237>
1773 <12> <0060>
1774 <13> <00B4>
1775 <14> <02C7>
1776 <15> <02D8>
1777 <16> <00AF>
1778 <17> <02DA>
1779 <18> <00B8>
1780 <19> <00DF>
1781 <1A> <00E6>
1782 <1B> <0153>
1783 <1C> <00F8>
1784 <1D> <00C6>
1785 <1E> <0152>
1786 <1F> <00D8>
1787 <21> <0021>
1788 <22> <201D>
1789 <27> <2019>
1790 <3C> <00A1>
1791 <3D> <003D>
1792 <3E> <00BF>
1793 <5C> <201C>
1794 <5F> <02D9>
1795 <60> <2018>
1796 <7D> <02DD>
1797 <7E> <007E>
1798 <7F> <00A8>
1799 endbfchar
1800 endcmap
1801 CMapName currentdict /CMap defineresource pop
1804 %%EndResource
1805 %%EOF
1806 }\endgroup
1807 \expandafter\edef\csname cmapOT1\endcsname#1{%
1808 \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
1811 % \cmapOT1IT
1812 \begingroup
1813 \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
1814 \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
1815 %%DocumentNeededResources: ProcSet (CIDInit)
1816 %%IncludeResource: ProcSet (CIDInit)
1817 %%BeginResource: CMap (TeX-OT1IT-0)
1818 %%Title: (TeX-OT1IT-0 TeX OT1IT 0)
1819 %%Version: 1.000
1820 %%EndComments
1821 /CIDInit /ProcSet findresource begin
1822 12 dict begin
1823 begincmap
1824 /CIDSystemInfo
1825 << /Registry (TeX)
1826 /Ordering (OT1IT)
1827 /Supplement 0
1828 >> def
1829 /CMapName /TeX-OT1IT-0 def
1830 /CMapType 2 def
1831 1 begincodespacerange
1832 <00> <7F>
1833 endcodespacerange
1834 8 beginbfrange
1835 <00> <01> <0393>
1836 <09> <0A> <03A8>
1837 <25> <26> <0025>
1838 <28> <3B> <0028>
1839 <3F> <5B> <003F>
1840 <5D> <5E> <005D>
1841 <61> <7A> <0061>
1842 <7B> <7C> <2013>
1843 endbfrange
1844 42 beginbfchar
1845 <02> <0398>
1846 <03> <039B>
1847 <04> <039E>
1848 <05> <03A0>
1849 <06> <03A3>
1850 <07> <03D2>
1851 <08> <03A6>
1852 <0B> <00660066>
1853 <0C> <00660069>
1854 <0D> <0066006C>
1855 <0E> <006600660069>
1856 <0F> <00660066006C>
1857 <10> <0131>
1858 <11> <0237>
1859 <12> <0060>
1860 <13> <00B4>
1861 <14> <02C7>
1862 <15> <02D8>
1863 <16> <00AF>
1864 <17> <02DA>
1865 <18> <00B8>
1866 <19> <00DF>
1867 <1A> <00E6>
1868 <1B> <0153>
1869 <1C> <00F8>
1870 <1D> <00C6>
1871 <1E> <0152>
1872 <1F> <00D8>
1873 <21> <0021>
1874 <22> <201D>
1875 <23> <0023>
1876 <24> <00A3>
1877 <27> <2019>
1878 <3C> <00A1>
1879 <3D> <003D>
1880 <3E> <00BF>
1881 <5C> <201C>
1882 <5F> <02D9>
1883 <60> <2018>
1884 <7D> <02DD>
1885 <7E> <007E>
1886 <7F> <00A8>
1887 endbfchar
1888 endcmap
1889 CMapName currentdict /CMap defineresource pop
1892 %%EndResource
1893 %%EOF
1894 }\endgroup
1895 \expandafter\edef\csname cmapOT1IT\endcsname#1{%
1896 \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
1899 % \cmapOT1TT
1900 \begingroup
1901 \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
1902 \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
1903 %%DocumentNeededResources: ProcSet (CIDInit)
1904 %%IncludeResource: ProcSet (CIDInit)
1905 %%BeginResource: CMap (TeX-OT1TT-0)
1906 %%Title: (TeX-OT1TT-0 TeX OT1TT 0)
1907 %%Version: 1.000
1908 %%EndComments
1909 /CIDInit /ProcSet findresource begin
1910 12 dict begin
1911 begincmap
1912 /CIDSystemInfo
1913 << /Registry (TeX)
1914 /Ordering (OT1TT)
1915 /Supplement 0
1916 >> def
1917 /CMapName /TeX-OT1TT-0 def
1918 /CMapType 2 def
1919 1 begincodespacerange
1920 <00> <7F>
1921 endcodespacerange
1922 5 beginbfrange
1923 <00> <01> <0393>
1924 <09> <0A> <03A8>
1925 <21> <26> <0021>
1926 <28> <5F> <0028>
1927 <61> <7E> <0061>
1928 endbfrange
1929 32 beginbfchar
1930 <02> <0398>
1931 <03> <039B>
1932 <04> <039E>
1933 <05> <03A0>
1934 <06> <03A3>
1935 <07> <03D2>
1936 <08> <03A6>
1937 <0B> <2191>
1938 <0C> <2193>
1939 <0D> <0027>
1940 <0E> <00A1>
1941 <0F> <00BF>
1942 <10> <0131>
1943 <11> <0237>
1944 <12> <0060>
1945 <13> <00B4>
1946 <14> <02C7>
1947 <15> <02D8>
1948 <16> <00AF>
1949 <17> <02DA>
1950 <18> <00B8>
1951 <19> <00DF>
1952 <1A> <00E6>
1953 <1B> <0153>
1954 <1C> <00F8>
1955 <1D> <00C6>
1956 <1E> <0152>
1957 <1F> <00D8>
1958 <20> <2423>
1959 <27> <2019>
1960 <60> <2018>
1961 <7F> <00A8>
1962 endbfchar
1963 endcmap
1964 CMapName currentdict /CMap defineresource pop
1967 %%EndResource
1968 %%EOF
1969 }\endgroup
1970 \expandafter\edef\csname cmapOT1TT\endcsname#1{%
1971 \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}%
1973 \fi\fi
1976 % Set the font macro #1 to the font named \fontprefix#2.
1977 % #3 is the font's design size, #4 is a scale factor, #5 is the CMap
1978 % encoding (only OT1, OT1IT and OT1TT are allowed, or empty to omit).
1979 % Example:
1980 % #1 = \textrm
1981 % #2 = \rmshape
1982 % #3 = 10
1983 % #4 = \mainmagstep
1984 % #5 = OT1
1986 \def\setfont#1#2#3#4#5{%
1987 \font#1=\fontprefix#2#3 scaled #4
1988 \csname cmap#5\endcsname#1%
1990 % This is what gets called when #5 of \setfont is empty.
1991 \let\cmap\gobble
1993 % (end of cmaps)
1995 % Use cm as the default font prefix.
1996 % To specify the font prefix, you must define \fontprefix
1997 % before you read in texinfo.tex.
1998 \ifx\fontprefix\thisisundefined
1999 \def\fontprefix{cm}
2001 % Support font families that don't use the same naming scheme as CM.
2002 \def\rmshape{r}
2003 \def\rmbshape{bx} % where the normal face is bold
2004 \def\bfshape{b}
2005 \def\bxshape{bx}
2006 \def\ttshape{tt}
2007 \def\ttbshape{tt}
2008 \def\ttslshape{sltt}
2009 \def\itshape{ti}
2010 \def\itbshape{bxti}
2011 \def\slshape{sl}
2012 \def\slbshape{bxsl}
2013 \def\sfshape{ss}
2014 \def\sfbshape{ss}
2015 \def\scshape{csc}
2016 \def\scbshape{csc}
2018 % Definitions for a main text size of 11pt. (The default in Texinfo.)
2020 \def\definetextfontsizexi{%
2021 % Text fonts (11.2pt, magstep1).
2022 \def\textnominalsize{11pt}
2023 \edef\mainmagstep{\magstephalf}
2024 \setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
2025 \setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
2026 \setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
2027 \setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
2028 \setfont\textsl\slshape{10}{\mainmagstep}{OT1}
2029 \setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
2030 \setfont\textsc\scshape{10}{\mainmagstep}{OT1}
2031 \setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
2032 \font\texti=cmmi10 scaled \mainmagstep
2033 \font\textsy=cmsy10 scaled \mainmagstep
2034 \def\textecsize{1095}
2036 % A few fonts for @defun names and args.
2037 \setfont\defbf\bfshape{10}{\magstep1}{OT1}
2038 \setfont\deftt\ttshape{10}{\magstep1}{OT1TT}
2039 \setfont\defsl\slshape{10}{\magstep1}{OT1TT}
2040 \setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT}
2041 \def\df{\let\tentt=\deftt \let\tenbf = \defbf
2042 \let\tenttsl=\defttsl \let\tensl=\defsl \bf}
2044 % Fonts for indices, footnotes, small examples (9pt).
2045 \def\smallnominalsize{9pt}
2046 \setfont\smallrm\rmshape{9}{1000}{OT1}
2047 \setfont\smalltt\ttshape{9}{1000}{OT1TT}
2048 \setfont\smallbf\bfshape{10}{900}{OT1}
2049 \setfont\smallit\itshape{9}{1000}{OT1IT}
2050 \setfont\smallsl\slshape{9}{1000}{OT1}
2051 \setfont\smallsf\sfshape{9}{1000}{OT1}
2052 \setfont\smallsc\scshape{10}{900}{OT1}
2053 \setfont\smallttsl\ttslshape{10}{900}{OT1TT}
2054 \font\smalli=cmmi9
2055 \font\smallsy=cmsy9
2056 \def\smallecsize{0900}
2058 % Fonts for small examples (8pt).
2059 \def\smallernominalsize{8pt}
2060 \setfont\smallerrm\rmshape{8}{1000}{OT1}
2061 \setfont\smallertt\ttshape{8}{1000}{OT1TT}
2062 \setfont\smallerbf\bfshape{10}{800}{OT1}
2063 \setfont\smallerit\itshape{8}{1000}{OT1IT}
2064 \setfont\smallersl\slshape{8}{1000}{OT1}
2065 \setfont\smallersf\sfshape{8}{1000}{OT1}
2066 \setfont\smallersc\scshape{10}{800}{OT1}
2067 \setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
2068 \font\smalleri=cmmi8
2069 \font\smallersy=cmsy8
2070 \def\smallerecsize{0800}
2072 % Fonts for title page (20.4pt):
2073 \def\titlenominalsize{20pt}
2074 \setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
2075 \setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
2076 \setfont\titlesl\slbshape{10}{\magstep4}{OT1}
2077 \setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
2078 \setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
2079 \setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
2080 \let\titlebf=\titlerm
2081 \setfont\titlesc\scbshape{10}{\magstep4}{OT1}
2082 \font\titlei=cmmi12 scaled \magstep3
2083 \font\titlesy=cmsy10 scaled \magstep4
2084 \def\titleecsize{2074}
2086 % Chapter (and unnumbered) fonts (17.28pt).
2087 \def\chapnominalsize{17pt}
2088 \setfont\chaprm\rmbshape{12}{\magstep2}{OT1}
2089 \setfont\chapit\itbshape{10}{\magstep3}{OT1IT}
2090 \setfont\chapsl\slbshape{10}{\magstep3}{OT1}
2091 \setfont\chaptt\ttbshape{12}{\magstep2}{OT1TT}
2092 \setfont\chapttsl\ttslshape{10}{\magstep3}{OT1TT}
2093 \setfont\chapsf\sfbshape{17}{1000}{OT1}
2094 \let\chapbf=\chaprm
2095 \setfont\chapsc\scbshape{10}{\magstep3}{OT1}
2096 \font\chapi=cmmi12 scaled \magstep2
2097 \font\chapsy=cmsy10 scaled \magstep3
2098 \def\chapecsize{1728}
2100 % Section fonts (14.4pt).
2101 \def\secnominalsize{14pt}
2102 \setfont\secrm\rmbshape{12}{\magstep1}{OT1}
2103 \setfont\secrmnotbold\rmshape{12}{\magstep1}{OT1}
2104 \setfont\secit\itbshape{10}{\magstep2}{OT1IT}
2105 \setfont\secsl\slbshape{10}{\magstep2}{OT1}
2106 \setfont\sectt\ttbshape{12}{\magstep1}{OT1TT}
2107 \setfont\secttsl\ttslshape{10}{\magstep2}{OT1TT}
2108 \setfont\secsf\sfbshape{12}{\magstep1}{OT1}
2109 \let\secbf\secrm
2110 \setfont\secsc\scbshape{10}{\magstep2}{OT1}
2111 \font\seci=cmmi12 scaled \magstep1
2112 \font\secsy=cmsy10 scaled \magstep2
2113 \def\sececsize{1440}
2115 % Subsection fonts (13.15pt).
2116 \def\ssecnominalsize{13pt}
2117 \setfont\ssecrm\rmbshape{12}{\magstephalf}{OT1}
2118 \setfont\ssecit\itbshape{10}{1315}{OT1IT}
2119 \setfont\ssecsl\slbshape{10}{1315}{OT1}
2120 \setfont\ssectt\ttbshape{12}{\magstephalf}{OT1TT}
2121 \setfont\ssecttsl\ttslshape{10}{1315}{OT1TT}
2122 \setfont\ssecsf\sfbshape{12}{\magstephalf}{OT1}
2123 \let\ssecbf\ssecrm
2124 \setfont\ssecsc\scbshape{10}{1315}{OT1}
2125 \font\sseci=cmmi12 scaled \magstephalf
2126 \font\ssecsy=cmsy10 scaled 1315
2127 \def\ssececsize{1200}
2129 % Reduced fonts for @acro in text (10pt).
2130 \def\reducednominalsize{10pt}
2131 \setfont\reducedrm\rmshape{10}{1000}{OT1}
2132 \setfont\reducedtt\ttshape{10}{1000}{OT1TT}
2133 \setfont\reducedbf\bfshape{10}{1000}{OT1}
2134 \setfont\reducedit\itshape{10}{1000}{OT1IT}
2135 \setfont\reducedsl\slshape{10}{1000}{OT1}
2136 \setfont\reducedsf\sfshape{10}{1000}{OT1}
2137 \setfont\reducedsc\scshape{10}{1000}{OT1}
2138 \setfont\reducedttsl\ttslshape{10}{1000}{OT1TT}
2139 \font\reducedi=cmmi10
2140 \font\reducedsy=cmsy10
2141 \def\reducedecsize{1000}
2143 \textleading = 13.2pt % line spacing for 11pt CM
2144 \textfonts % reset the current fonts
2146 } % end of 11pt text font size definitions, \definetextfontsizexi
2149 % Definitions to make the main text be 10pt Computer Modern, with
2150 % section, chapter, etc., sizes following suit. This is for the GNU
2151 % Press printing of the Emacs 22 manual. Maybe other manuals in the
2152 % future. Used with @smallbook, which sets the leading to 12pt.
2154 \def\definetextfontsizex{%
2155 % Text fonts (10pt).
2156 \def\textnominalsize{10pt}
2157 \edef\mainmagstep{1000}
2158 \setfont\textrm\rmshape{10}{\mainmagstep}{OT1}
2159 \setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT}
2160 \setfont\textbf\bfshape{10}{\mainmagstep}{OT1}
2161 \setfont\textit\itshape{10}{\mainmagstep}{OT1IT}
2162 \setfont\textsl\slshape{10}{\mainmagstep}{OT1}
2163 \setfont\textsf\sfshape{10}{\mainmagstep}{OT1}
2164 \setfont\textsc\scshape{10}{\mainmagstep}{OT1}
2165 \setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT}
2166 \font\texti=cmmi10 scaled \mainmagstep
2167 \font\textsy=cmsy10 scaled \mainmagstep
2168 \def\textecsize{1000}
2170 % A few fonts for @defun names and args.
2171 \setfont\defbf\bfshape{10}{\magstephalf}{OT1}
2172 \setfont\deftt\ttshape{10}{\magstephalf}{OT1TT}
2173 \setfont\defsl\slshape{10}{\magstephalf}{OT1TT}
2174 \setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT}
2175 \def\df{\let\tentt=\deftt \let\tenbf = \defbf
2176 \let\tensl=\defsl \let\tenttsl=\defttsl \bf}
2178 % Fonts for indices, footnotes, small examples (9pt).
2179 \def\smallnominalsize{9pt}
2180 \setfont\smallrm\rmshape{9}{1000}{OT1}
2181 \setfont\smalltt\ttshape{9}{1000}{OT1TT}
2182 \setfont\smallbf\bfshape{10}{900}{OT1}
2183 \setfont\smallit\itshape{9}{1000}{OT1IT}
2184 \setfont\smallsl\slshape{9}{1000}{OT1}
2185 \setfont\smallsf\sfshape{9}{1000}{OT1}
2186 \setfont\smallsc\scshape{10}{900}{OT1}
2187 \setfont\smallttsl\ttslshape{10}{900}{OT1TT}
2188 \font\smalli=cmmi9
2189 \font\smallsy=cmsy9
2190 \def\smallecsize{0900}
2192 % Fonts for small examples (8pt).
2193 \def\smallernominalsize{8pt}
2194 \setfont\smallerrm\rmshape{8}{1000}{OT1}
2195 \setfont\smallertt\ttshape{8}{1000}{OT1TT}
2196 \setfont\smallerbf\bfshape{10}{800}{OT1}
2197 \setfont\smallerit\itshape{8}{1000}{OT1IT}
2198 \setfont\smallersl\slshape{8}{1000}{OT1}
2199 \setfont\smallersf\sfshape{8}{1000}{OT1}
2200 \setfont\smallersc\scshape{10}{800}{OT1}
2201 \setfont\smallerttsl\ttslshape{10}{800}{OT1TT}
2202 \font\smalleri=cmmi8
2203 \font\smallersy=cmsy8
2204 \def\smallerecsize{0800}
2206 % Fonts for title page (20.4pt):
2207 \def\titlenominalsize{20pt}
2208 \setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
2209 \setfont\titleit\itbshape{10}{\magstep4}{OT1IT}
2210 \setfont\titlesl\slbshape{10}{\magstep4}{OT1}
2211 \setfont\titlett\ttbshape{12}{\magstep3}{OT1TT}
2212 \setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT}
2213 \setfont\titlesf\sfbshape{17}{\magstep1}{OT1}
2214 \let\titlebf=\titlerm
2215 \setfont\titlesc\scbshape{10}{\magstep4}{OT1}
2216 \font\titlei=cmmi12 scaled \magstep3
2217 \font\titlesy=cmsy10 scaled \magstep4
2218 \def\titleecsize{2074}
2220 % Chapter fonts (14.4pt).
2221 \def\chapnominalsize{14pt}
2222 \setfont\chaprm\rmbshape{12}{\magstep1}{OT1}
2223 \setfont\chapit\itbshape{10}{\magstep2}{OT1IT}
2224 \setfont\chapsl\slbshape{10}{\magstep2}{OT1}
2225 \setfont\chaptt\ttbshape{12}{\magstep1}{OT1TT}
2226 \setfont\chapttsl\ttslshape{10}{\magstep2}{OT1TT}
2227 \setfont\chapsf\sfbshape{12}{\magstep1}{OT1}
2228 \let\chapbf\chaprm
2229 \setfont\chapsc\scbshape{10}{\magstep2}{OT1}
2230 \font\chapi=cmmi12 scaled \magstep1
2231 \font\chapsy=cmsy10 scaled \magstep2
2232 \def\chapecsize{1440}
2234 % Section fonts (12pt).
2235 \def\secnominalsize{12pt}
2236 \setfont\secrm\rmbshape{12}{1000}{OT1}
2237 \setfont\secit\itbshape{10}{\magstep1}{OT1IT}
2238 \setfont\secsl\slbshape{10}{\magstep1}{OT1}
2239 \setfont\sectt\ttbshape{12}{1000}{OT1TT}
2240 \setfont\secttsl\ttslshape{10}{\magstep1}{OT1TT}
2241 \setfont\secsf\sfbshape{12}{1000}{OT1}
2242 \let\secbf\secrm
2243 \setfont\secsc\scbshape{10}{\magstep1}{OT1}
2244 \font\seci=cmmi12
2245 \font\secsy=cmsy10 scaled \magstep1
2246 \def\sececsize{1200}
2248 % Subsection fonts (10pt).
2249 \def\ssecnominalsize{10pt}
2250 \setfont\ssecrm\rmbshape{10}{1000}{OT1}
2251 \setfont\ssecit\itbshape{10}{1000}{OT1IT}
2252 \setfont\ssecsl\slbshape{10}{1000}{OT1}
2253 \setfont\ssectt\ttbshape{10}{1000}{OT1TT}
2254 \setfont\ssecttsl\ttslshape{10}{1000}{OT1TT}
2255 \setfont\ssecsf\sfbshape{10}{1000}{OT1}
2256 \let\ssecbf\ssecrm
2257 \setfont\ssecsc\scbshape{10}{1000}{OT1}
2258 \font\sseci=cmmi10
2259 \font\ssecsy=cmsy10
2260 \def\ssececsize{1000}
2262 % Reduced fonts for @acro in text (9pt).
2263 \def\reducednominalsize{9pt}
2264 \setfont\reducedrm\rmshape{9}{1000}{OT1}
2265 \setfont\reducedtt\ttshape{9}{1000}{OT1TT}
2266 \setfont\reducedbf\bfshape{10}{900}{OT1}
2267 \setfont\reducedit\itshape{9}{1000}{OT1IT}
2268 \setfont\reducedsl\slshape{9}{1000}{OT1}
2269 \setfont\reducedsf\sfshape{9}{1000}{OT1}
2270 \setfont\reducedsc\scshape{10}{900}{OT1}
2271 \setfont\reducedttsl\ttslshape{10}{900}{OT1TT}
2272 \font\reducedi=cmmi9
2273 \font\reducedsy=cmsy9
2274 \def\reducedecsize{0900}
2276 \divide\parskip by 2 % reduce space between paragraphs
2277 \textleading = 12pt % line spacing for 10pt CM
2278 \textfonts % reset the current fonts
2280 } % end of 10pt text font size definitions, \definetextfontsizex
2283 % We provide the user-level command
2284 % @fonttextsize 10
2285 % (or 11) to redefine the text font size. pt is assumed.
2287 \def\xiword{11}
2288 \def\xword{10}
2289 \def\xwordpt{10pt}
2291 \parseargdef\fonttextsize{%
2292 \def\textsizearg{#1}%
2293 %\wlog{doing @fonttextsize \textsizearg}%
2295 % Set \globaldefs so that documents can use this inside @tex, since
2296 % makeinfo 4.8 does not support it, but we need it nonetheless.
2298 \begingroup \globaldefs=1
2299 \ifx\textsizearg\xword \definetextfontsizex
2300 \else \ifx\textsizearg\xiword \definetextfontsizexi
2301 \else
2302 \errhelp=\EMsimple
2303 \errmessage{@fonttextsize only supports `10' or `11', not `\textsizearg'}
2304 \fi\fi
2305 \endgroup
2308 % In order for the font changes to affect most math symbols and letters,
2309 % we have to define the \textfont of the standard families. We don't
2310 % bother to reset \scriptfont and \scriptscriptfont; awaiting user need.
2312 \def\resetmathfonts{%
2313 \textfont0=\tenrm \textfont1=\teni \textfont2=\tensy
2314 \textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf
2315 \textfont\ttfam=\tentt \textfont\sffam=\tensf
2318 % The font-changing commands redefine the meanings of \tenSTYLE, instead
2319 % of just \STYLE. We do this because \STYLE needs to also set the
2320 % current \fam for math mode. Our \STYLE (e.g., \rm) commands hardwire
2321 % \tenSTYLE to set the current font.
2323 % Each font-changing command also sets the names \lsize (one size lower)
2324 % and \lllsize (three sizes lower). These relative commands are used
2325 % in, e.g., the LaTeX logo and acronyms.
2327 % This all needs generalizing, badly.
2329 \def\textfonts{%
2330 \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl
2331 \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
2332 \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy
2333 \let\tenttsl=\textttsl
2334 \def\curfontsize{text}%
2335 \def\lsize{reduced}\def\lllsize{smaller}%
2336 \resetmathfonts \setleading{\textleading}}
2337 \def\titlefonts{%
2338 \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl
2339 \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc
2340 \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy
2341 \let\tenttsl=\titlettsl
2342 \def\curfontsize{title}%
2343 \def\lsize{chap}\def\lllsize{subsec}%
2344 \resetmathfonts \setleading{27pt}}
2345 \def\titlefont#1{{\titlefonts\rmisbold #1}}
2346 \def\chapfonts{%
2347 \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
2348 \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
2349 \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy
2350 \let\tenttsl=\chapttsl
2351 \def\curfontsize{chap}%
2352 \def\lsize{sec}\def\lllsize{text}%
2353 \resetmathfonts \setleading{19pt}}
2354 \def\secfonts{%
2355 \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl
2356 \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc
2357 \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy
2358 \let\tenttsl=\secttsl
2359 \def\curfontsize{sec}%
2360 \def\lsize{subsec}\def\lllsize{reduced}%
2361 \resetmathfonts \setleading{17pt}}
2362 \def\subsecfonts{%
2363 \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl
2364 \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc
2365 \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy
2366 \let\tenttsl=\ssecttsl
2367 \def\curfontsize{ssec}%
2368 \def\lsize{text}\def\lllsize{small}%
2369 \resetmathfonts \setleading{15pt}}
2370 \let\subsubsecfonts = \subsecfonts
2371 \def\reducedfonts{%
2372 \let\tenrm=\reducedrm \let\tenit=\reducedit \let\tensl=\reducedsl
2373 \let\tenbf=\reducedbf \let\tentt=\reducedtt \let\reducedcaps=\reducedsc
2374 \let\tensf=\reducedsf \let\teni=\reducedi \let\tensy=\reducedsy
2375 \let\tenttsl=\reducedttsl
2376 \def\curfontsize{reduced}%
2377 \def\lsize{small}\def\lllsize{smaller}%
2378 \resetmathfonts \setleading{10.5pt}}
2379 \def\smallfonts{%
2380 \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl
2381 \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc
2382 \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy
2383 \let\tenttsl=\smallttsl
2384 \def\curfontsize{small}%
2385 \def\lsize{smaller}\def\lllsize{smaller}%
2386 \resetmathfonts \setleading{10.5pt}}
2387 \def\smallerfonts{%
2388 \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl
2389 \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc
2390 \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy
2391 \let\tenttsl=\smallerttsl
2392 \def\curfontsize{smaller}%
2393 \def\lsize{smaller}\def\lllsize{smaller}%
2394 \resetmathfonts \setleading{9.5pt}}
2396 % Fonts for short table of contents.
2397 \setfont\shortcontrm\rmshape{12}{1000}{OT1}
2398 \setfont\shortcontbf\bfshape{10}{\magstep1}{OT1} % no cmb12
2399 \setfont\shortcontsl\slshape{12}{1000}{OT1}
2400 \setfont\shortconttt\ttshape{12}{1000}{OT1TT}
2402 % Define these just so they can be easily changed for other fonts.
2403 \def\angleleft{$\langle$}
2404 \def\angleright{$\rangle$}
2406 % Set the fonts to use with the @small... environments.
2407 \let\smallexamplefonts = \smallfonts
2409 % About \smallexamplefonts. If we use \smallfonts (9pt), @smallexample
2410 % can fit this many characters:
2411 % 8.5x11=86 smallbook=72 a4=90 a5=69
2412 % If we use \scriptfonts (8pt), then we can fit this many characters:
2413 % 8.5x11=90+ smallbook=80 a4=90+ a5=77
2414 % For me, subjectively, the few extra characters that fit aren't worth
2415 % the additional smallness of 8pt. So I'm making the default 9pt.
2417 % By the way, for comparison, here's what fits with @example (10pt):
2418 % 8.5x11=71 smallbook=60 a4=75 a5=58
2419 % --karl, 24jan03.
2421 % Set up the default fonts, so we can use them for creating boxes.
2423 \definetextfontsizexi
2426 \message{markup,}
2428 % Check if we are currently using a typewriter font. Since all the
2429 % Computer Modern typewriter fonts have zero interword stretch (and
2430 % shrink), and it is reasonable to expect all typewriter fonts to have
2431 % this property, we can check that font parameter.
2433 \def\ifmonospace{\ifdim\fontdimen3\font=0pt }
2435 % Markup style infrastructure. \defmarkupstylesetup\INITMACRO will
2436 % define and register \INITMACRO to be called on markup style changes.
2437 % \INITMACRO can check \currentmarkupstyle for the innermost
2438 % style and the set of \ifmarkupSTYLE switches for all styles
2439 % currently in effect.
2440 \newif\ifmarkupvar
2441 \newif\ifmarkupsamp
2442 \newif\ifmarkupkey
2443 %\newif\ifmarkupfile % @file == @samp.
2444 %\newif\ifmarkupoption % @option == @samp.
2445 \newif\ifmarkupcode
2446 \newif\ifmarkupkbd
2447 %\newif\ifmarkupenv % @env == @code.
2448 %\newif\ifmarkupcommand % @command == @code.
2449 \newif\ifmarkuptex % @tex (and part of @math, for now).
2450 \newif\ifmarkupexample
2451 \newif\ifmarkupverb
2452 \newif\ifmarkupverbatim
2454 \let\currentmarkupstyle\empty
2456 \def\setupmarkupstyle#1{%
2457 \csname markup#1true\endcsname
2458 \def\currentmarkupstyle{#1}%
2459 \markupstylesetup
2462 \let\markupstylesetup\empty
2464 \def\defmarkupstylesetup#1{%
2465 \expandafter\def\expandafter\markupstylesetup
2466 \expandafter{\markupstylesetup #1}%
2467 \def#1%
2470 % Markup style setup for left and right quotes.
2471 \defmarkupstylesetup\markupsetuplq{%
2472 \expandafter\let\expandafter \temp
2473 \csname markupsetuplq\currentmarkupstyle\endcsname
2474 \ifx\temp\relax \markupsetuplqdefault \else \temp \fi
2477 \defmarkupstylesetup\markupsetuprq{%
2478 \expandafter\let\expandafter \temp
2479 \csname markupsetuprq\currentmarkupstyle\endcsname
2480 \ifx\temp\relax \markupsetuprqdefault \else \temp \fi
2484 \catcode`\'=\active
2485 \catcode`\`=\active
2487 \gdef\markupsetuplqdefault{\let`\lq}
2488 \gdef\markupsetuprqdefault{\let'\rq}
2490 \gdef\markupsetcodequoteleft{\let`\codequoteleft}
2491 \gdef\markupsetcodequoteright{\let'\codequoteright}
2494 \let\markupsetuplqcode \markupsetcodequoteleft
2495 \let\markupsetuprqcode \markupsetcodequoteright
2497 \let\markupsetuplqexample \markupsetcodequoteleft
2498 \let\markupsetuprqexample \markupsetcodequoteright
2500 \let\markupsetuplqkbd \markupsetcodequoteleft
2501 \let\markupsetuprqkbd \markupsetcodequoteright
2503 \let\markupsetuplqsamp \markupsetcodequoteleft
2504 \let\markupsetuprqsamp \markupsetcodequoteright
2506 \let\markupsetuplqverb \markupsetcodequoteleft
2507 \let\markupsetuprqverb \markupsetcodequoteright
2509 \let\markupsetuplqverbatim \markupsetcodequoteleft
2510 \let\markupsetuprqverbatim \markupsetcodequoteright
2512 % Allow an option to not use regular directed right quote/apostrophe
2513 % (char 0x27), but instead the undirected quote from cmtt (char 0x0d).
2514 % The undirected quote is ugly, so don't make it the default, but it
2515 % works for pasting with more pdf viewers (at least evince), the
2516 % lilypond developers report. xpdf does work with the regular 0x27.
2518 \def\codequoteright{%
2519 \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax
2520 \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax
2522 \else \char'15 \fi
2523 \else \char'15 \fi
2526 % and a similar option for the left quote char vs. a grave accent.
2527 % Modern fonts display ASCII 0x60 as a grave accent, so some people like
2528 % the code environments to do likewise.
2530 \def\codequoteleft{%
2531 \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax
2532 \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax
2533 % [Knuth] pp. 380,381,391
2534 % \relax disables Spanish ligatures ?` and !` of \tt font.
2535 \relax`%
2536 \else \char'22 \fi
2537 \else \char'22 \fi
2540 % Commands to set the quote options.
2542 \parseargdef\codequoteundirected{%
2543 \def\temp{#1}%
2544 \ifx\temp\onword
2545 \expandafter\let\csname SETtxicodequoteundirected\endcsname
2546 = t%
2547 \else\ifx\temp\offword
2548 \expandafter\let\csname SETtxicodequoteundirected\endcsname
2549 = \relax
2550 \else
2551 \errhelp = \EMsimple
2552 \errmessage{Unknown @codequoteundirected value `\temp', must be on|off}%
2553 \fi\fi
2556 \parseargdef\codequotebacktick{%
2557 \def\temp{#1}%
2558 \ifx\temp\onword
2559 \expandafter\let\csname SETtxicodequotebacktick\endcsname
2560 = t%
2561 \else\ifx\temp\offword
2562 \expandafter\let\csname SETtxicodequotebacktick\endcsname
2563 = \relax
2564 \else
2565 \errhelp = \EMsimple
2566 \errmessage{Unknown @codequotebacktick value `\temp', must be on|off}%
2567 \fi\fi
2570 % [Knuth] pp. 380,381,391, disable Spanish ligatures ?` and !` of \tt font.
2571 \def\noligaturesquoteleft{\relax\lq}
2573 % Count depth in font-changes, for error checks
2574 \newcount\fontdepth \fontdepth=0
2576 % Font commands.
2578 % #1 is the font command (\sl or \it), #2 is the text to slant.
2579 % If we are in a monospaced environment, however, 1) always use \ttsl,
2580 % and 2) do not add an italic correction.
2581 \def\dosmartslant#1#2{%
2582 \ifusingtt
2583 {{\ttsl #2}\let\next=\relax}%
2584 {\def\next{{#1#2}\futurelet\next\smartitaliccorrection}}%
2585 \next
2587 \def\smartslanted{\dosmartslant\sl}
2588 \def\smartitalic{\dosmartslant\it}
2590 % Output an italic correction unless \next (presumed to be the following
2591 % character) is such as not to need one.
2592 \def\smartitaliccorrection{%
2593 \ifx\next,%
2594 \else\ifx\next-%
2595 \else\ifx\next.%
2596 \else\ifx\next\.%
2597 \else\ifx\next\comma%
2598 \else\ptexslash
2599 \fi\fi\fi\fi\fi
2600 \aftersmartic
2603 % Unconditional use \ttsl, and no ic. @var is set to this for defuns.
2604 \def\ttslanted#1{{\ttsl #1}}
2606 % @cite is like \smartslanted except unconditionally use \sl. We never want
2607 % ttsl for book titles, do we?
2608 \def\cite#1{{\sl #1}\futurelet\next\smartitaliccorrection}
2610 \def\aftersmartic{}
2611 \def\var#1{%
2612 \let\saveaftersmartic = \aftersmartic
2613 \def\aftersmartic{\null\let\aftersmartic=\saveaftersmartic}%
2614 \smartslanted{#1}%
2617 \let\i=\smartitalic
2618 \let\slanted=\smartslanted
2619 \let\dfn=\smartslanted
2620 \let\emph=\smartitalic
2622 % Explicit font changes: @r, @sc, undocumented @ii.
2623 \def\r#1{{\rm #1}} % roman font
2624 \def\sc#1{{\smallcaps#1}} % smallcaps font
2625 \def\ii#1{{\it #1}} % italic font
2627 % @b, explicit bold. Also @strong.
2628 \def\b#1{{\bf #1}}
2629 \let\strong=\b
2631 % @sansserif, explicit sans.
2632 \def\sansserif#1{{\sf #1}}
2634 % We can't just use \exhyphenpenalty, because that only has effect at
2635 % the end of a paragraph. Restore normal hyphenation at the end of the
2636 % group within which \nohyphenation is presumably called.
2638 \def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation}
2639 \def\restorehyphenation{\hyphenchar\font = `- }
2641 % Set sfcode to normal for the chars that usually have another value.
2642 % Can't use plain's \frenchspacing because it uses the `\x notation, and
2643 % sometimes \x has an active definition that messes things up.
2645 \catcode`@=11
2646 \def\plainfrenchspacing{%
2647 \sfcode`\.=\@m \sfcode`\?=\@m \sfcode`\!=\@m
2648 \sfcode`\:=\@m \sfcode`\;=\@m \sfcode`\,=\@m
2649 \def\endofsentencespacefactor{1000}% for @. and friends
2651 \def\plainnonfrenchspacing{%
2652 \sfcode`\.3000\sfcode`\?3000\sfcode`\!3000
2653 \sfcode`\:2000\sfcode`\;1500\sfcode`\,1250
2654 \def\endofsentencespacefactor{3000}% for @. and friends
2656 \catcode`@=\other
2657 \def\endofsentencespacefactor{3000}% default
2659 % @t, explicit typewriter.
2660 \def\t#1{%
2661 {\tt \rawbackslash \plainfrenchspacing #1}%
2662 \null
2665 % @samp.
2666 \def\samp#1{{\setupmarkupstyle{samp}\lq\tclose{#1}\rq\null}}
2668 % @indicateurl is \samp, that is, with quotes.
2669 \let\indicateurl=\samp
2671 % @code (and similar) prints in typewriter, but with spaces the same
2672 % size as normal in the surrounding text, without hyphenation, etc.
2673 % This is a subroutine for that.
2674 \def\tclose#1{%
2676 % Change normal interword space to be same as for the current font.
2677 \spaceskip = \fontdimen2\font
2679 % Switch to typewriter.
2682 % But `\ ' produces the large typewriter interword space.
2683 \def\ {{\spaceskip = 0pt{} }}%
2685 % Turn off hyphenation.
2686 \nohyphenation
2688 \rawbackslash
2689 \plainfrenchspacing
2692 \null % reset spacefactor to 1000
2695 % We *must* turn on hyphenation at `-' and `_' in @code.
2696 % (But see \codedashfinish below.)
2697 % Otherwise, it is too hard to avoid overfull hboxes
2698 % in the Emacs manual, the Library manual, etc.
2700 % Unfortunately, TeX uses one parameter (\hyphenchar) to control
2701 % both hyphenation at - and hyphenation within words.
2702 % We must therefore turn them both off (\tclose does that)
2703 % and arrange explicitly to hyphenate at a dash. -- rms.
2705 \catcode`\-=\active \catcode`\_=\active
2706 \catcode`\'=\active \catcode`\`=\active
2707 \global\let'=\rq \global\let`=\lq % default definitions
2709 \global\def\code{\begingroup
2710 \setupmarkupstyle{code}%
2711 % The following should really be moved into \setupmarkupstyle handlers.
2712 \catcode\dashChar=\active \catcode\underChar=\active
2713 \ifallowcodebreaks
2714 \let-\codedash
2715 \let_\codeunder
2716 \else
2717 \let-\normaldash
2718 \let_\realunder
2720 % Given -foo (with a single dash), we do not want to allow a break
2721 % after the hyphen.
2722 \global\let\codedashprev=\codedash
2724 \codex
2727 \gdef\codedash{\futurelet\next\codedashfinish}
2728 \gdef\codedashfinish{%
2729 \normaldash % always output the dash character itself.
2731 % Now, output a discretionary to allow a line break, unless
2732 % (a) the next character is a -, or
2733 % (b) the preceding character is a -.
2734 % E.g., given --posix, we do not want to allow a break after either -.
2735 % Given --foo-bar, we do want to allow a break between the - and the b.
2736 \ifx\next\codedash \else
2737 \ifx\codedashprev\codedash
2738 \else \discretionary{}{}{}\fi
2740 % we need the space after the = for the case when \next itself is a
2741 % space token; it would get swallowed otherwise. As in @code{- a}.
2742 \global\let\codedashprev= \next
2745 \def\normaldash{-}
2747 \def\codex #1{\tclose{#1}\endgroup}
2749 \def\codeunder{%
2750 % this is all so @math{@code{var_name}+1} can work. In math mode, _
2751 % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.)
2752 % will therefore expand the active definition of _, which is us
2753 % (inside @code that is), therefore an endless loop.
2754 \ifusingtt{\ifmmode
2755 \mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_.
2756 \else\normalunderscore \fi
2757 \discretionary{}{}{}}%
2758 {\_}%
2761 % An additional complication: the above will allow breaks after, e.g.,
2762 % each of the four underscores in __typeof__. This is bad.
2763 % @allowcodebreaks provides a document-level way to turn breaking at -
2764 % and _ on and off.
2766 \newif\ifallowcodebreaks \allowcodebreakstrue
2768 \def\keywordtrue{true}
2769 \def\keywordfalse{false}
2771 \parseargdef\allowcodebreaks{%
2772 \def\txiarg{#1}%
2773 \ifx\txiarg\keywordtrue
2774 \allowcodebreakstrue
2775 \else\ifx\txiarg\keywordfalse
2776 \allowcodebreaksfalse
2777 \else
2778 \errhelp = \EMsimple
2779 \errmessage{Unknown @allowcodebreaks option `\txiarg', must be true|false}%
2780 \fi\fi
2783 % For @command, @env, @file, @option quotes seem unnecessary,
2784 % so use \code rather than \samp.
2785 \let\command=\code
2786 \let\env=\code
2787 \let\file=\code
2788 \let\option=\code
2790 % @uref (abbreviation for `urlref') aka @url takes an optional
2791 % (comma-separated) second argument specifying the text to display and
2792 % an optional third arg as text to display instead of (rather than in
2793 % addition to) the url itself. First (mandatory) arg is the url.
2795 % TeX-only option to allow changing PDF output to show only the second
2796 % arg (if given), and not the url (which is then just the link target).
2797 \newif\ifurefurlonlylink
2799 % The main macro is \urefbreak, which allows breaking at expected
2800 % places within the url. (There used to be another version, which
2801 % didn't support automatic breaking.)
2802 \def\urefbreak{\begingroup \urefcatcodes \dourefbreak}
2803 \let\uref=\urefbreak
2805 \def\dourefbreak#1{\urefbreakfinish #1,,,\finish}
2806 \def\urefbreakfinish#1,#2,#3,#4\finish{% doesn't work in @example
2807 \unsepspaces
2808 \pdfurl{#1}%
2809 \setbox0 = \hbox{\ignorespaces #3}%
2810 \ifdim\wd0 > 0pt
2811 \unhbox0 % third arg given, show only that
2812 \else
2813 \setbox0 = \hbox{\ignorespaces #2}% look for second arg
2814 \ifdim\wd0 > 0pt
2815 \ifpdf
2816 \ifurefurlonlylink
2817 % PDF plus option to not display url, show just arg
2818 \unhbox0
2819 \else
2820 % PDF, normally display both arg and url for consistency,
2821 % visibility, if the pdf is eventually used to print, etc.
2822 \unhbox0\ (\urefcode{#1})%
2824 \else
2825 \unhbox0\ (\urefcode{#1})% DVI, always show arg and url
2827 \else
2828 \urefcode{#1}% only url given, so show it
2831 \endlink
2832 \endgroup}
2834 % Allow line breaks around only a few characters (only).
2835 \def\urefcatcodes{%
2836 \catcode`\&=\active \catcode`\.=\active
2837 \catcode`\#=\active \catcode`\?=\active
2838 \catcode`\/=\active
2841 \urefcatcodes
2843 \global\def\urefcode{\begingroup
2844 \setupmarkupstyle{code}%
2845 \urefcatcodes
2846 \let&\urefcodeamp
2847 \let.\urefcodedot
2848 \let#\urefcodehash
2849 \let?\urefcodequest
2850 \let/\urefcodeslash
2851 \codex
2854 % By default, they are just regular characters.
2855 \global\def&{\normalamp}
2856 \global\def.{\normaldot}
2857 \global\def#{\normalhash}
2858 \global\def?{\normalquest}
2859 \global\def/{\normalslash}
2862 % we put a little stretch before and after the breakable chars, to help
2863 % line breaking of long url's. The unequal skips make look better in
2864 % cmtt at least, especially for dots.
2865 \def\urefprestretchamount{.13em}
2866 \def\urefpoststretchamount{.1em}
2867 \def\urefprestretch{\urefprebreak \hskip0pt plus\urefprestretchamount\relax}
2868 \def\urefpoststretch{\urefpostbreak \hskip0pt plus\urefprestretchamount\relax}
2870 \def\urefcodeamp{\urefprestretch \&\urefpoststretch}
2871 \def\urefcodedot{\urefprestretch .\urefpoststretch}
2872 \def\urefcodehash{\urefprestretch \#\urefpoststretch}
2873 \def\urefcodequest{\urefprestretch ?\urefpoststretch}
2874 \def\urefcodeslash{\futurelet\next\urefcodeslashfinish}
2876 \catcode`\/=\active
2877 \global\def\urefcodeslashfinish{%
2878 \urefprestretch \slashChar
2879 % Allow line break only after the final / in a sequence of
2880 % slashes, to avoid line break between the slashes in http://.
2881 \ifx\next/\else \urefpoststretch \fi
2885 % One more complication: by default we'll break after the special
2886 % characters, but some people like to break before the special chars, so
2887 % allow that. Also allow no breaking at all, for manual control.
2889 \parseargdef\urefbreakstyle{%
2890 \def\txiarg{#1}%
2891 \ifx\txiarg\wordnone
2892 \def\urefprebreak{\nobreak}\def\urefpostbreak{\nobreak}
2893 \else\ifx\txiarg\wordbefore
2894 \def\urefprebreak{\allowbreak}\def\urefpostbreak{\nobreak}
2895 \else\ifx\txiarg\wordafter
2896 \def\urefprebreak{\nobreak}\def\urefpostbreak{\allowbreak}
2897 \else
2898 \errhelp = \EMsimple
2899 \errmessage{Unknown @urefbreakstyle setting `\txiarg'}%
2900 \fi\fi\fi
2902 \def\wordafter{after}
2903 \def\wordbefore{before}
2904 \def\wordnone{none}
2906 \urefbreakstyle after
2908 % @url synonym for @uref, since that's how everyone uses it.
2910 \let\url=\uref
2912 % rms does not like angle brackets --karl, 17may97.
2913 % So now @email is just like @uref, unless we are pdf.
2915 %\def\email#1{\angleleft{\tt #1}\angleright}
2916 \ifpdf
2917 \def\email#1{\doemail#1,,\finish}
2918 \def\doemail#1,#2,#3\finish{\begingroup
2919 \unsepspaces
2920 \pdfurl{mailto:#1}%
2921 \setbox0 = \hbox{\ignorespaces #2}%
2922 \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi
2923 \endlink
2924 \endgroup}
2925 \else
2926 \let\email=\uref
2929 % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
2930 % `example' (@kbd uses ttsl only inside of @example and friends),
2931 % or `code' (@kbd uses normal tty font always).
2932 \parseargdef\kbdinputstyle{%
2933 \def\txiarg{#1}%
2934 \ifx\txiarg\worddistinct
2935 \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
2936 \else\ifx\txiarg\wordexample
2937 \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
2938 \else\ifx\txiarg\wordcode
2939 \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
2940 \else
2941 \errhelp = \EMsimple
2942 \errmessage{Unknown @kbdinputstyle setting `\txiarg'}%
2943 \fi\fi\fi
2945 \def\worddistinct{distinct}
2946 \def\wordexample{example}
2947 \def\wordcode{code}
2949 % Default is `distinct'.
2950 \kbdinputstyle distinct
2952 % @kbd is like @code, except that if the argument is just one @key command,
2953 % then @kbd has no effect.
2954 \def\kbd#1{{\def\look{#1}\expandafter\kbdsub\look??\par}}
2956 \def\xkey{\key}
2957 \def\kbdsub#1#2#3\par{%
2958 \def\one{#1}\def\three{#3}\def\threex{??}%
2959 \ifx\one\xkey\ifx\threex\three \key{#2}%
2960 \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi
2961 \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi
2964 % definition of @key that produces a lozenge. Doesn't adjust to text size.
2965 %\setfont\keyrm\rmshape{8}{1000}{OT1}
2966 %\font\keysy=cmsy9
2967 %\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{%
2968 % \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
2969 % \vbox{\hrule\kern-0.4pt
2970 % \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
2971 % \kern-0.4pt\hrule}%
2972 % \kern-.06em\raise0.4pt\hbox{\angleright}}}}
2974 % definition of @key with no lozenge. If the current font is already
2975 % monospace, don't change it; that way, we respect @kbdinputstyle. But
2976 % if it isn't monospace, then use \tt.
2978 \def\key#1{{\setupmarkupstyle{key}%
2979 \nohyphenation
2980 \ifmonospace\else\tt\fi
2981 #1}\null}
2983 % @clicksequence{File @click{} Open ...}
2984 \def\clicksequence#1{\begingroup #1\endgroup}
2986 % @clickstyle @arrow (by default)
2987 \parseargdef\clickstyle{\def\click{#1}}
2988 \def\click{\arrow}
2990 % Typeset a dimension, e.g., `in' or `pt'. The only reason for the
2991 % argument is to make the input look right: @dmn{pt} instead of @dmn{}pt.
2993 \def\dmn#1{\thinspace #1}
2995 % @acronym for "FBI", "NATO", and the like.
2996 % We print this one point size smaller, since it's intended for
2997 % all-uppercase.
2999 \def\acronym#1{\doacronym #1,,\finish}
3000 \def\doacronym#1,#2,#3\finish{%
3001 {\selectfonts\lsize #1}%
3002 \def\temp{#2}%
3003 \ifx\temp\empty \else
3004 \space ({\unsepspaces \ignorespaces \temp \unskip})%
3006 \null % reset \spacefactor=1000
3009 % @abbr for "Comput. J." and the like.
3010 % No font change, but don't do end-of-sentence spacing.
3012 \def\abbr#1{\doabbr #1,,\finish}
3013 \def\doabbr#1,#2,#3\finish{%
3014 {\plainfrenchspacing #1}%
3015 \def\temp{#2}%
3016 \ifx\temp\empty \else
3017 \space ({\unsepspaces \ignorespaces \temp \unskip})%
3019 \null % reset \spacefactor=1000
3022 % @asis just yields its argument. Used with @table, for example.
3024 \def\asis#1{#1}
3026 % @math outputs its argument in math mode.
3028 % One complication: _ usually means subscripts, but it could also mean
3029 % an actual _ character, as in @math{@var{some_variable} + 1}. So make
3030 % _ active, and distinguish by seeing if the current family is \slfam,
3031 % which is what @var uses.
3033 \catcode`\_ = \active
3034 \gdef\mathunderscore{%
3035 \catcode`\_=\active
3036 \def_{\ifnum\fam=\slfam \_\else\sb\fi}%
3039 % Another complication: we want \\ (and @\) to output a math (or tt) \.
3040 % FYI, plain.tex uses \\ as a temporary control sequence (for no
3041 % particular reason), but this is not advertised and we don't care.
3043 % The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.
3044 \def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi}
3046 \def\math{%
3047 \ifmmode\else % only go into math if not in math mode already
3048 \tex
3049 \mathunderscore
3050 \let\\ = \mathbackslash
3051 \mathactive
3052 % make the texinfo accent commands work in math mode
3053 \let\"=\ddot
3054 \let\'=\acute
3055 \let\==\bar
3056 \let\^=\hat
3057 \let\`=\grave
3058 \let\u=\breve
3059 \let\v=\check
3060 \let\~=\tilde
3061 \let\dotaccent=\dot
3062 % have to provide another name for sup operator
3063 \let\mathopsup=\sup
3064 $\expandafter\finishmath\fi
3066 \def\finishmath#1{#1$\endgroup} % Close the group opened by \tex.
3068 % Some active characters (such as <) are spaced differently in math.
3069 % We have to reset their definitions in case the @math was an argument
3070 % to a command which sets the catcodes (such as @item or @section).
3073 \catcode`^ = \active
3074 \catcode`< = \active
3075 \catcode`> = \active
3076 \catcode`+ = \active
3077 \catcode`' = \active
3078 \gdef\mathactive{%
3079 \let^ = \ptexhat
3080 \let< = \ptexless
3081 \let> = \ptexgtr
3082 \let+ = \ptexplus
3083 \let' = \ptexquoteright
3087 % for @sub and @sup, if in math mode, just do a normal sub/superscript.
3088 % If in text, use math to place as sub/superscript, but switch
3089 % into text mode, with smaller fonts. This is a different font than the
3090 % one used for real math sub/superscripts (8pt vs. 7pt), but let's not
3091 % fix it (significant additions to font machinery) until someone notices.
3093 \def\sub{\ifmmode \expandafter\sb \else \expandafter\finishsub\fi}
3094 \def\finishsub#1{$\sb{\hbox{\selectfonts\lllsize #1}}$}%
3096 \def\sup{\ifmmode \expandafter\ptexsp \else \expandafter\finishsup\fi}
3097 \def\finishsup#1{$\ptexsp{\hbox{\selectfonts\lllsize #1}}$}%
3099 % @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}.
3100 % Ignore unless FMTNAME == tex; then it is like @iftex and @tex,
3101 % except specified as a normal braced arg, so no newlines to worry about.
3103 \def\outfmtnametex{tex}
3105 \long\def\inlinefmt#1{\doinlinefmt #1,\finish}
3106 \long\def\doinlinefmt#1,#2,\finish{%
3107 \def\inlinefmtname{#1}%
3108 \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\fi
3111 % @inlinefmtifelse{FMTNAME,THEN-TEXT,ELSE-TEXT} expands THEN-TEXT if
3112 % FMTNAME is tex, else ELSE-TEXT.
3113 \long\def\inlinefmtifelse#1{\doinlinefmtifelse #1,,,\finish}
3114 \long\def\doinlinefmtifelse#1,#2,#3,#4,\finish{%
3115 \def\inlinefmtname{#1}%
3116 \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\else \ignorespaces #3\fi
3119 % For raw, must switch into @tex before parsing the argument, to avoid
3120 % setting catcodes prematurely. Doing it this way means that, for
3121 % example, @inlineraw{html, foo{bar} gets a parse error instead of being
3122 % ignored. But this isn't important because if people want a literal
3123 % *right* brace they would have to use a command anyway, so they may as
3124 % well use a command to get a left brace too. We could re-use the
3125 % delimiter character idea from \verb, but it seems like overkill.
3127 \long\def\inlineraw{\tex \doinlineraw}
3128 \long\def\doinlineraw#1{\doinlinerawtwo #1,\finish}
3129 \def\doinlinerawtwo#1,#2,\finish{%
3130 \def\inlinerawname{#1}%
3131 \ifx\inlinerawname\outfmtnametex \ignorespaces #2\fi
3132 \endgroup % close group opened by \tex.
3135 % @inlineifset{VAR, TEXT} expands TEXT if VAR is @set.
3137 \long\def\inlineifset#1{\doinlineifset #1,\finish}
3138 \long\def\doinlineifset#1,#2,\finish{%
3139 \def\inlinevarname{#1}%
3140 \expandafter\ifx\csname SET\inlinevarname\endcsname\relax
3141 \else\ignorespaces#2\fi
3144 % @inlineifclear{VAR, TEXT} expands TEXT if VAR is not @set.
3146 \long\def\inlineifclear#1{\doinlineifclear #1,\finish}
3147 \long\def\doinlineifclear#1,#2,\finish{%
3148 \def\inlinevarname{#1}%
3149 \expandafter\ifx\csname SET\inlinevarname\endcsname\relax \ignorespaces#2\fi
3153 \message{glyphs,}
3154 % and logos.
3156 % @@ prints an @, as does @atchar{}.
3157 \def\@{\char64 }
3158 \let\atchar=\@
3160 % @{ @} @lbracechar{} @rbracechar{} all generate brace characters.
3161 % Unless we're in typewriter, use \ecfont because the CM text fonts do
3162 % not have braces, and we don't want to switch into math.
3163 \def\mylbrace{{\ifmonospace\else\ecfont\fi \char123}}
3164 \def\myrbrace{{\ifmonospace\else\ecfont\fi \char125}}
3165 \let\{=\mylbrace \let\lbracechar=\{
3166 \let\}=\myrbrace \let\rbracechar=\}
3167 \begingroup
3168 % Definitions to produce \{ and \} commands for indices,
3169 % and @{ and @} for the aux/toc files.
3170 \catcode`\{ = \other \catcode`\} = \other
3171 \catcode`\[ = 1 \catcode`\] = 2
3172 \catcode`\! = 0 \catcode`\\ = \other
3173 !gdef!lbracecmd[\{]%
3174 !gdef!rbracecmd[\}]%
3175 !gdef!lbraceatcmd[@{]%
3176 !gdef!rbraceatcmd[@}]%
3177 !endgroup
3179 % @comma{} to avoid , parsing problems.
3180 \let\comma = ,
3182 % Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
3183 % Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H.
3184 \let\, = \ptexc
3185 \let\dotaccent = \ptexdot
3186 \def\ringaccent#1{{\accent23 #1}}
3187 \let\tieaccent = \ptext
3188 \let\ubaraccent = \ptexb
3189 \let\udotaccent = \d
3191 % Other special characters: @questiondown @exclamdown @ordf @ordm
3192 % Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
3193 \def\questiondown{?`}
3194 \def\exclamdown{!`}
3195 \def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}}
3196 \def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}}
3198 % Dotless i and dotless j, used for accents.
3199 \def\imacro{i}
3200 \def\jmacro{j}
3201 \def\dotless#1{%
3202 \def\temp{#1}%
3203 \ifx\temp\imacro \ifmmode\imath \else\ptexi \fi
3204 \else\ifx\temp\jmacro \ifmmode\jmath \else\j \fi
3205 \else \errmessage{@dotless can be used only with i or j}%
3206 \fi\fi
3209 % The \TeX{} logo, as in plain, but resetting the spacing so that a
3210 % period following counts as ending a sentence. (Idea found in latex.)
3212 \edef\TeX{\TeX \spacefactor=1000 }
3214 % @LaTeX{} logo. Not quite the same results as the definition in
3215 % latex.ltx, since we use a different font for the raised A; it's most
3216 % convenient for us to use an explicitly smaller font, rather than using
3217 % the \scriptstyle font (since we don't reset \scriptstyle and
3218 % \scriptscriptstyle).
3220 \def\LaTeX{%
3221 L\kern-.36em
3222 {\setbox0=\hbox{T}%
3223 \vbox to \ht0{\hbox{%
3224 \ifx\textnominalsize\xwordpt
3225 % for 10pt running text, \lllsize (8pt) is too small for the A in LaTeX.
3226 % Revert to plain's \scriptsize, which is 7pt.
3227 \count255=\the\fam $\fam\count255 \scriptstyle A$%
3228 \else
3229 % For 11pt, we can use our lllsize.
3230 \selectfonts\lllsize A%
3233 \vss
3235 \kern-.15em
3236 \TeX
3239 % Some math mode symbols. Define \ensuremath to switch into math mode
3240 % unless we are already there. Expansion tricks may not be needed here,
3241 % but safer, and can't hurt.
3242 \def\ensuremath{\ifmmode \expandafter\asis \else\expandafter\ensuredmath \fi}
3243 \def\ensuredmath#1{$\relax#1$}
3245 \def\bullet{\ensuremath\ptexbullet}
3246 \def\geq{\ensuremath\ge}
3247 \def\leq{\ensuremath\le}
3248 \def\minus{\ensuremath-}
3250 % @dots{} outputs an ellipsis using the current font.
3251 % We do .5em per period so that it has the same spacing in the cm
3252 % typewriter fonts as three actual period characters; on the other hand,
3253 % in other typewriter fonts three periods are wider than 1.5em. So do
3254 % whichever is larger.
3256 \def\dots{%
3257 \leavevmode
3258 \setbox0=\hbox{...}% get width of three periods
3259 \ifdim\wd0 > 1.5em
3260 \dimen0 = \wd0
3261 \else
3262 \dimen0 = 1.5em
3264 \hbox to \dimen0{%
3265 \hskip 0pt plus.25fil
3266 .\hskip 0pt plus1fil
3267 .\hskip 0pt plus1fil
3268 .\hskip 0pt plus.5fil
3272 % @enddots{} is an end-of-sentence ellipsis.
3274 \def\enddots{%
3275 \dots
3276 \spacefactor=\endofsentencespacefactor
3279 % @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
3281 % Since these characters are used in examples, they should be an even number of
3282 % \tt widths. Each \tt character is 1en, so two makes it 1em.
3284 \def\point{$\star$}
3285 \def\arrow{\leavevmode\raise.05ex\hbox to 1em{\hfil$\rightarrow$\hfil}}
3286 \def\result{\leavevmode\raise.05ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}
3287 \def\expansion{\leavevmode\hbox to 1em{\hfil$\mapsto$\hfil}}
3288 \def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}}
3289 \def\equiv{\leavevmode\hbox to 1em{\hfil$\ptexequiv$\hfil}}
3291 % The @error{} command.
3292 % Adapted from the TeXbook's \boxit.
3294 \newbox\errorbox
3296 {\tentt \global\dimen0 = 3em}% Width of the box.
3297 \dimen2 = .55pt % Thickness of rules
3298 % The text. (`r' is open on the right, `e' somewhat less so on the left.)
3299 \setbox0 = \hbox{\kern-.75pt \reducedsf \putworderror\kern-1.5pt}
3301 \setbox\errorbox=\hbox to \dimen0{\hfil
3302 \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
3303 \advance\hsize by -2\dimen2 % Rules.
3304 \vbox{%
3305 \hrule height\dimen2
3306 \hbox{\vrule width\dimen2 \kern3pt % Space to left of text.
3307 \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below.
3308 \kern3pt\vrule width\dimen2}% Space to right.
3309 \hrule height\dimen2}
3310 \hfil}
3312 \def\error{\leavevmode\lower.7ex\copy\errorbox}
3314 % @pounds{} is a sterling sign, which Knuth put in the CM italic font.
3316 \def\pounds{{\it\$}}
3318 % @euro{} comes from a separate font, depending on the current style.
3319 % We use the free feym* fonts from the eurosym package by Henrik
3320 % Theiling, which support regular, slanted, bold and bold slanted (and
3321 % "outlined" (blackboard board, sort of) versions, which we don't need).
3322 % It is available from http://www.ctan.org/tex-archive/fonts/eurosym.
3324 % Although only regular is the truly official Euro symbol, we ignore
3325 % that. The Euro is designed to be slightly taller than the regular
3326 % font height.
3328 % feymr - regular
3329 % feymo - slanted
3330 % feybr - bold
3331 % feybo - bold slanted
3333 % There is no good (free) typewriter version, to my knowledge.
3334 % A feymr10 euro is ~7.3pt wide, while a normal cmtt10 char is ~5.25pt wide.
3335 % Hmm.
3337 % Also doesn't work in math. Do we need to do math with euro symbols?
3338 % Hope not.
3341 \def\euro{{\eurofont e}}
3342 \def\eurofont{%
3343 % We set the font at each command, rather than predefining it in
3344 % \textfonts and the other font-switching commands, so that
3345 % installations which never need the symbol don't have to have the
3346 % font installed.
3348 % There is only one designed size (nominal 10pt), so we always scale
3349 % that to the current nominal size.
3351 % By the way, simply using "at 1em" works for cmr10 and the like, but
3352 % does not work for cmbx10 and other extended/shrunken fonts.
3354 \def\eurosize{\csname\curfontsize nominalsize\endcsname}%
3356 \ifx\curfontstyle\bfstylename
3357 % bold:
3358 \font\thiseurofont = \ifusingit{feybo10}{feybr10} at \eurosize
3359 \else
3360 % regular:
3361 \font\thiseurofont = \ifusingit{feymo10}{feymr10} at \eurosize
3363 \thiseurofont
3366 % Glyphs from the EC fonts. We don't use \let for the aliases, because
3367 % sometimes we redefine the original macro, and the alias should reflect
3368 % the redefinition.
3370 % Use LaTeX names for the Icelandic letters.
3371 \def\DH{{\ecfont \char"D0}} % Eth
3372 \def\dh{{\ecfont \char"F0}} % eth
3373 \def\TH{{\ecfont \char"DE}} % Thorn
3374 \def\th{{\ecfont \char"FE}} % thorn
3376 \def\guillemetleft{{\ecfont \char"13}}
3377 \def\guillemotleft{\guillemetleft}
3378 \def\guillemetright{{\ecfont \char"14}}
3379 \def\guillemotright{\guillemetright}
3380 \def\guilsinglleft{{\ecfont \char"0E}}
3381 \def\guilsinglright{{\ecfont \char"0F}}
3382 \def\quotedblbase{{\ecfont \char"12}}
3383 \def\quotesinglbase{{\ecfont \char"0D}}
3385 % This positioning is not perfect (see the ogonek LaTeX package), but
3386 % we have the precomposed glyphs for the most common cases. We put the
3387 % tests to use those glyphs in the single \ogonek macro so we have fewer
3388 % dummy definitions to worry about for index entries, etc.
3390 % ogonek is also used with other letters in Lithuanian (IOU), but using
3391 % the precomposed glyphs for those is not so easy since they aren't in
3392 % the same EC font.
3393 \def\ogonek#1{{%
3394 \def\temp{#1}%
3395 \ifx\temp\macrocharA\Aogonek
3396 \else\ifx\temp\macrochara\aogonek
3397 \else\ifx\temp\macrocharE\Eogonek
3398 \else\ifx\temp\macrochare\eogonek
3399 \else
3400 \ecfont \setbox0=\hbox{#1}%
3401 \ifdim\ht0=1ex\accent"0C #1%
3402 \else\ooalign{\unhbox0\crcr\hidewidth\char"0C \hidewidth}%
3404 \fi\fi\fi\fi
3407 \def\Aogonek{{\ecfont \char"81}}\def\macrocharA{A}
3408 \def\aogonek{{\ecfont \char"A1}}\def\macrochara{a}
3409 \def\Eogonek{{\ecfont \char"86}}\def\macrocharE{E}
3410 \def\eogonek{{\ecfont \char"A6}}\def\macrochare{e}
3412 % Use the European Computer Modern fonts (cm-super in outline format)
3413 % for non-CM glyphs. That is ec* for regular text and tc* for the text
3414 % companion symbols (LaTeX TS1 encoding). Both are part of the ec
3415 % package and follow the same conventions.
3417 \def\ecfont{\etcfont{e}}
3418 \def\tcfont{\etcfont{t}}
3420 \def\etcfont#1{%
3421 % We can't distinguish serif/sans and italic/slanted, but this
3422 % is used for crude hacks anyway (like adding French and German
3423 % quotes to documents typeset with CM, where we lose kerning), so
3424 % hopefully nobody will notice/care.
3425 \edef\ecsize{\csname\curfontsize ecsize\endcsname}%
3426 \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}%
3427 \ifmonospace
3428 % typewriter:
3429 \font\thisecfont = #1ctt\ecsize \space at \nominalsize
3430 \else
3431 \ifx\curfontstyle\bfstylename
3432 % bold:
3433 \font\thisecfont = #1cb\ifusingit{i}{x}\ecsize \space at \nominalsize
3434 \else
3435 % regular:
3436 \font\thisecfont = #1c\ifusingit{ti}{rm}\ecsize \space at \nominalsize
3439 \thisecfont
3442 % @registeredsymbol - R in a circle. The font for the R should really
3443 % be smaller yet, but lllsize is the best we can do for now.
3444 % Adapted from the plain.tex definition of \copyright.
3446 \def\registeredsymbol{%
3447 $^{{\ooalign{\hfil\raise.07ex\hbox{\selectfonts\lllsize R}%
3448 \hfil\crcr\Orb}}%
3452 % @textdegree - the normal degrees sign.
3454 \def\textdegree{$^\circ$}
3456 % Laurent Siebenmann reports \Orb undefined with:
3457 % Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38
3458 % so we'll define it if necessary.
3460 \ifx\Orb\thisisundefined
3461 \def\Orb{\mathhexbox20D}
3464 % Quotes.
3465 \chardef\quotedblleft="5C
3466 \chardef\quotedblright=`\"
3467 \chardef\quoteleft=`\`
3468 \chardef\quoteright=`\'
3471 \message{page headings,}
3473 \newskip\titlepagetopglue \titlepagetopglue = 1.5in
3474 \newskip\titlepagebottomglue \titlepagebottomglue = 2pc
3476 % First the title page. Must do @settitle before @titlepage.
3477 \newif\ifseenauthor
3478 \newif\iffinishedtitlepage
3480 % Do an implicit @contents or @shortcontents after @end titlepage if the
3481 % user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage.
3483 \newif\ifsetcontentsaftertitlepage
3484 \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue
3485 \newif\ifsetshortcontentsaftertitlepage
3486 \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue
3488 \parseargdef\shorttitlepage{%
3489 \begingroup \hbox{}\vskip 1.5in \chaprm \centerline{#1}%
3490 \endgroup\page\hbox{}\page}
3492 \envdef\titlepage{%
3493 % Open one extra group, as we want to close it in the middle of \Etitlepage.
3494 \begingroup
3495 \parindent=0pt \textfonts
3496 % Leave some space at the very top of the page.
3497 \vglue\titlepagetopglue
3498 % No rule at page bottom unless we print one at the top with @title.
3499 \finishedtitlepagetrue
3501 % Most title ``pages'' are actually two pages long, with space
3502 % at the top of the second. We don't want the ragged left on the second.
3503 \let\oldpage = \page
3504 \def\page{%
3505 \iffinishedtitlepage\else
3506 \finishtitlepage
3508 \let\page = \oldpage
3509 \page
3510 \null
3514 \def\Etitlepage{%
3515 \iffinishedtitlepage\else
3516 \finishtitlepage
3518 % It is important to do the page break before ending the group,
3519 % because the headline and footline are only empty inside the group.
3520 % If we use the new definition of \page, we always get a blank page
3521 % after the title page, which we certainly don't want.
3522 \oldpage
3523 \endgroup
3525 % Need this before the \...aftertitlepage checks so that if they are
3526 % in effect the toc pages will come out with page numbers.
3527 \HEADINGSon
3529 % If they want short, they certainly want long too.
3530 \ifsetshortcontentsaftertitlepage
3531 \shortcontents
3532 \contents
3533 \global\let\shortcontents = \relax
3534 \global\let\contents = \relax
3537 \ifsetcontentsaftertitlepage
3538 \contents
3539 \global\let\contents = \relax
3540 \global\let\shortcontents = \relax
3544 \def\finishtitlepage{%
3545 \vskip4pt \hrule height 2pt width \hsize
3546 \vskip\titlepagebottomglue
3547 \finishedtitlepagetrue
3550 % Settings used for typesetting titles: no hyphenation, no indentation,
3551 % don't worry much about spacing, ragged right. This should be used
3552 % inside a \vbox, and fonts need to be set appropriately first. Because
3553 % it is always used for titles, nothing else, we call \rmisbold. \par
3554 % should be specified before the end of the \vbox, since a vbox is a group.
3556 \def\raggedtitlesettings{%
3557 \rmisbold
3558 \hyphenpenalty=10000
3559 \parindent=0pt
3560 \tolerance=5000
3561 \ptexraggedright
3564 % Macros to be used within @titlepage:
3566 \let\subtitlerm=\tenrm
3567 \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}
3569 \parseargdef\title{%
3570 \checkenv\titlepage
3571 \vbox{\titlefonts \raggedtitlesettings #1\par}%
3572 % print a rule at the page bottom also.
3573 \finishedtitlepagefalse
3574 \vskip4pt \hrule height 4pt width \hsize \vskip4pt
3577 \parseargdef\subtitle{%
3578 \checkenv\titlepage
3579 {\subtitlefont \rightline{#1}}%
3582 % @author should come last, but may come many times.
3583 % It can also be used inside @quotation.
3585 \parseargdef\author{%
3586 \def\temp{\quotation}%
3587 \ifx\thisenv\temp
3588 \def\quotationauthor{#1}% printed in \Equotation.
3589 \else
3590 \checkenv\titlepage
3591 \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi
3592 {\secfonts\rmisbold \leftline{#1}}%
3597 % Set up page headings and footings.
3599 \let\thispage=\folio
3601 \newtoks\evenheadline % headline on even pages
3602 \newtoks\oddheadline % headline on odd pages
3603 \newtoks\evenfootline % footline on even pages
3604 \newtoks\oddfootline % footline on odd pages
3606 % Now make \makeheadline and \makefootline in Plain TeX use those variables
3607 \headline={{\textfonts\rm \ifodd\pageno \the\oddheadline
3608 \else \the\evenheadline \fi}}
3609 \footline={{\textfonts\rm \ifodd\pageno \the\oddfootline
3610 \else \the\evenfootline \fi}\HEADINGShook}
3611 \let\HEADINGShook=\relax
3613 % Commands to set those variables.
3614 % For example, this is what @headings on does
3615 % @evenheading @thistitle|@thispage|@thischapter
3616 % @oddheading @thischapter|@thispage|@thistitle
3617 % @evenfooting @thisfile||
3618 % @oddfooting ||@thisfile
3621 \def\evenheading{\parsearg\evenheadingxxx}
3622 \def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish}
3623 \def\evenheadingyyy #1\|#2\|#3\|#4\finish{%
3624 \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
3626 \def\oddheading{\parsearg\oddheadingxxx}
3627 \def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish}
3628 \def\oddheadingyyy #1\|#2\|#3\|#4\finish{%
3629 \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
3631 \parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}%
3633 \def\evenfooting{\parsearg\evenfootingxxx}
3634 \def\evenfootingxxx #1{\evenfootingyyy #1\|\|\|\|\finish}
3635 \def\evenfootingyyy #1\|#2\|#3\|#4\finish{%
3636 \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
3638 \def\oddfooting{\parsearg\oddfootingxxx}
3639 \def\oddfootingxxx #1{\oddfootingyyy #1\|\|\|\|\finish}
3640 \def\oddfootingyyy #1\|#2\|#3\|#4\finish{%
3641 \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}%
3643 % Leave some space for the footline. Hopefully ok to assume
3644 % @evenfooting will not be used by itself.
3645 \global\advance\txipageheight by -12pt
3646 \global\advance\vsize by -12pt
3649 \parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}}
3651 % @evenheadingmarks top \thischapter <- chapter at the top of a page
3652 % @evenheadingmarks bottom \thischapter <- chapter at the bottom of a page
3654 % The same set of arguments for:
3656 % @oddheadingmarks
3657 % @evenfootingmarks
3658 % @oddfootingmarks
3659 % @everyheadingmarks
3660 % @everyfootingmarks
3662 % These define \getoddheadingmarks, \getevenheadingmarks,
3663 % \getoddfootingmarks, and \getevenfootingmarks, each to one of
3664 % \gettopheadingmarks, \getbottomheadingmarks.
3666 \def\evenheadingmarks{\headingmarks{even}{heading}}
3667 \def\oddheadingmarks{\headingmarks{odd}{heading}}
3668 \def\evenfootingmarks{\headingmarks{even}{footing}}
3669 \def\oddfootingmarks{\headingmarks{odd}{footing}}
3670 \parseargdef\everyheadingmarks{\headingmarks{even}{heading}{#1}
3671 \headingmarks{odd}{heading}{#1} }
3672 \parseargdef\everyfootingmarks{\headingmarks{even}{footing}{#1}
3673 \headingmarks{odd}{footing}{#1} }
3674 % #1 = even/odd, #2 = heading/footing, #3 = top/bottom.
3675 \def\headingmarks#1#2#3 {%
3676 \expandafter\let\expandafter\temp \csname get#3headingmarks\endcsname
3677 \global\expandafter\let\csname get#1#2marks\endcsname \temp
3680 \everyheadingmarks bottom
3681 \everyfootingmarks bottom
3683 % @headings double turns headings on for double-sided printing.
3684 % @headings single turns headings on for single-sided printing.
3685 % @headings off turns them off.
3686 % @headings on same as @headings double, retained for compatibility.
3687 % @headings after turns on double-sided headings after this page.
3688 % @headings doubleafter turns on double-sided headings after this page.
3689 % @headings singleafter turns on single-sided headings after this page.
3690 % By default, they are off at the start of a document,
3691 % and turned `on' after @end titlepage.
3693 \parseargdef\headings{\csname HEADINGS#1\endcsname}
3695 \def\headingsoff{% non-global headings elimination
3696 \evenheadline={\hfil}\evenfootline={\hfil}%
3697 \oddheadline={\hfil}\oddfootline={\hfil}%
3700 \def\HEADINGSoff{{\globaldefs=1 \headingsoff}} % global setting
3701 \HEADINGSoff % it's the default
3703 % When we turn headings on, set the page number to 1.
3704 % For double-sided printing, put current file name in lower left corner,
3705 % chapter name on inside top of right hand pages, document
3706 % title on inside top of left hand pages, and page numbers on outside top
3707 % edge of all pages.
3708 \def\HEADINGSdouble{%
3709 \global\pageno=1
3710 \global\evenfootline={\hfil}
3711 \global\oddfootline={\hfil}
3712 \global\evenheadline={\line{\folio\hfil\thistitle}}
3713 \global\oddheadline={\line{\thischapterheading\hfil\folio}}
3714 \global\let\contentsalignmacro = \chapoddpage
3716 \let\contentsalignmacro = \chappager
3718 % For single-sided printing, chapter title goes across top left of page,
3719 % page number on top right.
3720 \def\HEADINGSsingle{%
3721 \global\pageno=1
3722 \global\evenfootline={\hfil}
3723 \global\oddfootline={\hfil}
3724 \global\evenheadline={\line{\thischapterheading\hfil\folio}}
3725 \global\oddheadline={\line{\thischapterheading\hfil\folio}}
3726 \global\let\contentsalignmacro = \chappager
3728 \def\HEADINGSon{\HEADINGSdouble}
3730 \def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex}
3731 \let\HEADINGSdoubleafter=\HEADINGSafter
3732 \def\HEADINGSdoublex{%
3733 \global\evenfootline={\hfil}
3734 \global\oddfootline={\hfil}
3735 \global\evenheadline={\line{\folio\hfil\thistitle}}
3736 \global\oddheadline={\line{\thischapterheading\hfil\folio}}
3737 \global\let\contentsalignmacro = \chapoddpage
3740 \def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex}
3741 \def\HEADINGSsinglex{%
3742 \global\evenfootline={\hfil}
3743 \global\oddfootline={\hfil}
3744 \global\evenheadline={\line{\thischapterheading\hfil\folio}}
3745 \global\oddheadline={\line{\thischapterheading\hfil\folio}}
3746 \global\let\contentsalignmacro = \chappager
3749 % Subroutines used in generating headings
3750 % This produces Day Month Year style of output.
3751 % Only define if not already defined, in case a txi-??.tex file has set
3752 % up a different format (e.g., txi-cs.tex does this).
3753 \ifx\today\thisisundefined
3754 \def\today{%
3755 \number\day\space
3756 \ifcase\month
3757 \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr
3758 \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug
3759 \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec
3761 \space\number\year}
3764 % @settitle line... specifies the title of the document, for headings.
3765 % It generates no output of its own.
3766 \def\thistitle{\putwordNoTitle}
3767 \def\settitle{\parsearg{\gdef\thistitle}}
3770 \message{tables,}
3771 % Tables -- @table, @ftable, @vtable, @item(x).
3773 % default indentation of table text
3774 \newdimen\tableindent \tableindent=.8in
3775 % default indentation of @itemize and @enumerate text
3776 \newdimen\itemindent \itemindent=.3in
3777 % margin between end of table item and start of table text.
3778 \newdimen\itemmargin \itemmargin=.1in
3780 % used internally for \itemindent minus \itemmargin
3781 \newdimen\itemmax
3783 % Note @table, @ftable, and @vtable define @item, @itemx, etc., with
3784 % these defs.
3785 % They also define \itemindex
3786 % to index the item name in whatever manner is desired (perhaps none).
3788 \newif\ifitemxneedsnegativevskip
3790 \def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi}
3792 \def\internalBitem{\smallbreak \parsearg\itemzzz}
3793 \def\internalBitemx{\itemxpar \parsearg\itemzzz}
3795 \def\itemzzz #1{\begingroup %
3796 \advance\hsize by -\rightskip
3797 \advance\hsize by -\tableindent
3798 \setbox0=\hbox{\itemindicate{#1}}%
3799 \itemindex{#1}%
3800 \nobreak % This prevents a break before @itemx.
3802 % If the item text does not fit in the space we have, put it on a line
3803 % by itself, and do not allow a page break either before or after that
3804 % line. We do not start a paragraph here because then if the next
3805 % command is, e.g., @kindex, the whatsit would get put into the
3806 % horizontal list on a line by itself, resulting in extra blank space.
3807 \ifdim \wd0>\itemmax
3809 % Make this a paragraph so we get the \parskip glue and wrapping,
3810 % but leave it ragged-right.
3811 \begingroup
3812 \advance\leftskip by-\tableindent
3813 \advance\hsize by\tableindent
3814 \advance\rightskip by0pt plus1fil\relax
3815 \leavevmode\unhbox0\par
3816 \endgroup
3818 % We're going to be starting a paragraph, but we don't want the
3819 % \parskip glue -- logically it's part of the @item we just started.
3820 \nobreak \vskip-\parskip
3822 % Stop a page break at the \parskip glue coming up. However, if
3823 % what follows is an environment such as @example, there will be no
3824 % \parskip glue; then the negative vskip we just inserted would
3825 % cause the example and the item to crash together. So we use this
3826 % bizarre value of 10001 as a signal to \aboveenvbreak to insert
3827 % \parskip glue after all. Section titles are handled this way also.
3829 \penalty 10001
3830 \endgroup
3831 \itemxneedsnegativevskipfalse
3832 \else
3833 % The item text fits into the space. Start a paragraph, so that the
3834 % following text (if any) will end up on the same line.
3835 \noindent
3836 % Do this with kerns and \unhbox so that if there is a footnote in
3837 % the item text, it can migrate to the main vertical list and
3838 % eventually be printed.
3839 \nobreak\kern-\tableindent
3840 \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0
3841 \unhbox0
3842 \nobreak\kern\dimen0
3843 \endgroup
3844 \itemxneedsnegativevskiptrue
3848 \def\item{\errmessage{@item while not in a list environment}}
3849 \def\itemx{\errmessage{@itemx while not in a list environment}}
3851 % @table, @ftable, @vtable.
3852 \envdef\table{%
3853 \let\itemindex\gobble
3854 \tablecheck{table}%
3856 \envdef\ftable{%
3857 \def\itemindex ##1{\doind {fn}{\code{##1}}}%
3858 \tablecheck{ftable}%
3860 \envdef\vtable{%
3861 \def\itemindex ##1{\doind {vr}{\code{##1}}}%
3862 \tablecheck{vtable}%
3864 \def\tablecheck#1{%
3865 \ifnum \the\catcode`\^^M=\active
3866 \endgroup
3867 \errmessage{This command won't work in this context; perhaps the problem is
3868 that we are \inenvironment\thisenv}%
3869 \def\next{\doignore{#1}}%
3870 \else
3871 \let\next\tablex
3873 \next
3875 \def\tablex#1{%
3876 \def\itemindicate{#1}%
3877 \parsearg\tabley
3879 \def\tabley#1{%
3881 \makevalueexpandable
3882 \edef\temp{\noexpand\tablez #1\space\space\space}%
3883 \expandafter
3884 }\temp \endtablez
3886 \def\tablez #1 #2 #3 #4\endtablez{%
3887 \aboveenvbreak
3888 \ifnum 0#1>0 \advance \leftskip by #1\mil \fi
3889 \ifnum 0#2>0 \tableindent=#2\mil \fi
3890 \ifnum 0#3>0 \advance \rightskip by #3\mil \fi
3891 \itemmax=\tableindent
3892 \advance \itemmax by -\itemmargin
3893 \advance \leftskip by \tableindent
3894 \exdentamount=\tableindent
3895 \parindent = 0pt
3896 \parskip = \smallskipamount
3897 \ifdim \parskip=0pt \parskip=2pt \fi
3898 \let\item = \internalBitem
3899 \let\itemx = \internalBitemx
3901 \def\Etable{\endgraf\afterenvbreak}
3902 \let\Eftable\Etable
3903 \let\Evtable\Etable
3904 \let\Eitemize\Etable
3905 \let\Eenumerate\Etable
3907 % This is the counter used by @enumerate, which is really @itemize
3909 \newcount \itemno
3911 \envdef\itemize{\parsearg\doitemize}
3913 \def\doitemize#1{%
3914 \aboveenvbreak
3915 \itemmax=\itemindent
3916 \advance\itemmax by -\itemmargin
3917 \advance\leftskip by \itemindent
3918 \exdentamount=\itemindent
3919 \parindent=0pt
3920 \parskip=\smallskipamount
3921 \ifdim\parskip=0pt \parskip=2pt \fi
3923 % Try typesetting the item mark so that if the document erroneously says
3924 % something like @itemize @samp (intending @table), there's an error
3925 % right away at the @itemize. It's not the best error message in the
3926 % world, but it's better than leaving it to the @item. This means if
3927 % the user wants an empty mark, they have to say @w{} not just @w.
3928 \def\itemcontents{#1}%
3929 \setbox0 = \hbox{\itemcontents}%
3931 % @itemize with no arg is equivalent to @itemize @bullet.
3932 \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi
3934 \let\item=\itemizeitem
3937 % Definition of @item while inside @itemize and @enumerate.
3939 \def\itemizeitem{%
3940 \advance\itemno by 1 % for enumerations
3941 {\let\par=\endgraf \smallbreak}% reasonable place to break
3943 % If the document has an @itemize directly after a section title, a
3944 % \nobreak will be last on the list, and \sectionheading will have
3945 % done a \vskip-\parskip. In that case, we don't want to zero
3946 % parskip, or the item text will crash with the heading. On the
3947 % other hand, when there is normal text preceding the item (as there
3948 % usually is), we do want to zero parskip, or there would be too much
3949 % space. In that case, we won't have a \nobreak before. At least
3950 % that's the theory.
3951 \ifnum\lastpenalty<10000 \parskip=0in \fi
3952 \noindent
3953 \hbox to 0pt{\hss \itemcontents \kern\itemmargin}%
3955 \ifinner\else
3956 \vadjust{\penalty 1200}% not good to break after first line of item.
3958 % We can be in inner vertical mode in a footnote, although an
3959 % @itemize looks awful there.
3961 \flushcr
3964 % \splitoff TOKENS\endmark defines \first to be the first token in
3965 % TOKENS, and \rest to be the remainder.
3967 \def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}%
3969 % Allow an optional argument of an uppercase letter, lowercase letter,
3970 % or number, to specify the first label in the enumerated list. No
3971 % argument is the same as `1'.
3973 \envparseargdef\enumerate{\enumeratey #1 \endenumeratey}
3974 \def\enumeratey #1 #2\endenumeratey{%
3975 % If we were given no argument, pretend we were given `1'.
3976 \def\thearg{#1}%
3977 \ifx\thearg\empty \def\thearg{1}\fi
3979 % Detect if the argument is a single token. If so, it might be a
3980 % letter. Otherwise, the only valid thing it can be is a number.
3981 % (We will always have one token, because of the test we just made.
3982 % This is a good thing, since \splitoff doesn't work given nothing at
3983 % all -- the first parameter is undelimited.)
3984 \expandafter\splitoff\thearg\endmark
3985 \ifx\rest\empty
3986 % Only one token in the argument. It could still be anything.
3987 % A ``lowercase letter'' is one whose \lccode is nonzero.
3988 % An ``uppercase letter'' is one whose \lccode is both nonzero, and
3989 % not equal to itself.
3990 % Otherwise, we assume it's a number.
3992 % We need the \relax at the end of the \ifnum lines to stop TeX from
3993 % continuing to look for a <number>.
3995 \ifnum\lccode\expandafter`\thearg=0\relax
3996 \numericenumerate % a number (we hope)
3997 \else
3998 % It's a letter.
3999 \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax
4000 \lowercaseenumerate % lowercase letter
4001 \else
4002 \uppercaseenumerate % uppercase letter
4005 \else
4006 % Multiple tokens in the argument. We hope it's a number.
4007 \numericenumerate
4011 % An @enumerate whose labels are integers. The starting integer is
4012 % given in \thearg.
4014 \def\numericenumerate{%
4015 \itemno = \thearg
4016 \startenumeration{\the\itemno}%
4019 % The starting (lowercase) letter is in \thearg.
4020 \def\lowercaseenumerate{%
4021 \itemno = \expandafter`\thearg
4022 \startenumeration{%
4023 % Be sure we're not beyond the end of the alphabet.
4024 \ifnum\itemno=0
4025 \errmessage{No more lowercase letters in @enumerate; get a bigger
4026 alphabet}%
4028 \char\lccode\itemno
4032 % The starting (uppercase) letter is in \thearg.
4033 \def\uppercaseenumerate{%
4034 \itemno = \expandafter`\thearg
4035 \startenumeration{%
4036 % Be sure we're not beyond the end of the alphabet.
4037 \ifnum\itemno=0
4038 \errmessage{No more uppercase letters in @enumerate; get a bigger
4039 alphabet}
4041 \char\uccode\itemno
4045 % Call \doitemize, adding a period to the first argument and supplying the
4046 % common last two arguments. Also subtract one from the initial value in
4047 % \itemno, since @item increments \itemno.
4049 \def\startenumeration#1{%
4050 \advance\itemno by -1
4051 \doitemize{#1.}\flushcr
4054 % @alphaenumerate and @capsenumerate are abbreviations for giving an arg
4055 % to @enumerate.
4057 \def\alphaenumerate{\enumerate{a}}
4058 \def\capsenumerate{\enumerate{A}}
4059 \def\Ealphaenumerate{\Eenumerate}
4060 \def\Ecapsenumerate{\Eenumerate}
4063 % @multitable macros
4064 % Amy Hendrickson, 8/18/94, 3/6/96
4066 % @multitable ... @end multitable will make as many columns as desired.
4067 % Contents of each column will wrap at width given in preamble. Width
4068 % can be specified either with sample text given in a template line,
4069 % or in percent of \hsize, the current width of text on page.
4071 % Table can continue over pages but will only break between lines.
4073 % To make preamble:
4075 % Either define widths of columns in terms of percent of \hsize:
4076 % @multitable @columnfractions .25 .3 .45
4077 % @item ...
4079 % Numbers following @columnfractions are the percent of the total
4080 % current hsize to be used for each column. You may use as many
4081 % columns as desired.
4084 % Or use a template:
4085 % @multitable {Column 1 template} {Column 2 template} {Column 3 template}
4086 % @item ...
4087 % using the widest term desired in each column.
4089 % Each new table line starts with @item, each subsequent new column
4090 % starts with @tab. Empty columns may be produced by supplying @tab's
4091 % with nothing between them for as many times as empty columns are needed,
4092 % ie, @tab@tab@tab will produce two empty columns.
4094 % @item, @tab do not need to be on their own lines, but it will not hurt
4095 % if they are.
4097 % Sample multitable:
4099 % @multitable {Column 1 template} {Column 2 template} {Column 3 template}
4100 % @item first col stuff @tab second col stuff @tab third col
4101 % @item
4102 % first col stuff
4103 % @tab
4104 % second col stuff
4105 % @tab
4106 % third col
4107 % @item first col stuff @tab second col stuff
4108 % @tab Many paragraphs of text may be used in any column.
4110 % They will wrap at the width determined by the template.
4111 % @item@tab@tab This will be in third column.
4112 % @end multitable
4114 % Default dimensions may be reset by user.
4115 % @multitableparskip is vertical space between paragraphs in table.
4116 % @multitableparindent is paragraph indent in table.
4117 % @multitablecolmargin is horizontal space to be left between columns.
4118 % @multitablelinespace is space to leave between table items, baseline
4119 % to baseline.
4120 % 0pt means it depends on current normal line spacing.
4122 \newskip\multitableparskip
4123 \newskip\multitableparindent
4124 \newdimen\multitablecolspace
4125 \newskip\multitablelinespace
4126 \multitableparskip=0pt
4127 \multitableparindent=6pt
4128 \multitablecolspace=12pt
4129 \multitablelinespace=0pt
4131 % Macros used to set up halign preamble:
4133 \let\endsetuptable\relax
4134 \def\xendsetuptable{\endsetuptable}
4135 \let\columnfractions\relax
4136 \def\xcolumnfractions{\columnfractions}
4137 \newif\ifsetpercent
4139 % #1 is the @columnfraction, usually a decimal number like .5, but might
4140 % be just 1. We just use it, whatever it is.
4142 \def\pickupwholefraction#1 {%
4143 \global\advance\colcount by 1
4144 \expandafter\xdef\csname col\the\colcount\endcsname{#1\hsize}%
4145 \setuptable
4148 \newcount\colcount
4149 \def\setuptable#1{%
4150 \def\firstarg{#1}%
4151 \ifx\firstarg\xendsetuptable
4152 \let\go = \relax
4153 \else
4154 \ifx\firstarg\xcolumnfractions
4155 \global\setpercenttrue
4156 \else
4157 \ifsetpercent
4158 \let\go\pickupwholefraction
4159 \else
4160 \global\advance\colcount by 1
4161 \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a
4162 % separator; typically that is always in the input, anyway.
4163 \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
4166 \ifx\go\pickupwholefraction
4167 % Put the argument back for the \pickupwholefraction call, so
4168 % we'll always have a period there to be parsed.
4169 \def\go{\pickupwholefraction#1}%
4170 \else
4171 \let\go = \setuptable
4172 \fi%
4177 % multitable-only commands.
4179 % @headitem starts a heading row, which we typeset in bold. Assignments
4180 % have to be global since we are inside the implicit group of an
4181 % alignment entry. \everycr below resets \everytab so we don't have to
4182 % undo it ourselves.
4183 \def\headitemfont{\b}% for people to use in the template row; not changeable
4184 \def\headitem{%
4185 \checkenv\multitable
4186 \crcr
4187 \gdef\headitemcrhook{\nobreak}% attempt to avoid page break after headings
4188 \global\everytab={\bf}% can't use \headitemfont since the parsing differs
4189 \the\everytab % for the first item
4192 % default for tables with no headings.
4193 \let\headitemcrhook=\relax
4195 % A \tab used to include \hskip1sp. But then the space in a template
4196 % line is not enough. That is bad. So let's go back to just `&' until
4197 % we again encounter the problem the 1sp was intended to solve.
4198 % --karl, nathan@acm.org, 20apr99.
4199 \def\tab{\checkenv\multitable &\the\everytab}%
4201 % @multitable ... @end multitable definitions:
4203 \newtoks\everytab % insert after every tab.
4205 \envdef\multitable{%
4206 \vskip\parskip
4207 \startsavinginserts
4209 % @item within a multitable starts a normal row.
4210 % We use \def instead of \let so that if one of the multitable entries
4211 % contains an @itemize, we don't choke on the \item (seen as \crcr aka
4212 % \endtemplate) expanding \doitemize.
4213 \def\item{\crcr}%
4215 \tolerance=9500
4216 \hbadness=9500
4217 \setmultitablespacing
4218 \parskip=\multitableparskip
4219 \parindent=\multitableparindent
4220 \overfullrule=0pt
4221 \global\colcount=0
4223 \everycr = {%
4224 \noalign{%
4225 \global\everytab={}% Reset from possible headitem.
4226 \global\colcount=0 % Reset the column counter.
4228 % Check for saved footnotes, etc.:
4229 \checkinserts
4231 % Perhaps a \nobreak, then reset:
4232 \headitemcrhook
4233 \global\let\headitemcrhook=\relax
4237 \parsearg\domultitable
4239 \def\domultitable#1{%
4240 % To parse everything between @multitable and @item:
4241 \setuptable#1 \endsetuptable
4243 % This preamble sets up a generic column definition, which will
4244 % be used as many times as user calls for columns.
4245 % \vtop will set a single line and will also let text wrap and
4246 % continue for many paragraphs if desired.
4247 \halign\bgroup &%
4248 \global\advance\colcount by 1
4249 \multistrut
4250 \vtop{%
4251 % Use the current \colcount to find the correct column width:
4252 \hsize=\expandafter\csname col\the\colcount\endcsname
4254 % In order to keep entries from bumping into each other
4255 % we will add a \leftskip of \multitablecolspace to all columns after
4256 % the first one.
4258 % If a template has been used, we will add \multitablecolspace
4259 % to the width of each template entry.
4261 % If the user has set preamble in terms of percent of \hsize we will
4262 % use that dimension as the width of the column, and the \leftskip
4263 % will keep entries from bumping into each other. Table will start at
4264 % left margin and final column will justify at right margin.
4266 % Make sure we don't inherit \rightskip from the outer environment.
4267 \rightskip=0pt
4268 \ifnum\colcount=1
4269 % The first column will be indented with the surrounding text.
4270 \advance\hsize by\leftskip
4271 \else
4272 \ifsetpercent \else
4273 % If user has not set preamble in terms of percent of \hsize
4274 % we will advance \hsize by \multitablecolspace.
4275 \advance\hsize by \multitablecolspace
4277 % In either case we will make \leftskip=\multitablecolspace:
4278 \leftskip=\multitablecolspace
4280 % Ignoring space at the beginning and end avoids an occasional spurious
4281 % blank line, when TeX decides to break the line at the space before the
4282 % box from the multistrut, so the strut ends up on a line by itself.
4283 % For example:
4284 % @multitable @columnfractions .11 .89
4285 % @item @code{#}
4286 % @tab Legal holiday which is valid in major parts of the whole country.
4287 % Is automatically provided with highlighting sequences respectively
4288 % marking characters.
4289 \noindent\ignorespaces##\unskip\multistrut
4290 }\cr
4292 \def\Emultitable{%
4293 \crcr
4294 \egroup % end the \halign
4295 \global\setpercentfalse
4298 \def\setmultitablespacing{%
4299 \def\multistrut{\strut}% just use the standard line spacing
4301 % Compute \multitablelinespace (if not defined by user) for use in
4302 % \multitableparskip calculation. We used define \multistrut based on
4303 % this, but (ironically) that caused the spacing to be off.
4304 % See bug-texinfo report from Werner Lemberg, 31 Oct 2004 12:52:20 +0100.
4305 \ifdim\multitablelinespace=0pt
4306 \setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip
4307 \global\advance\multitablelinespace by-\ht0
4309 % Test to see if parskip is larger than space between lines of
4310 % table. If not, do nothing.
4311 % If so, set to same dimension as multitablelinespace.
4312 \ifdim\multitableparskip>\multitablelinespace
4313 \global\multitableparskip=\multitablelinespace
4314 \global\advance\multitableparskip-7pt % to keep parskip somewhat smaller
4315 % than skip between lines in the table.
4316 \fi%
4317 \ifdim\multitableparskip=0pt
4318 \global\multitableparskip=\multitablelinespace
4319 \global\advance\multitableparskip-7pt % to keep parskip somewhat smaller
4320 % than skip between lines in the table.
4321 \fi}
4324 \message{conditionals,}
4326 % @iftex, @ifnotdocbook, @ifnothtml, @ifnotinfo, @ifnotplaintext,
4327 % @ifnotxml always succeed. They currently do nothing; we don't
4328 % attempt to check whether the conditionals are properly nested. But we
4329 % have to remember that they are conditionals, so that @end doesn't
4330 % attempt to close an environment group.
4332 \def\makecond#1{%
4333 \expandafter\let\csname #1\endcsname = \relax
4334 \expandafter\let\csname iscond.#1\endcsname = 1
4336 \makecond{iftex}
4337 \makecond{ifnotdocbook}
4338 \makecond{ifnothtml}
4339 \makecond{ifnotinfo}
4340 \makecond{ifnotplaintext}
4341 \makecond{ifnotxml}
4343 % Ignore @ignore, @ifhtml, @ifinfo, and the like.
4345 \def\direntry{\doignore{direntry}}
4346 \def\documentdescription{\doignore{documentdescription}}
4347 \def\docbook{\doignore{docbook}}
4348 \def\html{\doignore{html}}
4349 \def\ifdocbook{\doignore{ifdocbook}}
4350 \def\ifhtml{\doignore{ifhtml}}
4351 \def\ifinfo{\doignore{ifinfo}}
4352 \def\ifnottex{\doignore{ifnottex}}
4353 \def\ifplaintext{\doignore{ifplaintext}}
4354 \def\ifxml{\doignore{ifxml}}
4355 \def\ignore{\doignore{ignore}}
4356 \def\menu{\doignore{menu}}
4357 \def\xml{\doignore{xml}}
4359 % Ignore text until a line `@end #1', keeping track of nested conditionals.
4361 % A count to remember the depth of nesting.
4362 \newcount\doignorecount
4364 \def\doignore#1{\begingroup
4365 % Scan in ``verbatim'' mode:
4366 \obeylines
4367 \catcode`\@ = \other
4368 \catcode`\{ = \other
4369 \catcode`\} = \other
4371 % Make sure that spaces turn into tokens that match what \doignoretext wants.
4372 \spaceisspace
4374 % Count number of #1's that we've seen.
4375 \doignorecount = 0
4377 % Swallow text until we reach the matching `@end #1'.
4378 \dodoignore{#1}%
4381 { \catcode`_=11 % We want to use \_STOP_ which cannot appear in texinfo source.
4382 \obeylines %
4384 \gdef\dodoignore#1{%
4385 % #1 contains the command name as a string, e.g., `ifinfo'.
4387 % Define a command to find the next `@end #1'.
4388 \long\def\doignoretext##1^^M@end #1{%
4389 \doignoretextyyy##1^^M@#1\_STOP_}%
4391 % And this command to find another #1 command, at the beginning of a
4392 % line. (Otherwise, we would consider a line `@c @ifset', for
4393 % example, to count as an @ifset for nesting.)
4394 \long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}%
4396 % And now expand that command.
4397 \doignoretext ^^M%
4401 \def\doignoreyyy#1{%
4402 \def\temp{#1}%
4403 \ifx\temp\empty % Nothing found.
4404 \let\next\doignoretextzzz
4405 \else % Found a nested condition, ...
4406 \advance\doignorecount by 1
4407 \let\next\doignoretextyyy % ..., look for another.
4408 % If we're here, #1 ends with ^^M\ifinfo (for example).
4410 \next #1% the token \_STOP_ is present just after this macro.
4413 % We have to swallow the remaining "\_STOP_".
4415 \def\doignoretextzzz#1{%
4416 \ifnum\doignorecount = 0 % We have just found the outermost @end.
4417 \let\next\enddoignore
4418 \else % Still inside a nested condition.
4419 \advance\doignorecount by -1
4420 \let\next\doignoretext % Look for the next @end.
4422 \next
4425 % Finish off ignored text.
4426 { \obeylines%
4427 % Ignore anything after the last `@end #1'; this matters in verbatim
4428 % environments, where otherwise the newline after an ignored conditional
4429 % would result in a blank line in the output.
4430 \gdef\enddoignore#1^^M{\endgroup\ignorespaces}%
4434 % @set VAR sets the variable VAR to an empty value.
4435 % @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
4437 % Since we want to separate VAR from REST-OF-LINE (which might be
4438 % empty), we can't just use \parsearg; we have to insert a space of our
4439 % own to delimit the rest of the line, and then take it out again if we
4440 % didn't need it.
4441 % We rely on the fact that \parsearg sets \catcode`\ =10.
4443 \parseargdef\set{\setyyy#1 \endsetyyy}
4444 \def\setyyy#1 #2\endsetyyy{%
4446 \makevalueexpandable
4447 \def\temp{#2}%
4448 \edef\next{\gdef\makecsname{SET#1}}%
4449 \ifx\temp\empty
4450 \next{}%
4451 \else
4452 \setzzz#2\endsetzzz
4456 % Remove the trailing space \setxxx inserted.
4457 \def\setzzz#1 \endsetzzz{\next{#1}}
4459 % @clear VAR clears (i.e., unsets) the variable VAR.
4461 \parseargdef\clear{%
4463 \makevalueexpandable
4464 \global\expandafter\let\csname SET#1\endcsname=\relax
4468 % @value{foo} gets the text saved in variable foo.
4469 \def\value{\begingroup\makevalueexpandable\valuexxx}
4470 \def\valuexxx#1{\expandablevalue{#1}\endgroup}
4472 \catcode`\-=\active \catcode`\_=\active
4474 \gdef\makevalueexpandable{%
4475 \let\value = \expandablevalue
4476 % We don't want these characters active, ...
4477 \catcode`\-=\other \catcode`\_=\other
4478 % ..., but we might end up with active ones in the argument if
4479 % we're called from @code, as @code{@value{foo-bar_}}, though.
4480 % So \let them to their normal equivalents.
4481 \let-\normaldash \let_\normalunderscore
4485 % We have this subroutine so that we can handle at least some @value's
4486 % properly in indexes (we call \makevalueexpandable in \indexdummies).
4487 % The command has to be fully expandable (if the variable is set), since
4488 % the result winds up in the index file. This means that if the
4489 % variable's value contains other Texinfo commands, it's almost certain
4490 % it will fail (although perhaps we could fix that with sufficient work
4491 % to do a one-level expansion on the result, instead of complete).
4493 % Unfortunately, this has the consequence that when _ is in the *value*
4494 % of an @set, it does not print properly in the roman fonts (get the cmr
4495 % dot accent at position 126 instead). No fix comes to mind, and it's
4496 % been this way since 2003 or earlier, so just ignore it.
4498 \def\expandablevalue#1{%
4499 \expandafter\ifx\csname SET#1\endcsname\relax
4500 {[No value for ``#1'']}%
4501 \message{Variable `#1', used in @value, is not set.}%
4502 \else
4503 \csname SET#1\endcsname
4507 % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
4508 % with @set.
4510 % To get the special treatment we need for `@end ifset,' we call
4511 % \makecond and then redefine.
4513 \makecond{ifset}
4514 \def\ifset{\parsearg{\doifset{\let\next=\ifsetfail}}}
4515 \def\doifset#1#2{%
4517 \makevalueexpandable
4518 \let\next=\empty
4519 \expandafter\ifx\csname SET#2\endcsname\relax
4520 #1% If not set, redefine \next.
4522 \expandafter
4523 }\next
4525 \def\ifsetfail{\doignore{ifset}}
4527 % @ifclear VAR ... @end executes the `...' iff VAR has never been
4528 % defined with @set, or has been undefined with @clear.
4530 % The `\else' inside the `\doifset' parameter is a trick to reuse the
4531 % above code: if the variable is not set, do nothing, if it is set,
4532 % then redefine \next to \ifclearfail.
4534 \makecond{ifclear}
4535 \def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}}
4536 \def\ifclearfail{\doignore{ifclear}}
4538 % @ifcommandisdefined CMD ... @end executes the `...' if CMD (written
4539 % without the @) is in fact defined. We can only feasibly check at the
4540 % TeX level, so something like `mathcode' is going to considered
4541 % defined even though it is not a Texinfo command.
4543 \makecond{ifcommanddefined}
4544 \def\ifcommanddefined{\parsearg{\doifcmddefined{\let\next=\ifcmddefinedfail}}}
4546 \def\doifcmddefined#1#2{{%
4547 \makevalueexpandable
4548 \let\next=\empty
4549 \expandafter\ifx\csname #2\endcsname\relax
4550 #1% If not defined, \let\next as above.
4552 \expandafter
4553 }\next
4555 \def\ifcmddefinedfail{\doignore{ifcommanddefined}}
4557 % @ifcommandnotdefined CMD ... handled similar to @ifclear above.
4558 \makecond{ifcommandnotdefined}
4559 \def\ifcommandnotdefined{%
4560 \parsearg{\doifcmddefined{\else \let\next=\ifcmdnotdefinedfail}}}
4561 \def\ifcmdnotdefinedfail{\doignore{ifcommandnotdefined}}
4563 % Set the `txicommandconditionals' variable, so documents have a way to
4564 % test if the @ifcommand...defined conditionals are available.
4565 \set txicommandconditionals
4567 % @dircategory CATEGORY -- specify a category of the dir file
4568 % which this file should belong to. Ignore this in TeX.
4569 \let\dircategory=\comment
4571 % @defininfoenclose.
4572 \let\definfoenclose=\comment
4575 \message{indexing,}
4576 % Index generation facilities
4578 % Define \newwrite to be identical to plain tex's \newwrite
4579 % except not \outer, so it can be used within macros and \if's.
4580 \edef\newwrite{\makecsname{ptexnewwrite}}
4582 % \newindex {foo} defines an index named IX.
4583 % It automatically defines \IXindex such that
4584 % \IXindex ...rest of line... puts an entry in the index IX.
4585 % It also defines \IXindfile to be the number of the output channel for
4586 % the file that accumulates this index. The file's extension is IX.
4587 % The name of an index should be no more than 2 characters long
4588 % for the sake of vms.
4590 \def\newindex#1{%
4591 \expandafter\chardef\csname#1indfile\endcsname=0
4592 \expandafter\xdef\csname#1index\endcsname{% % Define @#1index
4593 \noexpand\doindex{#1}}
4596 % @defindex foo == \newindex{foo}
4598 \def\defindex{\parsearg\newindex}
4600 % Define @defcodeindex, like @defindex except put all entries in @code.
4602 \def\defcodeindex{\parsearg\newcodeindex}
4604 \def\newcodeindex#1{%
4605 \expandafter\chardef\csname#1indfile\endcsname=0
4606 \expandafter\xdef\csname#1index\endcsname{%
4607 \noexpand\docodeindex{#1}}%
4610 % The default indices:
4611 \newindex{cp}% concepts,
4612 \newcodeindex{fn}% functions,
4613 \newcodeindex{vr}% variables,
4614 \newcodeindex{tp}% types,
4615 \newcodeindex{ky}% keys
4616 \newcodeindex{pg}% and programs.
4619 % @synindex foo bar makes index foo feed into index bar.
4620 % Do this instead of @defindex foo if you don't want it as a separate index.
4622 % @syncodeindex foo bar similar, but put all entries made for index foo
4623 % inside @code.
4625 \def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}}
4626 \def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}}
4628 % #1 is \doindex or \docodeindex, #2 the index getting redefined (foo),
4629 % #3 the target index (bar).
4630 \def\dosynindex#1#2#3{%
4631 % Only do \closeout if we haven't already done it, else we'll end up
4632 % closing the target index.
4633 \expandafter \ifx\csname donesynindex#2\endcsname \relax
4634 % The \closeout helps reduce unnecessary open files; the limit on the
4635 % Acorn RISC OS is a mere 16 files.
4636 \expandafter\closeout\csname#2indfile\endcsname
4637 \expandafter\let\csname donesynindex#2\endcsname = 1
4639 % redefine \fooindfile:
4640 \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname
4641 \expandafter\let\csname#2indfile\endcsname=\temp
4642 % redefine \fooindex:
4643 \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}%
4646 % Define \doindex, the driver for all index macros.
4647 % Argument #1 is generated by the calling \fooindex macro,
4648 % and it the two-letter name of the index.
4650 \def\doindex#1{\edef\indexname{#1}\parsearg\doindexxxx}
4651 \def\doindexxxx #1{\doind{\indexname}{#1}}
4653 % like the previous two, but they put @code around the argument.
4654 \def\docodeindex#1{\edef\indexname{#1}\parsearg\docodeindexxxx}
4655 \def\docodeindexxxx #1{\doind{\indexname}{\code{#1}}}
4657 % Used when writing an index entry out to an index file, to prevent
4658 % expansion of Texinfo commands that can appear in an index entry.
4660 \def\indexdummies{%
4661 \escapechar = `\\ % use backslash in output files.
4662 \def\@{@}% change to @@ when we switch to @ as escape char in index files.
4663 \def\ {\realbackslash\space }%
4665 % Need these unexpandable (because we define \tt as a dummy)
4666 % definitions when @{ or @} appear in index entry text. Also, more
4667 % complicated, when \tex is in effect and \{ is a \delimiter again.
4668 % We can't use \lbracecmd and \rbracecmd because texindex assumes
4669 % braces and backslashes are used only as delimiters. Perhaps we
4670 % should use @lbracechar and @rbracechar?
4671 \def\{{{\tt\char123}}%
4672 \def\}{{\tt\char125}}%
4674 % Do the redefinitions.
4675 \commondummies
4678 % For the aux and toc files, @ is the escape character. So we want to
4679 % redefine everything using @ as the escape character (instead of
4680 % \realbackslash, still used for index files). When everything uses @,
4681 % this will be simpler.
4683 \def\atdummies{%
4684 \def\@{@@}%
4685 \def\ {@ }%
4686 \let\{ = \lbraceatcmd
4687 \let\} = \rbraceatcmd
4689 % Do the redefinitions.
4690 \commondummies
4691 \otherbackslash
4694 % Called from \indexdummies and \atdummies.
4696 \def\commondummies{%
4697 % \definedummyword defines \#1 as \string\#1\space, thus effectively
4698 % preventing its expansion. This is used only for control words,
4699 % not control letters, because the \space would be incorrect for
4700 % control characters, but is needed to separate the control word
4701 % from whatever follows.
4703 % For control letters, we have \definedummyletter, which omits the
4704 % space.
4706 % These can be used both for control words that take an argument and
4707 % those that do not. If it is followed by {arg} in the input, then
4708 % that will dutifully get written to the index (or wherever).
4710 \def\definedummyword ##1{\def##1{\string##1\space}}%
4711 \def\definedummyletter##1{\def##1{\string##1}}%
4712 \let\definedummyaccent\definedummyletter
4714 \commondummiesnofonts
4716 \definedummyletter\_%
4717 \definedummyletter\-%
4719 % Non-English letters.
4720 \definedummyword\AA
4721 \definedummyword\AE
4722 \definedummyword\DH
4723 \definedummyword\L
4724 \definedummyword\O
4725 \definedummyword\OE
4726 \definedummyword\TH
4727 \definedummyword\aa
4728 \definedummyword\ae
4729 \definedummyword\dh
4730 \definedummyword\exclamdown
4731 \definedummyword\l
4732 \definedummyword\o
4733 \definedummyword\oe
4734 \definedummyword\ordf
4735 \definedummyword\ordm
4736 \definedummyword\questiondown
4737 \definedummyword\ss
4738 \definedummyword\th
4740 % Although these internal commands shouldn't show up, sometimes they do.
4741 \definedummyword\bf
4742 \definedummyword\gtr
4743 \definedummyword\hat
4744 \definedummyword\less
4745 \definedummyword\sf
4746 \definedummyword\sl
4747 \definedummyword\tclose
4748 \definedummyword\tt
4750 \definedummyword\LaTeX
4751 \definedummyword\TeX
4753 % Assorted special characters.
4754 \definedummyword\arrow
4755 \definedummyword\bullet
4756 \definedummyword\comma
4757 \definedummyword\copyright
4758 \definedummyword\registeredsymbol
4759 \definedummyword\dots
4760 \definedummyword\enddots
4761 \definedummyword\entrybreak
4762 \definedummyword\equiv
4763 \definedummyword\error
4764 \definedummyword\euro
4765 \definedummyword\expansion
4766 \definedummyword\geq
4767 \definedummyword\guillemetleft
4768 \definedummyword\guillemetright
4769 \definedummyword\guilsinglleft
4770 \definedummyword\guilsinglright
4771 \definedummyword\lbracechar
4772 \definedummyword\leq
4773 \definedummyword\mathopsup
4774 \definedummyword\minus
4775 \definedummyword\ogonek
4776 \definedummyword\pounds
4777 \definedummyword\point
4778 \definedummyword\print
4779 \definedummyword\quotedblbase
4780 \definedummyword\quotedblleft
4781 \definedummyword\quotedblright
4782 \definedummyword\quoteleft
4783 \definedummyword\quoteright
4784 \definedummyword\quotesinglbase
4785 \definedummyword\rbracechar
4786 \definedummyword\result
4787 \definedummyword\sub
4788 \definedummyword\sup
4789 \definedummyword\textdegree
4791 % We want to disable all macros so that they are not expanded by \write.
4792 \macrolist
4794 \normalturnoffactive
4796 % Handle some cases of @value -- where it does not contain any
4797 % (non-fully-expandable) commands.
4798 \makevalueexpandable
4801 % \commondummiesnofonts: common to \commondummies and \indexnofonts.
4802 % Define \definedumyletter, \definedummyaccent and \definedummyword before
4803 % using.
4805 \def\commondummiesnofonts{%
4806 % Control letters and accents.
4807 \definedummyletter\!%
4808 \definedummyaccent\"%
4809 \definedummyaccent\'%
4810 \definedummyletter\*%
4811 \definedummyaccent\,%
4812 \definedummyletter\.%
4813 \definedummyletter\/%
4814 \definedummyletter\:%
4815 \definedummyaccent\=%
4816 \definedummyletter\?%
4817 \definedummyaccent\^%
4818 \definedummyaccent\`%
4819 \definedummyaccent\~%
4820 \definedummyword\u
4821 \definedummyword\v
4822 \definedummyword\H
4823 \definedummyword\dotaccent
4824 \definedummyword\ogonek
4825 \definedummyword\ringaccent
4826 \definedummyword\tieaccent
4827 \definedummyword\ubaraccent
4828 \definedummyword\udotaccent
4829 \definedummyword\dotless
4831 % Texinfo font commands.
4832 \definedummyword\b
4833 \definedummyword\i
4834 \definedummyword\r
4835 \definedummyword\sansserif
4836 \definedummyword\sc
4837 \definedummyword\slanted
4838 \definedummyword\t
4840 % Commands that take arguments.
4841 \definedummyword\abbr
4842 \definedummyword\acronym
4843 \definedummyword\anchor
4844 \definedummyword\cite
4845 \definedummyword\code
4846 \definedummyword\command
4847 \definedummyword\dfn
4848 \definedummyword\dmn
4849 \definedummyword\email
4850 \definedummyword\emph
4851 \definedummyword\env
4852 \definedummyword\file
4853 \definedummyword\image
4854 \definedummyword\indicateurl
4855 \definedummyword\inforef
4856 \definedummyword\kbd
4857 \definedummyword\key
4858 \definedummyword\math
4859 \definedummyword\option
4860 \definedummyword\pxref
4861 \definedummyword\ref
4862 \definedummyword\samp
4863 \definedummyword\strong
4864 \definedummyword\tie
4865 \definedummyword\U
4866 \definedummyword\uref
4867 \definedummyword\url
4868 \definedummyword\var
4869 \definedummyword\verb
4870 \definedummyword\w
4871 \definedummyword\xref
4874 % For testing: output @{ and @} in index sort strings as \{ and \}.
4875 \newif\ifusebracesinindexes
4877 \let\indexlbrace\relax
4878 \let\indexrbrace\relax
4880 {\catcode`\@=0
4881 \catcode`\\=13
4882 @gdef@backslashdisappear{@def\{}}
4886 \catcode`\<=13
4887 \catcode`\-=13
4888 \catcode`\`=13
4889 \gdef\indexnonalnumdisappear{%
4890 \expandafter\ifx\csname SETtxiindexlquoteignore\endcsname\relax\else
4891 % @set txiindexlquoteignore makes us ignore left quotes in the sort term.
4892 % (Introduced for FSFS 2nd ed.)
4893 \let`=\empty
4896 \expandafter\ifx\csname SETtxiindexbackslashignore\endcsname\relax\else
4897 \backslashdisappear
4900 \expandafter\ifx\csname SETtxiindexhyphenignore\endcsname\relax\else
4901 \def-{}%
4903 \expandafter\ifx\csname SETtxiindexlessthanignore\endcsname\relax\else
4904 \def<{}%
4906 \expandafter\ifx\csname SETtxiindexatsignignore\endcsname\relax\else
4907 \def\@{}%
4911 \gdef\indexnonalnumreappear{%
4912 \useindexbackslash
4913 \let-\normaldash
4914 \let<\normalless
4915 \def\@{@}%
4920 % \indexnofonts is used when outputting the strings to sort the index
4921 % by, and when constructing control sequence names. It eliminates all
4922 % control sequences and just writes whatever the best ASCII sort string
4923 % would be for a given command (usually its argument).
4925 \def\indexnofonts{%
4926 % Accent commands should become @asis.
4927 \def\definedummyaccent##1{\let##1\asis}%
4928 % We can just ignore other control letters.
4929 \def\definedummyletter##1{\let##1\empty}%
4930 % All control words become @asis by default; overrides below.
4931 \let\definedummyword\definedummyaccent
4932 \commondummiesnofonts
4934 % Don't no-op \tt, since it isn't a user-level command
4935 % and is used in the definitions of the active chars like <, >, |, etc.
4936 % Likewise with the other plain tex font commands.
4937 %\let\tt=\asis
4939 \def\ { }%
4940 \def\@{@}%
4941 \def\_{\normalunderscore}%
4942 \def\-{}% @- shouldn't affect sorting
4944 \uccode`\1=`\{ \uppercase{\def\{{1}}%
4945 \uccode`\1=`\} \uppercase{\def\}{1}}%
4946 \let\lbracechar\{%
4947 \let\rbracechar\}%
4949 % Non-English letters.
4950 \def\AA{AA}%
4951 \def\AE{AE}%
4952 \def\DH{DZZ}%
4953 \def\L{L}%
4954 \def\OE{OE}%
4955 \def\O{O}%
4956 \def\TH{TH}%
4957 \def\aa{aa}%
4958 \def\ae{ae}%
4959 \def\dh{dzz}%
4960 \def\exclamdown{!}%
4961 \def\l{l}%
4962 \def\oe{oe}%
4963 \def\ordf{a}%
4964 \def\ordm{o}%
4965 \def\o{o}%
4966 \def\questiondown{?}%
4967 \def\ss{ss}%
4968 \def\th{th}%
4970 \def\LaTeX{LaTeX}%
4971 \def\TeX{TeX}%
4973 % Assorted special characters.
4974 % (The following {} will end up in the sort string, but that's ok.)
4975 \def\arrow{->}%
4976 \def\bullet{bullet}%
4977 \def\comma{,}%
4978 \def\copyright{copyright}%
4979 \def\dots{...}%
4980 \def\enddots{...}%
4981 \def\equiv{==}%
4982 \def\error{error}%
4983 \def\euro{euro}%
4984 \def\expansion{==>}%
4985 \def\geq{>=}%
4986 \def\guillemetleft{<<}%
4987 \def\guillemetright{>>}%
4988 \def\guilsinglleft{<}%
4989 \def\guilsinglright{>}%
4990 \def\leq{<=}%
4991 \def\minus{-}%
4992 \def\point{.}%
4993 \def\pounds{pounds}%
4994 \def\print{-|}%
4995 \def\quotedblbase{"}%
4996 \def\quotedblleft{"}%
4997 \def\quotedblright{"}%
4998 \def\quoteleft{`}%
4999 \def\quoteright{'}%
5000 \def\quotesinglbase{,}%
5001 \def\registeredsymbol{R}%
5002 \def\result{=>}%
5003 \def\textdegree{o}%
5005 % We need to get rid of all macros, leaving only the arguments (if present).
5006 % Of course this is not nearly correct, but it is the best we can do for now.
5007 % makeinfo does not expand macros in the argument to @deffn, which ends up
5008 % writing an index entry, and texindex isn't prepared for an index sort entry
5009 % that starts with \.
5011 % Since macro invocations are followed by braces, we can just redefine them
5012 % to take a single TeX argument. The case of a macro invocation that
5013 % goes to end-of-line is not handled.
5015 \macrolist
5019 \let\SETmarginindex=\relax % put index entries in margin (undocumented)?
5021 % Most index entries go through here, but \dosubind is the general case.
5022 % #1 is the index name, #2 is the entry text.
5023 \def\doind#1#2{\dosubind{#1}{#2}{}}
5025 % There is also \dosubind {index}{topic}{subtopic}
5026 % which makes an entry in a two-level index such as the operation index.
5027 % TODO: Two-level index? Operation index?
5029 % Workhorse for all indexes.
5030 % #1 is name of index, #2 is stuff to put there, #3 is subentry --
5031 % empty if called from \doind, as we usually are (the main exception
5032 % is with most defuns, which call us directly).
5034 \def\dosubind#1#2#3{%
5035 \iflinks
5037 \requireopenindexfile{#1}%
5038 % Store the main index entry text (including the third arg).
5039 \toks0 = {#2}%
5040 % If third arg is present, precede it with a space.
5041 \def\thirdarg{#3}%
5042 \ifx\thirdarg\empty \else
5043 \toks0 = \expandafter{\the\toks0 \space #3}%
5046 \edef\writeto{\csname#1indfile\endcsname}%
5048 \safewhatsit\dosubindwrite
5053 % Check if an index file has been opened, and if not, open it.
5054 \def\requireopenindexfile#1{%
5055 \ifnum\csname #1indfile\endcsname=0
5056 \expandafter\newwrite \csname#1indfile\endcsname
5057 \edef\suffix{#1}%
5058 % A .fls suffix would conflict with the file extension for the output
5059 % of -recorder, so use .f1s instead.
5060 \ifx\suffix\indexisfl\def\suffix{f1}\fi
5061 % Open the file
5062 \immediate\openout\csname#1indfile\endcsname \jobname.\suffix
5063 % Using \immediate here prevents an object entering into the current box,
5064 % which could confound checks such as those in \safewhatsit for preceding
5065 % skips.
5066 \fi}
5067 \def\indexisfl{fl}
5069 % Output \ as {\indexbackslash}, because \ is an escape character in
5070 % the index files.
5071 \let\indexbackslash=\relax
5072 {\catcode`\@=0 \catcode`\\=\active
5073 @gdef@useindexbackslash{@def\{{@indexbackslash}}}
5076 % Definition for writing index entry text.
5077 \def\sortas#1{\ignorespaces}%
5079 % Definition for writing index entry sort key. Should occur at the at
5080 % the beginning of the index entry, like
5081 % @cindex @sortas{september} \september
5082 % The \ignorespaces takes care of following space, but there's no way
5083 % to remove space before it.
5085 \catcode`\-=13
5086 \gdef\indexwritesortas{%
5087 \begingroup
5088 \indexnonalnumreappear
5089 \indexwritesortasxxx}
5090 \gdef\indexwritesortasxxx#1{%
5091 \xdef\indexsortkey{#1}\endgroup}
5095 % Write the entry in \toks0 to the index file.
5097 \def\dosubindwrite{%
5098 % Put the index entry in the margin if desired.
5099 \ifx\SETmarginindex\relax\else
5100 \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}%
5103 % Remember, we are within a group.
5104 \indexdummies % Must do this here, since \bf, etc expand at this stage
5105 \useindexbackslash % \indexbackslash isn't defined now so it will be output
5106 % as is; and it will print as backslash.
5107 % The braces around \indexbrace are recognized by texindex.
5109 % Get the string to sort by, by processing the index entry with all
5110 % font commands turned off.
5111 {\indexnofonts
5112 \def\lbracechar{{\indexlbrace}}%
5113 \def\rbracechar{{\indexrbrace}}%
5114 \let\{=\lbracechar
5115 \let\}=\rbracechar
5116 \indexnonalnumdisappear
5117 \xdef\indexsortkey{}%
5118 \let\sortas=\indexwritesortas
5119 \edef\temp{\the\toks0}%
5120 \setbox\dummybox = \hbox{\temp}% Make sure to execute any \sortas
5121 \ifx\indexsortkey\empty
5122 \xdef\indexsortkey{\temp}%
5123 \ifx\indexsortkey\empty\xdef\indexsortkey{ }\fi
5127 % Set up the complete index entry, with both the sort key and
5128 % the original text, including any font commands. We write
5129 % three arguments to \entry to the .?? file (four in the
5130 % subentry case), texindex reduces to two when writing the .??s
5131 % sorted result.
5132 \edef\temp{%
5133 \write\writeto{%
5134 \string\entry{\indexsortkey}{\noexpand\folio}{\the\toks0}}%
5136 \temp
5138 \newbox\dummybox % used above
5140 % Take care of unwanted page breaks/skips around a whatsit:
5142 % If a skip is the last thing on the list now, preserve it
5143 % by backing up by \lastskip, doing the \write, then inserting
5144 % the skip again. Otherwise, the whatsit generated by the
5145 % \write or \pdfdest will make \lastskip zero. The result is that
5146 % sequences like this:
5147 % @end defun
5148 % @tindex whatever
5149 % @defun ...
5150 % will have extra space inserted, because the \medbreak in the
5151 % start of the @defun won't see the skip inserted by the @end of
5152 % the previous defun.
5154 % But don't do any of this if we're not in vertical mode. We
5155 % don't want to do a \vskip and prematurely end a paragraph.
5157 % Avoid page breaks due to these extra skips, too.
5159 % But wait, there is a catch there:
5160 % We'll have to check whether \lastskip is zero skip. \ifdim is not
5161 % sufficient for this purpose, as it ignores stretch and shrink parts
5162 % of the skip. The only way seems to be to check the textual
5163 % representation of the skip.
5165 % The following is almost like \def\zeroskipmacro{0.0pt} except that
5166 % the ``p'' and ``t'' characters have catcode \other, not 11 (letter).
5168 \edef\zeroskipmacro{\expandafter\the\csname z@skip\endcsname}
5170 \newskip\whatsitskip
5171 \newcount\whatsitpenalty
5173 % ..., ready, GO:
5175 \def\safewhatsit#1{\ifhmode
5177 \else
5178 % \lastskip and \lastpenalty cannot both be nonzero simultaneously.
5179 \whatsitskip = \lastskip
5180 \edef\lastskipmacro{\the\lastskip}%
5181 \whatsitpenalty = \lastpenalty
5183 % If \lastskip is nonzero, that means the last item was a
5184 % skip. And since a skip is discardable, that means this
5185 % -\whatsitskip glue we're inserting is preceded by a
5186 % non-discardable item, therefore it is not a potential
5187 % breakpoint, therefore no \nobreak needed.
5188 \ifx\lastskipmacro\zeroskipmacro
5189 \else
5190 \vskip-\whatsitskip
5195 \ifx\lastskipmacro\zeroskipmacro
5196 % If \lastskip was zero, perhaps the last item was a penalty, and
5197 % perhaps it was >=10000, e.g., a \nobreak. In that case, we want
5198 % to re-insert the same penalty (values >10000 are used for various
5199 % signals); since we just inserted a non-discardable item, any
5200 % following glue (such as a \parskip) would be a breakpoint. For example:
5201 % @deffn deffn-whatever
5202 % @vindex index-whatever
5203 % Description.
5204 % would allow a break between the index-whatever whatsit
5205 % and the "Description." paragraph.
5206 \ifnum\whatsitpenalty>9999 \penalty\whatsitpenalty \fi
5207 \else
5208 % On the other hand, if we had a nonzero \lastskip,
5209 % this make-up glue would be preceded by a non-discardable item
5210 % (the whatsit from the \write), so we must insert a \nobreak.
5211 \nobreak\vskip\whatsitskip
5213 \fi}
5215 % The index entry written in the file actually looks like
5216 % \entry {sortstring}{page}{topic}
5217 % or
5218 % \entry {sortstring}{page}{topic}{subtopic}
5219 % The texindex program reads in these files and writes files
5220 % containing these kinds of lines:
5221 % \initial {c}
5222 % before the first topic whose initial is c
5223 % \entry {topic}{pagelist}
5224 % for a topic that is used without subtopics
5225 % \primary {topic}
5226 % for the beginning of a topic that is used with subtopics
5227 % \secondary {subtopic}{pagelist}
5228 % for each subtopic.
5230 % Define the user-accessible indexing commands
5231 % @findex, @vindex, @kindex, @cindex.
5233 \def\findex {\fnindex}
5234 \def\kindex {\kyindex}
5235 \def\cindex {\cpindex}
5236 \def\vindex {\vrindex}
5237 \def\tindex {\tpindex}
5238 \def\pindex {\pgindex}
5240 \def\cindexsub {\begingroup\obeylines\cindexsub}
5241 {\obeylines %
5242 \gdef\cindexsub "#1" #2^^M{\endgroup %
5243 \dosubind{cp}{#2}{#1}}}
5245 % Define the macros used in formatting output of the sorted index material.
5247 % @printindex causes a particular index (the ??s file) to get printed.
5248 % It does not print any chapter heading (usually an @unnumbered).
5250 \parseargdef\printindex{\begingroup
5251 \dobreak \chapheadingskip{10000}%
5253 \smallfonts \rm
5254 \tolerance = 9500
5255 \plainfrenchspacing
5256 \everypar = {}% don't want the \kern\-parindent from indentation suppression.
5258 % See if the index file exists and is nonempty.
5259 % Change catcode of @ here so that if the index file contains
5260 % \initial {@}
5261 % as its first line, TeX doesn't complain about mismatched braces
5262 % (because it thinks @} is a control sequence).
5263 \catcode`\@ = 11
5264 % See comment in \requireopenindexfile.
5265 \def\indexname{#1}\ifx\indexname\indexisfl\def\indexname{f1}\fi
5266 \openin 1 \jobname.\indexname s
5267 \ifeof 1
5268 % \enddoublecolumns gets confused if there is no text in the index,
5269 % and it loses the chapter title and the aux file entries for the
5270 % index. The easiest way to prevent this problem is to make sure
5271 % there is some text.
5272 \putwordIndexNonexistent
5273 \else
5274 \catcode`\\ = 0
5275 \escapechar = `\\
5277 % If the index file exists but is empty, then \openin leaves \ifeof
5278 % false. We have to make TeX try to read something from the file, so
5279 % it can discover if there is anything in it.
5280 \read 1 to \thisline
5281 \ifeof 1
5282 \putwordIndexIsEmpty
5283 \else
5284 % Index files are almost Texinfo source, but we use \ as the escape
5285 % character. It would be better to use @, but that's too big a change
5286 % to make right now.
5287 \def\indexbackslash{\ttbackslash}%
5288 \let\indexlbrace\{ % Likewise, set these sequences for braces
5289 \let\indexrbrace\} % used in the sort key.
5290 \begindoublecolumns
5291 \let\entryorphanpenalty=\indexorphanpenalty
5293 % Read input from the index file line by line.
5294 \loopdo
5295 \ifeof1
5296 \let\firsttoken\relax
5297 \else
5298 \read 1 to \nextline
5299 \edef\act{\gdef\noexpand\firsttoken{\getfirsttoken\nextline}}%
5300 \act
5302 \thisline
5304 \ifeof1\else
5305 \let\thisline\nextline
5306 \repeat
5308 \enddoublecolumns
5311 \closein 1
5312 \endgroup}
5314 \def\getfirsttoken#1{\expandafter\getfirsttokenx#1\endfirsttoken}
5315 \long\def\getfirsttokenx#1#2\endfirsttoken{\noexpand#1}
5317 \def\loopdo#1\repeat{\def\body{#1}\loopdoxxx}
5318 \def\loopdoxxx{\let\next=\relax\body\let\next=\loopdoxxx\fi\next}
5320 % These macros are used by the sorted index file itself.
5321 % Change them to control the appearance of the index.
5323 {\catcode`\/=13 \catcode`\-=13 \catcode`\^=13 \catcode`\~=13 \catcode`\_=13
5324 \catcode`\|=13 \catcode`\<=13 \catcode`\>=13 \catcode`\+=13 \catcode`\"=13
5325 \catcode`\$=3
5326 \gdef\initialglyphs{%
5327 % Some changes for non-alphabetic characters. Using the glyphs from the
5328 % math fonts looks more consistent than the typewriter font used elsewhere
5329 % for these characters.
5330 \def\indexbackslash{\math{\backslash}}%
5331 \let\\=\indexbackslash
5333 % Can't get bold backslash so don't use bold forward slash
5334 \catcode`\/=13
5335 \def/{{\secrmnotbold \normalslash}}%
5336 \def-{{\normaldash\normaldash}}% en dash `--'
5337 \def^{{\chapbf \normalcaret}}%
5338 \def~{{\chapbf \normaltilde}}%
5339 \def\_{%
5340 \leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em }%
5341 \def|{$\vert$}%
5342 \def<{$\less$}%
5343 \def>{$\gtr$}%
5344 \def+{$\normalplus$}%
5347 \def\initial{%
5348 \bgroup
5349 \initialglyphs
5350 \initialx
5353 \def\initialx#1{%
5354 % Remove any glue we may have, we'll be inserting our own.
5355 \removelastskip
5357 % We like breaks before the index initials, so insert a bonus.
5358 % The glue before the bonus allows a little bit of space at the
5359 % bottom of a column to reduce an increase in inter-line spacing.
5360 \nobreak
5361 \vskip 0pt plus 5\baselineskip
5362 \penalty -300
5363 \vskip 0pt plus -5\baselineskip
5365 % Typeset the initial. Making this add up to a whole number of
5366 % baselineskips increases the chance of the dots lining up from column
5367 % to column. It still won't often be perfect, because of the stretch
5368 % we need before each entry, but it's better.
5370 % No shrink because it confuses \balancecolumns.
5371 \vskip 1.67\baselineskip plus 1\baselineskip
5372 \leftline{\secfonts \kern-0.05em \secbf #1}%
5373 % \secfonts is inside the argument of \leftline so that the change of
5374 % \baselineskip will not affect any glue inserted before the vbox that
5375 % \leftline creates.
5376 % Do our best not to break after the initial.
5377 \nobreak
5378 \vskip .33\baselineskip plus .1\baselineskip
5379 \egroup % \initialglyphs
5382 \newdimen\entryrightmargin
5383 \entryrightmargin=0pt
5385 % \entry typesets a paragraph consisting of the text (#1), dot leaders, and
5386 % then page number (#2) flushed to the right margin. It is used for index
5387 % and table of contents entries. The paragraph is indented by \leftskip.
5389 \def\entry{%
5390 \begingroup
5392 % Start a new paragraph if necessary, so our assignments below can't
5393 % affect previous text.
5394 \par
5396 % No extra space above this paragraph.
5397 \parskip = 0in
5399 % When reading the text of entry, convert explicit line breaks
5400 % from @* into spaces. The user might give these in long section
5401 % titles, for instance.
5402 \def\*{\unskip\space\ignorespaces}%
5403 \def\entrybreak{\hfil\break}% An undocumented command
5405 % A bit of stretch before each entry for the benefit of balancing
5406 % columns.
5407 \vskip 0pt plus0.5pt
5409 % Swallow the left brace of the text (first parameter):
5410 \afterassignment\doentry
5411 \let\temp =
5413 \def\entrybreak{\unskip\space\ignorespaces}%
5414 \def\doentry{%
5415 % Save the text of the entry
5416 \global\setbox\boxA=\hbox\bgroup
5417 \bgroup % Instead of the swallowed brace.
5418 \noindent
5419 \aftergroup\finishentry
5420 % And now comes the text of the entry.
5421 % Not absorbing as a macro argument reduces the chance of problems
5422 % with catcodes occurring.
5424 {\catcode`\@=11
5425 \gdef\finishentry#1{%
5426 \egroup % end box A
5427 \dimen@ = \wd\boxA % Length of text of entry
5428 \global\setbox\boxA=\hbox\bgroup\unhbox\boxA
5429 % #1 is the page number.
5431 % Get the width of the page numbers, and only use
5432 % leaders if they are present.
5433 \global\setbox\boxB = \hbox{#1}%
5434 \ifdim\wd\boxB = 0pt
5435 \null\nobreak\hfill\ %
5436 \else
5438 \null\nobreak\indexdotfill % Have leaders before the page number.
5440 \ifpdf
5441 \pdfgettoks#1.%
5442 \bgroup\let\domark\relax
5443 \hskip\skip\thinshrinkable\the\toksA
5444 \egroup
5445 % The redefinion of \domark stops marks being added in \pdflink to
5446 % preserve coloured links across page boundaries. Otherwise the marks
5447 % would get in the way of \lastbox in \insertindexentrybox.
5448 \else
5449 \hskip\skip\thinshrinkable #1%
5452 \egroup % end \boxA
5453 \ifdim\wd\boxB = 0pt
5454 \global\setbox\entryindexbox=\vbox{\unhbox\boxA}%
5455 \else
5456 \global\setbox\entryindexbox=\vbox\bgroup
5457 \prevdepth=\entrylinedepth
5458 \noindent
5459 % We want the text of the entries to be aligned to the left, and the
5460 % page numbers to be aligned to the right.
5462 \advance\leftskip by 0pt plus 1fil
5463 \advance\leftskip by 0pt plus -1fill
5464 \rightskip = 0pt plus -1fil
5465 \advance\rightskip by 0pt plus 1fill
5466 % Cause last line, which could consist of page numbers on their own
5467 % if the list of page numbers is long, to be aligned to the right.
5468 \parfillskip=0pt plus -1fill
5470 \hangindent=1em
5472 \advance\rightskip by \entryrightmargin
5473 % Determine how far we can stretch into the margin.
5474 % This allows, e.g., "Appendix H GNU Free Documentation License" to
5475 % fit on one line in @letterpaper format.
5476 \ifdim\entryrightmargin>2.1em
5477 \dimen@i=2.1em
5478 \else
5479 \dimen@i=0em
5481 \advance \parfillskip by 0pt minus 1\dimen@i
5483 \dimen@ii = \hsize
5484 \advance\dimen@ii by -1\leftskip
5485 \advance\dimen@ii by -1\entryrightmargin
5486 \advance\dimen@ii by 1\dimen@i
5487 \ifdim\wd\boxA > \dimen@ii % If the entry doesn't fit in one line
5488 \ifdim\dimen@ > 0.8\dimen@ii % due to long index text
5489 \dimen@ = 0.7\dimen@ % Try to split the text roughly evenly
5490 \dimen@ii = \hsize
5491 \advance \dimen@ii by -1em
5492 \ifnum\dimen@>\dimen@ii
5493 % If the entry is too long, use the whole line
5494 \dimen@ = \dimen@ii
5496 \advance\leftskip by 0pt plus 1fill % ragged right
5497 \advance \dimen@ by 1\rightskip
5498 \parshape = 2 0pt \dimen@ 1em \dimen@ii
5499 % Ideally we'd add a finite glue at the end of the first line only, but
5500 % TeX doesn't seem to provide a way to do such a thing.
5501 \fi\fi
5502 \unhbox\boxA
5504 % Do not prefer a separate line ending with a hyphen to fewer lines.
5505 \finalhyphendemerits = 0
5507 % Word spacing - no stretch
5508 \spaceskip=\fontdimen2\font minus \fontdimen4\font
5510 \linepenalty=1000 % Discourage line breaks.
5511 \hyphenpenalty=5000 % Discourage hyphenation.
5513 \par % format the paragraph
5514 \egroup % The \vbox
5516 \endgroup
5517 % delay text of entry until after penalty
5518 \bgroup\aftergroup\insertindexentrybox
5519 \entryorphanpenalty
5522 \newskip\thinshrinkable
5523 \skip\thinshrinkable=.15em minus .15em
5525 \newbox\entryindexbox
5526 \def\insertindexentrybox{%
5527 \copy\entryindexbox
5528 % The following gets the depth of the last box. This is for even
5529 % line spacing when entries span several lines.
5530 \setbox\dummybox\vbox{%
5531 \unvbox\entryindexbox
5532 \nointerlineskip
5533 \lastbox
5534 \global\entrylinedepth=\prevdepth
5536 % Note that we couldn't simply \unvbox\entryindexbox followed by
5537 % \nointerlineskip\lastbox to remove the last box and then reinstate it,
5538 % because this resets how far the box has been \moveleft'ed to 0. \unvbox
5539 % doesn't affect \prevdepth either.
5541 \newdimen\entrylinedepth
5543 % Default is no penalty
5544 \let\entryorphanpenalty\egroup
5546 % Used from \printindex. \firsttoken should be the first token
5547 % after the \entry. If it's not another \entry, we are at the last
5548 % line of a group of index entries, so insert a penalty to discourage
5549 % orphaned index entries.
5550 \long\def\indexorphanpenalty{%
5551 \def\isentry{\entry}%
5552 \ifx\firsttoken\isentry
5553 \else
5554 \unskip\penalty 9000
5555 % The \unskip here stops breaking before the glue. It relies on the
5556 % \vskip above being there, otherwise there is an error
5557 % "You can't use `\unskip' in vertical mode". There has to be glue
5558 % in the current vertical list that hasn't been added to the
5559 % "current page". See Chapter 24 of the TeXbook. This contradicts
5560 % Section 8.3.7 in "TeX by Topic," though.
5562 \egroup % now comes the box added with \aftergroup
5565 % Like plain.tex's \dotfill, except uses up at least 1 em.
5566 % The filll stretch here overpowers both the fil and fill stretch to push
5567 % the page number to the right.
5568 \def\indexdotfill{\cleaders
5569 \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1filll}
5572 \def\primary #1{\line{#1\hfil}}
5574 \newskip\secondaryindent \secondaryindent=0.5cm
5575 \def\secondary#1#2{{%
5576 \parfillskip=0in
5577 \parskip=0in
5578 \hangindent=1in
5579 \hangafter=1
5580 \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill
5581 \ifpdf
5582 \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph.
5583 \else
5586 \par
5589 % Define two-column mode, which we use to typeset indexes.
5590 % Adapted from the TeXbook, page 416, which is to say,
5591 % the manmac.tex format used to print the TeXbook itself.
5592 \catcode`\@=11 % private names
5594 \newbox\partialpage
5595 \newdimen\doublecolumnhsize
5596 \newdimen\doublecolumntopgap
5597 \doublecolumntopgap = 0pt
5599 % Use inside an output routine to save \topmark and \firstmark
5600 \def\savemarks{%
5601 \global\savedtopmark=\expandafter{\topmark }%
5602 \global\savedfirstmark=\expandafter{\firstmark }%
5604 \newtoks\savedtopmark
5605 \newtoks\savedfirstmark
5607 % Set \topmark and \firstmark for next time \output runs.
5608 % Can't be run from withinside \output (because any material
5609 % added while an output routine is active, including
5610 % penalties, is saved for after it finishes). The page so far
5611 % should be empty, otherwise what's on it will be thrown away.
5612 \def\restoremarks{%
5613 \mark{\the\savedtopmark}%
5614 \bgroup\output = {%
5615 \setbox\dummybox=\box\PAGE
5616 }abc\eject\egroup
5617 % "abc" because output routine doesn't fire for a completely empty page.
5618 \mark{\the\savedfirstmark}%
5621 \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
5622 % If not much space left on page, start a new page.
5623 \ifdim\pagetotal>0.8\vsize\vfill\eject\fi
5625 % Grab any single-column material above us.
5626 \output = {%
5628 % Here is a possibility not foreseen in manmac: if we accumulate a
5629 % whole lot of material, we might end up calling this \output
5630 % routine twice in a row (see the doublecol-lose test, which is
5631 % essentially a couple of indexes with @setchapternewpage off). In
5632 % that case we just ship out what is in \partialpage with the normal
5633 % output routine. Generally, \partialpage will be empty when this
5634 % runs and this will be a no-op. See the indexspread.tex test case.
5635 \ifvoid\partialpage \else
5636 \onepageout{\pagecontents\partialpage}%
5639 \global\setbox\partialpage = \vbox{%
5640 % Unvbox the main output page.
5641 \unvbox\PAGE
5642 \kern-\topskip \kern\baselineskip
5644 \savemarks
5646 \eject % run that output routine to set \partialpage
5647 \restoremarks
5649 % We recover the two marks that the last output routine saved in order
5650 % to propagate the information in marks added around a chapter heading,
5651 % which could be otherwise be lost by the time the final page is output.
5654 % Use the double-column output routine for subsequent pages.
5655 \output = {\doublecolumnout}%
5657 % Change the page size parameters. We could do this once outside this
5658 % routine, in each of @smallbook, @afourpaper, and the default 8.5x11
5659 % format, but then we repeat the same computation. Repeating a couple
5660 % of assignments once per index is clearly meaningless for the
5661 % execution time, so we may as well do it in one place.
5663 % First we halve the line length, less a little for the gutter between
5664 % the columns. We compute the gutter based on the line length, so it
5665 % changes automatically with the paper format. The magic constant
5666 % below is chosen so that the gutter has the same value (well, +-<1pt)
5667 % as it did when we hard-coded it.
5669 % We put the result in a separate register, \doublecolumhsize, so we
5670 % can restore it in \pagesofar, after \hsize itself has (potentially)
5671 % been clobbered.
5673 \doublecolumnhsize = \hsize
5674 \advance\doublecolumnhsize by -.04154\hsize
5675 \divide\doublecolumnhsize by 2
5676 \hsize = \doublecolumnhsize
5678 % Double the \vsize as well. (We don't need a separate register here,
5679 % since nobody clobbers \vsize.)
5680 \global\doublecolumntopgap = \topskip
5681 \global\advance\doublecolumntopgap by -1\baselineskip
5682 \advance\vsize by -1\doublecolumntopgap
5683 \vsize = 2\vsize
5684 \topskip=0pt
5685 \global\entrylinedepth=0pt\relax
5688 % The double-column output routine for all double-column pages except
5689 % the last, which is done by \balancecolumns.
5691 \def\doublecolumnout{%
5693 \splittopskip=\topskip \splitmaxdepth=\maxdepth
5694 % Get the available space for the double columns -- the normal
5695 % (undoubled) page height minus any material left over from the
5696 % previous page.
5697 \dimen@ = \vsize
5698 \divide\dimen@ by 2
5699 \advance\dimen@ by -\ht\partialpage
5701 % box0 will be the left-hand column, box2 the right.
5702 \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
5703 \onepageout\pagesofar
5704 \unvbox255
5705 \penalty\outputpenalty
5708 % Re-output the contents of the output page -- any previous material,
5709 % followed by the two boxes we just split, in box0 and box2.
5710 \def\pagesofar{%
5711 \unvbox\partialpage
5713 \hsize = \doublecolumnhsize
5714 \wd0=\hsize \wd2=\hsize
5715 \vbox{%
5716 \vskip\doublecolumntopgap
5717 \hbox to\txipagewidth{\box0\hfil\box2}}%
5721 % Finished with with double columns.
5722 \def\enddoublecolumns{%
5723 % The following penalty ensures that the page builder is exercised
5724 % _before_ we change the output routine. This is necessary in the
5725 % following situation:
5727 % The last section of the index consists only of a single entry.
5728 % Before this section, \pagetotal is less than \pagegoal, so no
5729 % break occurs before the last section starts. However, the last
5730 % section, consisting of \initial and the single \entry, does not
5731 % fit on the page and has to be broken off. Without the following
5732 % penalty the page builder will not be exercised until \eject
5733 % below, and by that time we'll already have changed the output
5734 % routine to the \balancecolumns version, so the next-to-last
5735 % double-column page will be processed with \balancecolumns, which
5736 % is wrong: The two columns will go to the main vertical list, with
5737 % the broken-off section in the recent contributions. As soon as
5738 % the output routine finishes, TeX starts reconsidering the page
5739 % break. The two columns and the broken-off section both fit on the
5740 % page, because the two columns now take up only half of the page
5741 % goal. When TeX sees \eject from below which follows the final
5742 % section, it invokes the new output routine that we've set after
5743 % \balancecolumns below; \onepageout will try to fit the two columns
5744 % and the final section into the vbox of \txipageheight (see
5745 % \pagebody), causing an overfull box.
5747 % Note that glue won't work here, because glue does not exercise the
5748 % page builder, unlike penalties (see The TeXbook, pp. 280-281).
5749 \penalty0
5751 \output = {%
5752 % Split the last of the double-column material.
5753 \savemarks
5754 \balancecolumns
5756 % Having called \balancecolumns once, we do not
5757 % want to call it again. Therefore, reset \output to its normal
5758 % definition right away.
5759 \global\output = {\onepageout{\pagecontents\PAGE}}%
5761 \eject
5762 \endgroup % started in \begindoublecolumns
5763 \restoremarks
5764 % Leave the double-column material on the current page, no automatic
5765 % page break.
5766 \box\balancedcolumns
5768 % \pagegoal was set to the doubled \vsize above, since we restarted
5769 % the current page. We're now back to normal single-column
5770 % typesetting, so reset \pagegoal to the normal \vsize (after the
5771 % \endgroup where \vsize got restored).
5772 \pagegoal = \vsize
5774 \newbox\balancedcolumns
5775 \setbox\balancedcolumns=\vbox{shouldnt see this}%
5777 % Only called for the last of the double column material. \doublecolumnout
5778 % does the others.
5779 \def\balancecolumns{%
5780 \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120.
5781 \dimen@ = \ht0
5782 \advance\dimen@ by \topskip
5783 \advance\dimen@ by-\baselineskip
5784 \ifdim\dimen@<14\baselineskip
5785 % Don't split a short final column in two.
5786 \setbox2=\vbox{}%
5787 \else
5788 \divide\dimen@ by 2 % target to split to
5789 \dimen@ii = \dimen@
5790 \splittopskip = \topskip
5791 % Loop until the second column is no higher than the first
5793 \vbadness = 10000
5794 \loop
5795 \global\setbox3 = \copy0
5796 \global\setbox1 = \vsplit3 to \dimen@
5797 % Remove glue from bottom of first column to
5798 % make sure it is higher than the second.
5799 \global\setbox1 = \vbox{\unvbox1\unpenalty\unskip}%
5800 \ifdim\ht3>\ht1
5801 \global\advance\dimen@ by 1pt
5802 \repeat
5804 \multiply\dimen@ii by 4
5805 \divide\dimen@ii by 5
5806 \ifdim\ht3<\dimen@ii
5807 % Column heights are too different, so don't make their bottoms
5808 % flush with each other. The glue at the end of the second column
5809 % allows a second column to stretch, reducing the difference in
5810 % height between the two.
5811 \setbox0=\vbox to\dimen@{\unvbox1\vfill}%
5812 \setbox2=\vbox to\dimen@{\unvbox3\vskip 0pt plus 0.3\ht0}%
5813 \else
5814 \setbox0=\vbox to\dimen@{\unvbox1}%
5815 \setbox2=\vbox to\dimen@{\unvbox3}%
5819 \global\setbox\balancedcolumns=\vbox{\pagesofar}%
5821 \catcode`\@ = \other
5824 \message{sectioning,}
5825 % Chapters, sections, etc.
5827 % Let's start with @part.
5828 \outer\parseargdef\part{\partzzz{#1}}
5829 \def\partzzz#1{%
5830 \chapoddpage
5831 \null
5832 \vskip.3\vsize % move it down on the page a bit
5833 \begingroup
5834 \noindent \titlefonts\rmisbold #1\par % the text
5835 \let\lastnode=\empty % no node to associate with
5836 \writetocentry{part}{#1}{}% but put it in the toc
5837 \headingsoff % no headline or footline on the part page
5838 % This outputs a mark at the end of the page that clears \thischapter
5839 % and \thissection, as is done in \startcontents.
5840 \let\pchapsepmacro\relax
5841 \chapmacro{}{Yomitfromtoc}{}%
5842 \chapoddpage
5843 \endgroup
5846 % \unnumberedno is an oxymoron. But we count the unnumbered
5847 % sections so that we can refer to them unambiguously in the pdf
5848 % outlines by their "section number". We avoid collisions with chapter
5849 % numbers by starting them at 10000. (If a document ever has 10000
5850 % chapters, we're in trouble anyway, I'm sure.)
5851 \newcount\unnumberedno \unnumberedno = 10000
5852 \newcount\chapno
5853 \newcount\secno \secno=0
5854 \newcount\subsecno \subsecno=0
5855 \newcount\subsubsecno \subsubsecno=0
5857 % This counter is funny since it counts through charcodes of letters A, B, ...
5858 \newcount\appendixno \appendixno = `\@
5860 % \def\appendixletter{\char\the\appendixno}
5861 % We do the following ugly conditional instead of the above simple
5862 % construct for the sake of pdftex, which needs the actual
5863 % letter in the expansion, not just typeset.
5865 \def\appendixletter{%
5866 \ifnum\appendixno=`A A%
5867 \else\ifnum\appendixno=`B B%
5868 \else\ifnum\appendixno=`C C%
5869 \else\ifnum\appendixno=`D D%
5870 \else\ifnum\appendixno=`E E%
5871 \else\ifnum\appendixno=`F F%
5872 \else\ifnum\appendixno=`G G%
5873 \else\ifnum\appendixno=`H H%
5874 \else\ifnum\appendixno=`I I%
5875 \else\ifnum\appendixno=`J J%
5876 \else\ifnum\appendixno=`K K%
5877 \else\ifnum\appendixno=`L L%
5878 \else\ifnum\appendixno=`M M%
5879 \else\ifnum\appendixno=`N N%
5880 \else\ifnum\appendixno=`O O%
5881 \else\ifnum\appendixno=`P P%
5882 \else\ifnum\appendixno=`Q Q%
5883 \else\ifnum\appendixno=`R R%
5884 \else\ifnum\appendixno=`S S%
5885 \else\ifnum\appendixno=`T T%
5886 \else\ifnum\appendixno=`U U%
5887 \else\ifnum\appendixno=`V V%
5888 \else\ifnum\appendixno=`W W%
5889 \else\ifnum\appendixno=`X X%
5890 \else\ifnum\appendixno=`Y Y%
5891 \else\ifnum\appendixno=`Z Z%
5892 % The \the is necessary, despite appearances, because \appendixletter is
5893 % expanded while writing the .toc file. \char\appendixno is not
5894 % expandable, thus it is written literally, thus all appendixes come out
5895 % with the same letter (or @) in the toc without it.
5896 \else\char\the\appendixno
5897 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
5898 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
5900 % Each @chapter defines these (using marks) as the number+name, number
5901 % and name of the chapter. Page headings and footings can use
5902 % these. @section does likewise.
5903 \def\thischapter{}
5904 \def\thischapternum{}
5905 \def\thischaptername{}
5906 \def\thissection{}
5907 \def\thissectionnum{}
5908 \def\thissectionname{}
5910 \newcount\absseclevel % used to calculate proper heading level
5911 \newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count
5913 % @raisesections: treat @section as chapter, @subsection as section, etc.
5914 \def\raisesections{\global\advance\secbase by -1}
5915 \let\up=\raisesections % original BFox name
5917 % @lowersections: treat @chapter as section, @section as subsection, etc.
5918 \def\lowersections{\global\advance\secbase by 1}
5919 \let\down=\lowersections % original BFox name
5921 % we only have subsub.
5922 \chardef\maxseclevel = 3
5924 % A numbered section within an unnumbered changes to unnumbered too.
5925 % To achieve this, remember the "biggest" unnum. sec. we are currently in:
5926 \chardef\unnlevel = \maxseclevel
5928 % Trace whether the current chapter is an appendix or not:
5929 % \chapheadtype is "N" or "A", unnumbered chapters are ignored.
5930 \def\chapheadtype{N}
5932 % Choose a heading macro
5933 % #1 is heading type
5934 % #2 is heading level
5935 % #3 is text for heading
5936 \def\genhead#1#2#3{%
5937 % Compute the abs. sec. level:
5938 \absseclevel=#2
5939 \advance\absseclevel by \secbase
5940 % Make sure \absseclevel doesn't fall outside the range:
5941 \ifnum \absseclevel < 0
5942 \absseclevel = 0
5943 \else
5944 \ifnum \absseclevel > 3
5945 \absseclevel = 3
5948 % The heading type:
5949 \def\headtype{#1}%
5950 \if \headtype U%
5951 \ifnum \absseclevel < \unnlevel
5952 \chardef\unnlevel = \absseclevel
5954 \else
5955 % Check for appendix sections:
5956 \ifnum \absseclevel = 0
5957 \edef\chapheadtype{\headtype}%
5958 \else
5959 \if \headtype A\if \chapheadtype N%
5960 \errmessage{@appendix... within a non-appendix chapter}%
5961 \fi\fi
5963 % Check for numbered within unnumbered:
5964 \ifnum \absseclevel > \unnlevel
5965 \def\headtype{U}%
5966 \else
5967 \chardef\unnlevel = 3
5970 % Now print the heading:
5971 \if \headtype U%
5972 \ifcase\absseclevel
5973 \unnumberedzzz{#3}%
5974 \or \unnumberedseczzz{#3}%
5975 \or \unnumberedsubseczzz{#3}%
5976 \or \unnumberedsubsubseczzz{#3}%
5978 \else
5979 \if \headtype A%
5980 \ifcase\absseclevel
5981 \appendixzzz{#3}%
5982 \or \appendixsectionzzz{#3}%
5983 \or \appendixsubseczzz{#3}%
5984 \or \appendixsubsubseczzz{#3}%
5986 \else
5987 \ifcase\absseclevel
5988 \chapterzzz{#3}%
5989 \or \seczzz{#3}%
5990 \or \numberedsubseczzz{#3}%
5991 \or \numberedsubsubseczzz{#3}%
5995 \suppressfirstparagraphindent
5998 % an interface:
5999 \def\numhead{\genhead N}
6000 \def\apphead{\genhead A}
6001 \def\unnmhead{\genhead U}
6003 % @chapter, @appendix, @unnumbered. Increment top-level counter, reset
6004 % all lower-level sectioning counters to zero.
6006 % Also set \chaplevelprefix, which we prepend to @float sequence numbers
6007 % (e.g., figures), q.v. By default (before any chapter), that is empty.
6008 \let\chaplevelprefix = \empty
6010 \outer\parseargdef\chapter{\numhead0{#1}} % normally numhead0 calls chapterzzz
6011 \def\chapterzzz#1{%
6012 % section resetting is \global in case the chapter is in a group, such
6013 % as an @include file.
6014 \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
6015 \global\advance\chapno by 1
6017 % Used for \float.
6018 \gdef\chaplevelprefix{\the\chapno.}%
6019 \resetallfloatnos
6021 % \putwordChapter can contain complex things in translations.
6022 \toks0=\expandafter{\putwordChapter}%
6023 \message{\the\toks0 \space \the\chapno}%
6025 % Write the actual heading.
6026 \chapmacro{#1}{Ynumbered}{\the\chapno}%
6028 % So @section and the like are numbered underneath this chapter.
6029 \global\let\section = \numberedsec
6030 \global\let\subsection = \numberedsubsec
6031 \global\let\subsubsection = \numberedsubsubsec
6034 \outer\parseargdef\appendix{\apphead0{#1}} % normally calls appendixzzz
6036 \def\appendixzzz#1{%
6037 \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
6038 \global\advance\appendixno by 1
6039 \gdef\chaplevelprefix{\appendixletter.}%
6040 \resetallfloatnos
6042 % \putwordAppendix can contain complex things in translations.
6043 \toks0=\expandafter{\putwordAppendix}%
6044 \message{\the\toks0 \space \appendixletter}%
6046 \chapmacro{#1}{Yappendix}{\appendixletter}%
6048 \global\let\section = \appendixsec
6049 \global\let\subsection = \appendixsubsec
6050 \global\let\subsubsection = \appendixsubsubsec
6053 % normally unnmhead0 calls unnumberedzzz:
6054 \outer\parseargdef\unnumbered{\unnmhead0{#1}}
6055 \def\unnumberedzzz#1{%
6056 \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
6057 \global\advance\unnumberedno by 1
6059 % Since an unnumbered has no number, no prefix for figures.
6060 \global\let\chaplevelprefix = \empty
6061 \resetallfloatnos
6063 % This used to be simply \message{#1}, but TeX fully expands the
6064 % argument to \message. Therefore, if #1 contained @-commands, TeX
6065 % expanded them. For example, in `@unnumbered The @cite{Book}', TeX
6066 % expanded @cite (which turns out to cause errors because \cite is meant
6067 % to be executed, not expanded).
6069 % Anyway, we don't want the fully-expanded definition of @cite to appear
6070 % as a result of the \message, we just want `@cite' itself. We use
6071 % \the<toks register> to achieve this: TeX expands \the<toks> only once,
6072 % simply yielding the contents of <toks register>. (We also do this for
6073 % the toc entries.)
6074 \toks0 = {#1}%
6075 \message{(\the\toks0)}%
6077 \chapmacro{#1}{Ynothing}{\the\unnumberedno}%
6079 \global\let\section = \unnumberedsec
6080 \global\let\subsection = \unnumberedsubsec
6081 \global\let\subsubsection = \unnumberedsubsubsec
6084 % @centerchap is like @unnumbered, but the heading is centered.
6085 \outer\parseargdef\centerchap{%
6086 \let\centerparametersmaybe = \centerparameters
6087 \unnmhead0{#1}%
6088 \let\centerparametersmaybe = \relax
6091 % @top is like @unnumbered.
6092 \let\top\unnumbered
6094 % Sections.
6096 \outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz
6097 \def\seczzz#1{%
6098 \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
6099 \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}%
6102 % normally calls appendixsectionzzz:
6103 \outer\parseargdef\appendixsection{\apphead1{#1}}
6104 \def\appendixsectionzzz#1{%
6105 \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
6106 \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}%
6108 \let\appendixsec\appendixsection
6110 % normally calls unnumberedseczzz:
6111 \outer\parseargdef\unnumberedsec{\unnmhead1{#1}}
6112 \def\unnumberedseczzz#1{%
6113 \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
6114 \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}%
6117 % Subsections.
6119 % normally calls numberedsubseczzz:
6120 \outer\parseargdef\numberedsubsec{\numhead2{#1}}
6121 \def\numberedsubseczzz#1{%
6122 \global\subsubsecno=0 \global\advance\subsecno by 1
6123 \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}%
6126 % normally calls appendixsubseczzz:
6127 \outer\parseargdef\appendixsubsec{\apphead2{#1}}
6128 \def\appendixsubseczzz#1{%
6129 \global\subsubsecno=0 \global\advance\subsecno by 1
6130 \sectionheading{#1}{subsec}{Yappendix}%
6131 {\appendixletter.\the\secno.\the\subsecno}%
6134 % normally calls unnumberedsubseczzz:
6135 \outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}}
6136 \def\unnumberedsubseczzz#1{%
6137 \global\subsubsecno=0 \global\advance\subsecno by 1
6138 \sectionheading{#1}{subsec}{Ynothing}%
6139 {\the\unnumberedno.\the\secno.\the\subsecno}%
6142 % Subsubsections.
6144 % normally numberedsubsubseczzz:
6145 \outer\parseargdef\numberedsubsubsec{\numhead3{#1}}
6146 \def\numberedsubsubseczzz#1{%
6147 \global\advance\subsubsecno by 1
6148 \sectionheading{#1}{subsubsec}{Ynumbered}%
6149 {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}%
6152 % normally appendixsubsubseczzz:
6153 \outer\parseargdef\appendixsubsubsec{\apphead3{#1}}
6154 \def\appendixsubsubseczzz#1{%
6155 \global\advance\subsubsecno by 1
6156 \sectionheading{#1}{subsubsec}{Yappendix}%
6157 {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}%
6160 % normally unnumberedsubsubseczzz:
6161 \outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}}
6162 \def\unnumberedsubsubseczzz#1{%
6163 \global\advance\subsubsecno by 1
6164 \sectionheading{#1}{subsubsec}{Ynothing}%
6165 {\the\unnumberedno.\the\secno.\the\subsecno.\the\subsubsecno}%
6168 % These macros control what the section commands do, according
6169 % to what kind of chapter we are in (ordinary, appendix, or unnumbered).
6170 % Define them by default for a numbered chapter.
6171 \let\section = \numberedsec
6172 \let\subsection = \numberedsubsec
6173 \let\subsubsection = \numberedsubsubsec
6175 % Define @majorheading, @heading and @subheading
6177 \def\majorheading{%
6178 {\advance\chapheadingskip by 10pt \chapbreak }%
6179 \parsearg\chapheadingzzz
6182 \def\chapheading{\chapbreak \parsearg\chapheadingzzz}
6183 \def\chapheadingzzz#1{%
6184 \vbox{\chapfonts \raggedtitlesettings #1\par}%
6185 \nobreak\bigskip \nobreak
6186 \suppressfirstparagraphindent
6189 % @heading, @subheading, @subsubheading.
6190 \parseargdef\heading{\sectionheading{#1}{sec}{Yomitfromtoc}{}
6191 \suppressfirstparagraphindent}
6192 \parseargdef\subheading{\sectionheading{#1}{subsec}{Yomitfromtoc}{}
6193 \suppressfirstparagraphindent}
6194 \parseargdef\subsubheading{\sectionheading{#1}{subsubsec}{Yomitfromtoc}{}
6195 \suppressfirstparagraphindent}
6197 % These macros generate a chapter, section, etc. heading only
6198 % (including whitespace, linebreaking, etc. around it),
6199 % given all the information in convenient, parsed form.
6201 % Args are the skip and penalty (usually negative)
6202 \def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}
6204 % Parameter controlling skip before chapter headings (if needed)
6205 \newskip\chapheadingskip
6207 % Define plain chapter starts, and page on/off switching for it.
6208 \def\chapbreak{\dobreak \chapheadingskip {-4000}}
6210 % Start a new page
6211 \def\chappager{\par\vfill\supereject}
6213 % \chapoddpage - start on an odd page for a new chapter
6214 % Because \domark is called before \chapoddpage, the filler page will
6215 % get the headings for the next chapter, which is wrong. But we don't
6216 % care -- we just disable all headings on the filler page.
6217 \def\chapoddpage{%
6218 \chappager
6219 \ifodd\pageno \else
6220 \begingroup
6221 \headingsoff
6222 \null
6223 \chappager
6224 \endgroup
6228 \parseargdef\setchapternewpage{\csname CHAPPAG#1\endcsname}
6230 \def\CHAPPAGoff{%
6231 \global\let\contentsalignmacro = \chappager
6232 \global\let\pchapsepmacro=\chapbreak
6233 \global\let\pagealignmacro=\chappager}
6235 \def\CHAPPAGon{%
6236 \global\let\contentsalignmacro = \chappager
6237 \global\let\pchapsepmacro=\chappager
6238 \global\let\pagealignmacro=\chappager
6239 \global\def\HEADINGSon{\HEADINGSsingle}}
6241 \def\CHAPPAGodd{%
6242 \global\let\contentsalignmacro = \chapoddpage
6243 \global\let\pchapsepmacro=\chapoddpage
6244 \global\let\pagealignmacro=\chapoddpage
6245 \global\def\HEADINGSon{\HEADINGSdouble}}
6247 \CHAPPAGon
6249 % \chapmacro - Chapter opening.
6251 % #1 is the text, #2 is the section type (Ynumbered, Ynothing,
6252 % Yappendix, Yomitfromtoc), #3 the chapter number.
6253 % Not used for @heading series.
6255 % To test against our argument.
6256 \def\Ynothingkeyword{Ynothing}
6257 \def\Yappendixkeyword{Yappendix}
6258 \def\Yomitfromtockeyword{Yomitfromtoc}
6260 \def\chapmacro#1#2#3{%
6261 \expandafter\ifx\thisenv\titlepage\else
6262 \checkenv{}% chapters, etc., should not start inside an environment.
6264 % FIXME: \chapmacro is currently called from inside \titlepage when
6265 % \setcontentsaftertitlepage to print the "Table of Contents" heading, but
6266 % this should probably be done by \sectionheading with an option to print
6267 % in chapter size.
6269 % Insert the first mark before the heading break (see notes for \domark).
6270 \let\prevchapterdefs=\lastchapterdefs
6271 \let\prevsectiondefs=\lastsectiondefs
6272 \gdef\lastsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}%
6273 \gdef\thissection{}}%
6275 \def\temptype{#2}%
6276 \ifx\temptype\Ynothingkeyword
6277 \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
6278 \gdef\thischapter{\thischaptername}}%
6279 \else\ifx\temptype\Yomitfromtockeyword
6280 \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
6281 \gdef\thischapter{}}%
6282 \else\ifx\temptype\Yappendixkeyword
6283 \toks0={#1}%
6284 \xdef\lastchapterdefs{%
6285 \gdef\noexpand\thischaptername{\the\toks0}%
6286 \gdef\noexpand\thischapternum{\appendixletter}%
6287 % \noexpand\putwordAppendix avoids expanding indigestible
6288 % commands in some of the translations.
6289 \gdef\noexpand\thischapter{\noexpand\putwordAppendix{}
6290 \noexpand\thischapternum:
6291 \noexpand\thischaptername}%
6293 \else
6294 \toks0={#1}%
6295 \xdef\lastchapterdefs{%
6296 \gdef\noexpand\thischaptername{\the\toks0}%
6297 \gdef\noexpand\thischapternum{\the\chapno}%
6298 % \noexpand\putwordChapter avoids expanding indigestible
6299 % commands in some of the translations.
6300 \gdef\noexpand\thischapter{\noexpand\putwordChapter{}
6301 \noexpand\thischapternum:
6302 \noexpand\thischaptername}%
6304 \fi\fi\fi
6306 % Output the mark. Pass it through \safewhatsit, to take care of
6307 % the preceding space.
6308 \safewhatsit\domark
6310 % Insert the chapter heading break.
6311 \pchapsepmacro
6313 % Now the second mark, after the heading break. No break points
6314 % between here and the heading.
6315 \let\prevchapterdefs=\lastchapterdefs
6316 \let\prevsectiondefs=\lastsectiondefs
6317 \domark
6320 \chapfonts \rmisbold
6321 \let\footnote=\errfootnoteheading % give better error message
6323 % Have to define \lastsection before calling \donoderef, because the
6324 % xref code eventually uses it. On the other hand, it has to be called
6325 % after \pchapsepmacro, or the headline will change too soon.
6326 \gdef\lastsection{#1}%
6328 % Only insert the separating space if we have a chapter/appendix
6329 % number, and don't print the unnumbered ``number''.
6330 \ifx\temptype\Ynothingkeyword
6331 \setbox0 = \hbox{}%
6332 \def\toctype{unnchap}%
6333 \else\ifx\temptype\Yomitfromtockeyword
6334 \setbox0 = \hbox{}% contents like unnumbered, but no toc entry
6335 \def\toctype{omit}%
6336 \else\ifx\temptype\Yappendixkeyword
6337 \setbox0 = \hbox{\putwordAppendix{} #3\enspace}%
6338 \def\toctype{app}%
6339 \else
6340 \setbox0 = \hbox{#3\enspace}%
6341 \def\toctype{numchap}%
6342 \fi\fi\fi
6344 % Write the toc entry for this chapter. Must come before the
6345 % \donoderef, because we include the current node name in the toc
6346 % entry, and \donoderef resets it to empty.
6347 \writetocentry{\toctype}{#1}{#3}%
6349 % For pdftex, we have to write out the node definition (aka, make
6350 % the pdfdest) after any page break, but before the actual text has
6351 % been typeset. If the destination for the pdf outline is after the
6352 % text, then jumping from the outline may wind up with the text not
6353 % being visible, for instance under high magnification.
6354 \donoderef{#2}%
6356 % Typeset the actual heading.
6357 \nobreak % Avoid page breaks at the interline glue.
6358 \vbox{\raggedtitlesettings \hangindent=\wd0 \centerparametersmaybe
6359 \unhbox0 #1\par}%
6361 \nobreak\bigskip % no page break after a chapter title
6362 \nobreak
6365 % @centerchap -- centered and unnumbered.
6366 \let\centerparametersmaybe = \relax
6367 \def\centerparameters{%
6368 \advance\rightskip by 3\rightskip
6369 \leftskip = \rightskip
6370 \parfillskip = 0pt
6374 % I don't think this chapter style is supported any more, so I'm not
6375 % updating it with the new noderef stuff. We'll see. --karl, 11aug03.
6377 \parseargdef\setchapterstyle{\csname CHAPF#1\endcsname}
6379 \def\unnchfopen #1{%
6380 \chapoddpage
6381 \vbox{\chapfonts \raggedtitlesettings #1\par}%
6382 \nobreak\bigskip\nobreak
6384 \def\chfopen #1#2{\chapoddpage {\chapfonts
6385 \vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}%
6386 \par\penalty 5000 %
6388 \def\centerchfopen #1{%
6389 \chapoddpage
6390 \vbox{\chapfonts \raggedtitlesettings \hfill #1\hfill}%
6391 \nobreak\bigskip \nobreak
6393 \def\CHAPFopen{%
6394 \global\let\chapmacro=\chfopen
6395 \global\let\centerchapmacro=\centerchfopen}
6398 % Section titles. These macros combine the section number parts and
6399 % call the generic \sectionheading to do the printing.
6401 \newskip\secheadingskip
6402 \def\secheadingbreak{\dobreak \secheadingskip{-1000}}
6404 % Subsection titles.
6405 \newskip\subsecheadingskip
6406 \def\subsecheadingbreak{\dobreak \subsecheadingskip{-500}}
6408 % Subsubsection titles.
6409 \def\subsubsecheadingskip{\subsecheadingskip}
6410 \def\subsubsecheadingbreak{\subsecheadingbreak}
6413 % Print any size, any type, section title.
6415 % #1 is the text of the title,
6416 % #2 is the section level (sec/subsec/subsubsec),
6417 % #3 is the section type (Ynumbered, Ynothing, Yappendix, Yomitfromtoc),
6418 % #4 is the section number.
6420 \def\seckeyword{sec}
6422 \def\sectionheading#1#2#3#4{%
6424 \def\sectionlevel{#2}%
6425 \def\temptype{#3}%
6427 % It is ok for the @heading series commands to appear inside an
6428 % environment (it's been historically allowed, though the logic is
6429 % dubious), but not the others.
6430 \ifx\temptype\Yomitfromtockeyword\else
6431 \checkenv{}% non-@*heading should not be in an environment.
6433 \let\footnote=\errfootnoteheading
6435 % Switch to the right set of fonts.
6436 \csname #2fonts\endcsname \rmisbold
6438 % Insert first mark before the heading break (see notes for \domark).
6439 \let\prevsectiondefs=\lastsectiondefs
6440 \ifx\temptype\Ynothingkeyword
6441 \ifx\sectionlevel\seckeyword
6442 \gdef\lastsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}%
6443 \gdef\thissection{\thissectionname}}%
6445 \else\ifx\temptype\Yomitfromtockeyword
6446 % Don't redefine \thissection.
6447 \else\ifx\temptype\Yappendixkeyword
6448 \ifx\sectionlevel\seckeyword
6449 \toks0={#1}%
6450 \xdef\lastsectiondefs{%
6451 \gdef\noexpand\thissectionname{\the\toks0}%
6452 \gdef\noexpand\thissectionnum{#4}%
6453 % \noexpand\putwordSection avoids expanding indigestible
6454 % commands in some of the translations.
6455 \gdef\noexpand\thissection{\noexpand\putwordSection{}
6456 \noexpand\thissectionnum:
6457 \noexpand\thissectionname}%
6460 \else
6461 \ifx\sectionlevel\seckeyword
6462 \toks0={#1}%
6463 \xdef\lastsectiondefs{%
6464 \gdef\noexpand\thissectionname{\the\toks0}%
6465 \gdef\noexpand\thissectionnum{#4}%
6466 % \noexpand\putwordSection avoids expanding indigestible
6467 % commands in some of the translations.
6468 \gdef\noexpand\thissection{\noexpand\putwordSection{}
6469 \noexpand\thissectionnum:
6470 \noexpand\thissectionname}%
6473 \fi\fi\fi
6475 % Go into vertical mode. Usually we'll already be there, but we
6476 % don't want the following whatsit to end up in a preceding paragraph
6477 % if the document didn't happen to have a blank line.
6478 \par
6480 % Output the mark. Pass it through \safewhatsit, to take care of
6481 % the preceding space.
6482 \safewhatsit\domark
6484 % Insert space above the heading.
6485 \csname #2headingbreak\endcsname
6487 % Now the second mark, after the heading break. No break points
6488 % between here and the heading.
6489 \global\let\prevsectiondefs=\lastsectiondefs
6490 \domark
6492 % Only insert the space after the number if we have a section number.
6493 \ifx\temptype\Ynothingkeyword
6494 \setbox0 = \hbox{}%
6495 \def\toctype{unn}%
6496 \gdef\lastsection{#1}%
6497 \else\ifx\temptype\Yomitfromtockeyword
6498 % for @headings -- no section number, don't include in toc,
6499 % and don't redefine \lastsection.
6500 \setbox0 = \hbox{}%
6501 \def\toctype{omit}%
6502 \let\sectionlevel=\empty
6503 \else\ifx\temptype\Yappendixkeyword
6504 \setbox0 = \hbox{#4\enspace}%
6505 \def\toctype{app}%
6506 \gdef\lastsection{#1}%
6507 \else
6508 \setbox0 = \hbox{#4\enspace}%
6509 \def\toctype{num}%
6510 \gdef\lastsection{#1}%
6511 \fi\fi\fi
6513 % Write the toc entry (before \donoderef). See comments in \chapmacro.
6514 \writetocentry{\toctype\sectionlevel}{#1}{#4}%
6516 % Write the node reference (= pdf destination for pdftex).
6517 % Again, see comments in \chapmacro.
6518 \donoderef{#3}%
6520 % Interline glue will be inserted when the vbox is completed.
6521 % That glue will be a valid breakpoint for the page, since it'll be
6522 % preceded by a whatsit (usually from the \donoderef, or from the
6523 % \writetocentry if there was no node). We don't want to allow that
6524 % break, since then the whatsits could end up on page n while the
6525 % section is on page n+1, thus toc/etc. are wrong. Debian bug 276000.
6526 \nobreak
6528 % Output the actual section heading.
6529 \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \ptexraggedright
6530 \hangindent=\wd0 % zero if no section number
6531 \unhbox0 #1}%
6533 % Add extra space after the heading -- half of whatever came above it.
6534 % Don't allow stretch, though.
6535 \kern .5 \csname #2headingskip\endcsname
6537 % Do not let the kern be a potential breakpoint, as it would be if it
6538 % was followed by glue.
6539 \nobreak
6541 % We'll almost certainly start a paragraph next, so don't let that
6542 % glue accumulate. (Not a breakpoint because it's preceded by a
6543 % discardable item.) However, when a paragraph is not started next
6544 % (\startdefun, \cartouche, \center, etc.), this needs to be wiped out
6545 % or the negative glue will cause weirdly wrong output, typically
6546 % obscuring the section heading with something else.
6547 \vskip-\parskip
6549 % This is so the last item on the main vertical list is a known
6550 % \penalty > 10000, so \startdefun, etc., can recognize the situation
6551 % and do the needful.
6552 \penalty 10001
6556 \message{toc,}
6557 % Table of contents.
6558 \newwrite\tocfile
6560 % Write an entry to the toc file, opening it if necessary.
6561 % Called from @chapter, etc.
6563 % Example usage: \writetocentry{sec}{Section Name}{\the\chapno.\the\secno}
6564 % We append the current node name (if any) and page number as additional
6565 % arguments for the \{chap,sec,...}entry macros which will eventually
6566 % read this. The node name is used in the pdf outlines as the
6567 % destination to jump to.
6569 % We open the .toc file for writing here instead of at @setfilename (or
6570 % any other fixed time) so that @contents can be anywhere in the document.
6571 % But if #1 is `omit', then we don't do anything. This is used for the
6572 % table of contents chapter openings themselves.
6574 \newif\iftocfileopened
6575 \def\omitkeyword{omit}%
6577 \def\writetocentry#1#2#3{%
6578 \edef\writetoctype{#1}%
6579 \ifx\writetoctype\omitkeyword \else
6580 \iftocfileopened\else
6581 \immediate\openout\tocfile = \jobname.toc
6582 \global\tocfileopenedtrue
6585 \iflinks
6586 {\atdummies
6587 \edef\temp{%
6588 \write\tocfile{@#1entry{#2}{#3}{\lastnode}{\noexpand\folio}}}%
6589 \temp
6594 % Tell \shipout to create a pdf destination on each page, if we're
6595 % writing pdf. These are used in the table of contents. We can't
6596 % just write one on every page because the title pages are numbered
6597 % 1 and 2 (the page numbers aren't printed), and so are the first
6598 % two pages of the document. Thus, we'd have two destinations named
6599 % `1', and two named `2'.
6600 \ifpdf \global\pdfmakepagedesttrue \fi
6604 % These characters do not print properly in the Computer Modern roman
6605 % fonts, so we must take special care. This is more or less redundant
6606 % with the Texinfo input format setup at the end of this file.
6608 \def\activecatcodes{%
6609 \catcode`\"=\active
6610 \catcode`\$=\active
6611 \catcode`\<=\active
6612 \catcode`\>=\active
6613 \catcode`\\=\active
6614 \catcode`\^=\active
6615 \catcode`\_=\active
6616 \catcode`\|=\active
6617 \catcode`\~=\active
6621 % Read the toc file, which is essentially Texinfo input.
6622 \def\readtocfile{%
6623 \setupdatafile
6624 \activecatcodes
6625 \input \tocreadfilename
6628 \newskip\contentsrightmargin \contentsrightmargin=1in
6629 \newcount\savepageno
6630 \newcount\lastnegativepageno \lastnegativepageno = -1
6632 % Prepare to read what we've written to \tocfile.
6634 \def\startcontents#1{%
6635 % If @setchapternewpage on, and @headings double, the contents should
6636 % start on an odd page, unlike chapters. Thus, we maintain
6637 % \contentsalignmacro in parallel with \pagealignmacro.
6638 % From: Torbjorn Granlund <tege@matematik.su.se>
6639 \contentsalignmacro
6640 \immediate\closeout\tocfile
6642 % Don't need to put `Contents' or `Short Contents' in the headline.
6643 % It is abundantly clear what they are.
6644 \chapmacro{#1}{Yomitfromtoc}{}%
6646 \savepageno = \pageno
6647 \begingroup % Set up to handle contents files properly.
6648 \raggedbottom % Worry more about breakpoints than the bottom.
6649 \entryrightmargin=\contentsrightmargin % Don't use the full line length.
6651 % Roman numerals for page numbers.
6652 \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi
6655 % redefined for the two-volume lispref. We always output on
6656 % \jobname.toc even if this is redefined.
6658 \def\tocreadfilename{\jobname.toc}
6660 % Normal (long) toc.
6662 \def\contents{%
6663 \startcontents{\putwordTOC}%
6664 \openin 1 \tocreadfilename\space
6665 \ifeof 1 \else
6666 \readtocfile
6668 \vfill \eject
6669 \contentsalignmacro % in case @setchapternewpage odd is in effect
6670 \ifeof 1 \else
6671 \pdfmakeoutlines
6673 \closein 1
6674 \endgroup
6675 \lastnegativepageno = \pageno
6676 \global\pageno = \savepageno
6679 % And just the chapters.
6680 \def\summarycontents{%
6681 \startcontents{\putwordShortTOC}%
6683 \let\partentry = \shortpartentry
6684 \let\numchapentry = \shortchapentry
6685 \let\appentry = \shortchapentry
6686 \let\unnchapentry = \shortunnchapentry
6687 % We want a true roman here for the page numbers.
6688 \secfonts
6689 \let\rm=\shortcontrm \let\bf=\shortcontbf
6690 \let\sl=\shortcontsl \let\tt=\shortconttt
6692 \hyphenpenalty = 10000
6693 \advance\baselineskip by 1pt % Open it up a little.
6694 \def\numsecentry##1##2##3##4{}
6695 \let\appsecentry = \numsecentry
6696 \let\unnsecentry = \numsecentry
6697 \let\numsubsecentry = \numsecentry
6698 \let\appsubsecentry = \numsecentry
6699 \let\unnsubsecentry = \numsecentry
6700 \let\numsubsubsecentry = \numsecentry
6701 \let\appsubsubsecentry = \numsecentry
6702 \let\unnsubsubsecentry = \numsecentry
6703 \openin 1 \tocreadfilename\space
6704 \ifeof 1 \else
6705 \readtocfile
6707 \closein 1
6708 \vfill \eject
6709 \contentsalignmacro % in case @setchapternewpage odd is in effect
6710 \endgroup
6711 \lastnegativepageno = \pageno
6712 \global\pageno = \savepageno
6714 \let\shortcontents = \summarycontents
6716 % Typeset the label for a chapter or appendix for the short contents.
6717 % The arg is, e.g., `A' for an appendix, or `3' for a chapter.
6719 \def\shortchaplabel#1{%
6720 % This space should be enough, since a single number is .5em, and the
6721 % widest letter (M) is 1em, at least in the Computer Modern fonts.
6722 % But use \hss just in case.
6723 % (This space doesn't include the extra space that gets added after
6724 % the label; that gets put in by \shortchapentry above.)
6726 % We'd like to right-justify chapter numbers, but that looks strange
6727 % with appendix letters. And right-justifying numbers and
6728 % left-justifying letters looks strange when there is less than 10
6729 % chapters. Have to read the whole toc once to know how many chapters
6730 % there are before deciding ...
6731 \hbox to 1em{#1\hss}%
6734 % These macros generate individual entries in the table of contents.
6735 % The first argument is the chapter or section name.
6736 % The last argument is the page number.
6737 % The arguments in between are the chapter number, section number, ...
6739 % Parts, in the main contents. Replace the part number, which doesn't
6740 % exist, with an empty box. Let's hope all the numbers have the same width.
6741 % Also ignore the page number, which is conventionally not printed.
6742 \def\numeralbox{\setbox0=\hbox{8}\hbox to \wd0{\hfil}}
6743 \def\partentry#1#2#3#4{\dochapentry{\numeralbox\labelspace#1}{}}
6745 % Parts, in the short toc.
6746 \def\shortpartentry#1#2#3#4{%
6747 \penalty-300
6748 \vskip.5\baselineskip plus.15\baselineskip minus.1\baselineskip
6749 \shortchapentry{{\bf #1}}{\numeralbox}{}{}%
6752 % Chapters, in the main contents.
6753 \def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}}
6755 % Chapters, in the short toc.
6756 % See comments in \dochapentry re vbox and related settings.
6757 \def\shortchapentry#1#2#3#4{%
6758 \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#4\egroup}%
6761 % Appendices, in the main contents.
6762 % Need the word Appendix, and a fixed-size box.
6764 \def\appendixbox#1{%
6765 % We use M since it's probably the widest letter.
6766 \setbox0 = \hbox{\putwordAppendix{} M}%
6767 \hbox to \wd0{\putwordAppendix{} #1\hss}}
6769 \def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\hskip.7em#1}{#4}}
6771 % Unnumbered chapters.
6772 \def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}}
6773 \def\shortunnchapentry#1#2#3#4{\tocentry{#1}{\doshortpageno\bgroup#4\egroup}}
6775 % Sections.
6776 \def\numsecentry#1#2#3#4{\dosecentry{#2\labelspace#1}{#4}}
6777 \let\appsecentry=\numsecentry
6778 \def\unnsecentry#1#2#3#4{\dosecentry{#1}{#4}}
6780 % Subsections.
6781 \def\numsubsecentry#1#2#3#4{\dosubsecentry{#2\labelspace#1}{#4}}
6782 \let\appsubsecentry=\numsubsecentry
6783 \def\unnsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}}
6785 % And subsubsections.
6786 \def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#2\labelspace#1}{#4}}
6787 \let\appsubsubsecentry=\numsubsubsecentry
6788 \def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#4}}
6790 % This parameter controls the indentation of the various levels.
6791 % Same as \defaultparindent.
6792 \newdimen\tocindent \tocindent = 15pt
6794 % Now for the actual typesetting. In all these, #1 is the text and #2 is the
6795 % page number.
6797 % If the toc has to be broken over pages, we want it to be at chapters
6798 % if at all possible; hence the \penalty.
6799 \def\dochapentry#1#2{%
6800 \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip
6801 \begingroup
6802 % Move the page numbers slightly to the right
6803 \advance\entryrightmargin by -0.05em
6804 \chapentryfonts
6805 \tocentry{#1}{\dopageno\bgroup#2\egroup}%
6806 \endgroup
6807 \nobreak\vskip .25\baselineskip plus.1\baselineskip
6810 \def\dosecentry#1#2{\begingroup
6811 \secentryfonts \leftskip=\tocindent
6812 \tocentry{#1}{\dopageno\bgroup#2\egroup}%
6813 \endgroup}
6815 \def\dosubsecentry#1#2{\begingroup
6816 \subsecentryfonts \leftskip=2\tocindent
6817 \tocentry{#1}{\dopageno\bgroup#2\egroup}%
6818 \endgroup}
6820 \def\dosubsubsecentry#1#2{\begingroup
6821 \subsubsecentryfonts \leftskip=3\tocindent
6822 \tocentry{#1}{\dopageno\bgroup#2\egroup}%
6823 \endgroup}
6825 % We use the same \entry macro as for the index entries.
6826 \let\tocentry = \entry
6828 % Space between chapter (or whatever) number and the title.
6829 \def\labelspace{\hskip1em \relax}
6831 \def\dopageno#1{{\rm #1}}
6832 \def\doshortpageno#1{{\rm #1}}
6834 \def\chapentryfonts{\secfonts \rm}
6835 \def\secentryfonts{\textfonts}
6836 \def\subsecentryfonts{\textfonts}
6837 \def\subsubsecentryfonts{\textfonts}
6840 \message{environments,}
6841 % @foo ... @end foo.
6843 % @tex ... @end tex escapes into raw TeX temporarily.
6844 % One exception: @ is still an escape character, so that @end tex works.
6845 % But \@ or @@ will get a plain @ character.
6847 \envdef\tex{%
6848 \setupmarkupstyle{tex}%
6849 \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
6850 \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
6851 \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie
6852 \catcode `\%=14
6853 \catcode `\+=\other
6854 \catcode `\"=\other
6855 \catcode `\|=\other
6856 \catcode `\<=\other
6857 \catcode `\>=\other
6858 \catcode `\`=\other
6859 \catcode `\'=\other
6860 \escapechar=`\\
6862 % ' is active in math mode (mathcode"8000). So reset it, and all our
6863 % other math active characters (just in case), to plain's definitions.
6864 \mathactive
6866 % Inverse of the list at the beginning of the file.
6867 \let\b=\ptexb
6868 \let\bullet=\ptexbullet
6869 \let\c=\ptexc
6870 \let\,=\ptexcomma
6871 \let\.=\ptexdot
6872 \let\dots=\ptexdots
6873 \let\equiv=\ptexequiv
6874 \let\!=\ptexexclam
6875 \let\i=\ptexi
6876 \let\indent=\ptexindent
6877 \let\noindent=\ptexnoindent
6878 \let\{=\ptexlbrace
6879 \let\+=\tabalign
6880 \let\}=\ptexrbrace
6881 \let\/=\ptexslash
6882 \let\sp=\ptexsp
6883 \let\*=\ptexstar
6884 %\let\sup=\ptexsup % do not redefine, we want @sup to work in math mode
6885 \let\t=\ptext
6886 \expandafter \let\csname top\endcsname=\ptextop % we've made it outer
6887 \let\frenchspacing=\plainfrenchspacing
6889 \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
6890 \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}%
6891 \def\@{@}%
6893 % There is no need to define \Etex.
6895 % Define @lisp ... @end lisp.
6896 % @lisp environment forms a group so it can rebind things,
6897 % including the definition of @end lisp (which normally is erroneous).
6899 % Amount to narrow the margins by for @lisp.
6900 \newskip\lispnarrowing \lispnarrowing=0.4in
6902 % This is the definition that ^^M gets inside @lisp, @example, and other
6903 % such environments. \null is better than a space, since it doesn't
6904 % have any width.
6905 \def\lisppar{\null\endgraf}
6907 % This space is always present above and below environments.
6908 \newskip\envskipamount \envskipamount = 0pt
6910 % Make spacing and below environment symmetrical. We use \parskip here
6911 % to help in doing that, since in @example-like environments \parskip
6912 % is reset to zero; thus the \afterenvbreak inserts no space -- but the
6913 % start of the next paragraph will insert \parskip.
6915 \def\aboveenvbreak{{%
6916 % =10000 instead of <10000 because of a special case in \itemzzz and
6917 % \sectionheading, q.v.
6918 \ifnum \lastpenalty=10000 \else
6919 \advance\envskipamount by \parskip
6920 \endgraf
6921 \ifdim\lastskip<\envskipamount
6922 \removelastskip
6923 \ifnum\lastpenalty<10000
6924 % Penalize breaking before the environment, because preceding text
6925 % often leads into it.
6926 \penalty100
6928 \vskip\envskipamount
6933 \def\afterenvbreak{{%
6934 % =10000 instead of <10000 because of a special case in \itemzzz and
6935 % \sectionheading, q.v.
6936 \ifnum \lastpenalty=10000 \else
6937 \advance\envskipamount by \parskip
6938 \endgraf
6939 \ifdim\lastskip<\envskipamount
6940 \removelastskip
6941 % it's not a good place to break if the last penalty was \nobreak
6942 % or better ...
6943 \ifnum\lastpenalty<10000 \penalty-50 \fi
6944 \vskip\envskipamount
6949 % \nonarrowing is a flag. If "set", @lisp etc don't narrow margins; it will
6950 % also clear it, so that its embedded environments do the narrowing again.
6951 \let\nonarrowing=\relax
6953 % @cartouche ... @end cartouche: draw rectangle w/rounded corners around
6954 % environment contents.
6955 \font\circle=lcircle10
6956 \newdimen\circthick
6957 \newdimen\cartouter\newdimen\cartinner
6958 \newskip\normbskip\newskip\normpskip\newskip\normlskip
6959 \circthick=\fontdimen8\circle
6961 \def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth
6962 \def\ctr{{\hskip 6pt\circle\char'010}}
6963 \def\cbl{{\circle\char'012\hskip -6pt}}
6964 \def\cbr{{\hskip 6pt\circle\char'011}}
6965 \def\carttop{\hbox to \cartouter{\hskip\lskip
6966 \ctl\leaders\hrule height\circthick\hfil\ctr
6967 \hskip\rskip}}
6968 \def\cartbot{\hbox to \cartouter{\hskip\lskip
6969 \cbl\leaders\hrule height\circthick\hfil\cbr
6970 \hskip\rskip}}
6972 \newskip\lskip\newskip\rskip
6974 \envdef\cartouche{%
6975 \ifhmode\par\fi % can't be in the midst of a paragraph.
6976 \startsavinginserts
6977 \lskip=\leftskip \rskip=\rightskip
6978 \leftskip=0pt\rightskip=0pt % we want these *outside*.
6979 \cartinner=\hsize \advance\cartinner by-\lskip
6980 \advance\cartinner by-\rskip
6981 \cartouter=\hsize
6982 \advance\cartouter by 18.4pt % allow for 3pt kerns on either
6983 % side, and for 6pt waste from
6984 % each corner char, and rule thickness
6985 \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
6987 % If this cartouche directly follows a sectioning command, we need the
6988 % \parskip glue (backspaced over by default) or the cartouche can
6989 % collide with the section heading.
6990 \ifnum\lastpenalty>10000 \vskip\parskip \penalty\lastpenalty \fi
6992 \setbox\groupbox=\vbox\bgroup
6993 \baselineskip=0pt\parskip=0pt\lineskip=0pt
6994 \carttop
6995 \hbox\bgroup
6996 \hskip\lskip
6997 \vrule\kern3pt
6998 \vbox\bgroup
6999 \kern3pt
7000 \hsize=\cartinner
7001 \baselineskip=\normbskip
7002 \lineskip=\normlskip
7003 \parskip=\normpskip
7004 \vskip -\parskip
7005 \comment % For explanation, see the end of def\group.
7007 \def\Ecartouche{%
7008 \ifhmode\par\fi
7009 \kern3pt
7010 \egroup
7011 \kern3pt\vrule
7012 \hskip\rskip
7013 \egroup
7014 \cartbot
7015 \egroup
7016 \addgroupbox
7017 \checkinserts
7021 % This macro is called at the beginning of all the @example variants,
7022 % inside a group.
7023 \newdimen\nonfillparindent
7024 \def\nonfillstart{%
7025 \aboveenvbreak
7026 \ifdim\hfuzz < 12pt \hfuzz = 12pt \fi % Don't be fussy
7027 \sepspaces % Make spaces be word-separators rather than space tokens.
7028 \let\par = \lisppar % don't ignore blank lines
7029 \obeylines % each line of input is a line of output
7030 \parskip = 0pt
7031 % Turn off paragraph indentation but redefine \indent to emulate
7032 % the normal \indent.
7033 \nonfillparindent=\parindent
7034 \parindent = 0pt
7035 \let\indent\nonfillindent
7037 \emergencystretch = 0pt % don't try to avoid overfull boxes
7038 \ifx\nonarrowing\relax
7039 \advance \leftskip by \lispnarrowing
7040 \exdentamount=\lispnarrowing
7041 \else
7042 \let\nonarrowing = \relax
7044 \let\exdent=\nofillexdent
7047 \begingroup
7048 \obeyspaces
7049 % We want to swallow spaces (but not other tokens) after the fake
7050 % @indent in our nonfill-environments, where spaces are normally
7051 % active and set to @tie, resulting in them not being ignored after
7052 % @indent.
7053 \gdef\nonfillindent{\futurelet\temp\nonfillindentcheck}%
7054 \gdef\nonfillindentcheck{%
7055 \ifx\temp %
7056 \expandafter\nonfillindentgobble%
7057 \else%
7058 \leavevmode\nonfillindentbox%
7059 \fi%
7061 \endgroup
7062 \def\nonfillindentgobble#1{\nonfillindent}
7063 \def\nonfillindentbox{\hbox to \nonfillparindent{\hss}}
7065 % If you want all examples etc. small: @set dispenvsize small.
7066 % If you want even small examples the full size: @set dispenvsize nosmall.
7067 % This affects the following displayed environments:
7068 % @example, @display, @format, @lisp
7070 \def\smallword{small}
7071 \def\nosmallword{nosmall}
7072 \let\SETdispenvsize\relax
7073 \def\setnormaldispenv{%
7074 \ifx\SETdispenvsize\smallword
7075 % end paragraph for sake of leading, in case document has no blank
7076 % line. This is redundant with what happens in \aboveenvbreak, but
7077 % we need to do it before changing the fonts, and it's inconvenient
7078 % to change the fonts afterward.
7079 \ifnum \lastpenalty=10000 \else \endgraf \fi
7080 \smallexamplefonts \rm
7083 \def\setsmalldispenv{%
7084 \ifx\SETdispenvsize\nosmallword
7085 \else
7086 \ifnum \lastpenalty=10000 \else \endgraf \fi
7087 \smallexamplefonts \rm
7091 % We often define two environments, @foo and @smallfoo.
7092 % Let's do it in one command. #1 is the env name, #2 the definition.
7093 \def\makedispenvdef#1#2{%
7094 \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2}%
7095 \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2}%
7096 \expandafter\let\csname E#1\endcsname \afterenvbreak
7097 \expandafter\let\csname Esmall#1\endcsname \afterenvbreak
7100 % Define two environment synonyms (#1 and #2) for an environment.
7101 \def\maketwodispenvdef#1#2#3{%
7102 \makedispenvdef{#1}{#3}%
7103 \makedispenvdef{#2}{#3}%
7106 % @lisp: indented, narrowed, typewriter font;
7107 % @example: same as @lisp.
7109 % @smallexample and @smalllisp: use smaller fonts.
7110 % Originally contributed by Pavel@xerox.
7112 \maketwodispenvdef{lisp}{example}{%
7113 \nonfillstart
7114 \tt\setupmarkupstyle{example}%
7115 \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
7116 \gobble % eat return
7118 % @display/@smalldisplay: same as @lisp except keep current font.
7120 \makedispenvdef{display}{%
7121 \nonfillstart
7122 \gobble
7125 % @format/@smallformat: same as @display except don't narrow margins.
7127 \makedispenvdef{format}{%
7128 \let\nonarrowing = t%
7129 \nonfillstart
7130 \gobble
7133 % @flushleft: same as @format, but doesn't obey \SETdispenvsize.
7134 \envdef\flushleft{%
7135 \let\nonarrowing = t%
7136 \nonfillstart
7137 \gobble
7139 \let\Eflushleft = \afterenvbreak
7141 % @flushright.
7143 \envdef\flushright{%
7144 \let\nonarrowing = t%
7145 \nonfillstart
7146 \advance\leftskip by 0pt plus 1fill\relax
7147 \gobble
7149 \let\Eflushright = \afterenvbreak
7152 % @raggedright does more-or-less normal line breaking but no right
7153 % justification. From plain.tex. Don't stretch around special
7154 % characters in urls in this environment, since the stretch at the right
7155 % should be enough.
7156 \envdef\raggedright{%
7157 \rightskip0pt plus2.4em \spaceskip.3333em \xspaceskip.5em\relax
7158 \def\urefprestretchamount{0pt}%
7159 \def\urefpoststretchamount{0pt}%
7161 \let\Eraggedright\par
7163 \envdef\raggedleft{%
7164 \parindent=0pt \leftskip0pt plus2em
7165 \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt
7166 \hbadness=10000 % Last line will usually be underfull, so turn off
7167 % badness reporting.
7169 \let\Eraggedleft\par
7171 \envdef\raggedcenter{%
7172 \parindent=0pt \rightskip0pt plus1em \leftskip0pt plus1em
7173 \spaceskip.3333em \xspaceskip.5em \parfillskip=0pt
7174 \hbadness=10000 % Last line will usually be underfull, so turn off
7175 % badness reporting.
7177 \let\Eraggedcenter\par
7180 % @quotation does normal linebreaking (hence we can't use \nonfillstart)
7181 % and narrows the margins. We keep \parskip nonzero in general, since
7182 % we're doing normal filling. So, when using \aboveenvbreak and
7183 % \afterenvbreak, temporarily make \parskip 0.
7185 \makedispenvdef{quotation}{\quotationstart}
7187 \def\quotationstart{%
7188 \indentedblockstart % same as \indentedblock, but increase right margin too.
7189 \ifx\nonarrowing\relax
7190 \advance\rightskip by \lispnarrowing
7192 \parsearg\quotationlabel
7195 % We have retained a nonzero parskip for the environment, since we're
7196 % doing normal filling.
7198 \def\Equotation{%
7199 \par
7200 \ifx\quotationauthor\thisisundefined\else
7201 % indent a bit.
7202 \leftline{\kern 2\leftskip \sl ---\quotationauthor}%
7204 {\parskip=0pt \afterenvbreak}%
7206 \def\Esmallquotation{\Equotation}
7208 % If we're given an argument, typeset it in bold with a colon after.
7209 \def\quotationlabel#1{%
7210 \def\temp{#1}%
7211 \ifx\temp\empty \else
7212 {\bf #1: }%
7216 % @indentedblock is like @quotation, but indents only on the left and
7217 % has no optional argument.
7219 \makedispenvdef{indentedblock}{\indentedblockstart}
7221 \def\indentedblockstart{%
7222 {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
7223 \parindent=0pt
7225 % @cartouche defines \nonarrowing to inhibit narrowing at next level down.
7226 \ifx\nonarrowing\relax
7227 \advance\leftskip by \lispnarrowing
7228 \exdentamount = \lispnarrowing
7229 \else
7230 \let\nonarrowing = \relax
7234 % Keep a nonzero parskip for the environment, since we're doing normal filling.
7236 \def\Eindentedblock{%
7237 \par
7238 {\parskip=0pt \afterenvbreak}%
7240 \def\Esmallindentedblock{\Eindentedblock}
7243 % LaTeX-like @verbatim...@end verbatim and @verb{<char>...<char>}
7244 % If we want to allow any <char> as delimiter,
7245 % we need the curly braces so that makeinfo sees the @verb command, eg:
7246 % `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org
7248 % [Knuth]: Donald Ervin Knuth, 1996. The TeXbook.
7250 % [Knuth] p.344; only we need to do the other characters Texinfo sets
7251 % active too. Otherwise, they get lost as the first character on a
7252 % verbatim line.
7253 \def\dospecials{%
7254 \do\ \do\\\do\{\do\}\do\$\do\&%
7255 \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~%
7256 \do\<\do\>\do\|\do\@\do+\do\"%
7257 % Don't do the quotes -- if we do, @set txicodequoteundirected and
7258 % @set txicodequotebacktick will not have effect on @verb and
7259 % @verbatim, and ?` and !` ligatures won't get disabled.
7260 %\do\`\do\'%
7263 % [Knuth] p. 380
7264 \def\uncatcodespecials{%
7265 \def\do##1{\catcode`##1=\other}\dospecials}
7267 % Setup for the @verb command.
7269 % Eight spaces for a tab
7270 \begingroup
7271 \catcode`\^^I=\active
7272 \gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }}
7273 \endgroup
7275 \def\setupverb{%
7276 \tt % easiest (and conventionally used) font for verbatim
7277 \def\par{\leavevmode\endgraf}%
7278 \setupmarkupstyle{verb}%
7279 \tabeightspaces
7280 % Respect line breaks,
7281 % print special symbols as themselves, and
7282 % make each space count
7283 % must do in this order:
7284 \obeylines \uncatcodespecials \sepspaces
7287 % Setup for the @verbatim environment
7289 % Real tab expansion.
7290 \newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount
7292 % We typeset each line of the verbatim in an \hbox, so we can handle
7293 % tabs. The \global is in case the verbatim line starts with an accent,
7294 % or some other command that starts with a begin-group. Otherwise, the
7295 % entire \verbbox would disappear at the corresponding end-group, before
7296 % it is typeset. Meanwhile, we can't have nested verbatim commands
7297 % (can we?), so the \global won't be overwriting itself.
7298 \newbox\verbbox
7299 \def\starttabbox{\global\setbox\verbbox=\hbox\bgroup}
7301 \begingroup
7302 \catcode`\^^I=\active
7303 \gdef\tabexpand{%
7304 \catcode`\^^I=\active
7305 \def^^I{\leavevmode\egroup
7306 \dimen\verbbox=\wd\verbbox % the width so far, or since the previous tab
7307 \divide\dimen\verbbox by\tabw
7308 \multiply\dimen\verbbox by\tabw % compute previous multiple of \tabw
7309 \advance\dimen\verbbox by\tabw % advance to next multiple of \tabw
7310 \wd\verbbox=\dimen\verbbox \box\verbbox \starttabbox
7313 \endgroup
7315 % start the verbatim environment.
7316 \def\setupverbatim{%
7317 \let\nonarrowing = t%
7318 \nonfillstart
7319 \tt % easiest (and conventionally used) font for verbatim
7320 % The \leavevmode here is for blank lines. Otherwise, we would
7321 % never \starttabox and the \egroup would end verbatim mode.
7322 \def\par{\leavevmode\egroup\box\verbbox\endgraf}%
7323 \tabexpand
7324 \setupmarkupstyle{verbatim}%
7325 % Respect line breaks,
7326 % print special symbols as themselves, and
7327 % make each space count.
7328 % Must do in this order:
7329 \obeylines \uncatcodespecials \sepspaces
7330 \everypar{\starttabbox}%
7333 % Do the @verb magic: verbatim text is quoted by unique
7334 % delimiter characters. Before first delimiter expect a
7335 % right brace, after last delimiter expect closing brace:
7337 % \def\doverb'{'<char>#1<char>'}'{#1}
7339 % [Knuth] p. 382; only eat outer {}
7340 \begingroup
7341 \catcode`[=1\catcode`]=2\catcode`\{=\other\catcode`\}=\other
7342 \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next]
7343 \endgroup
7345 \def\verb{\begingroup\setupverb\doverb}
7348 % Do the @verbatim magic: define the macro \doverbatim so that
7349 % the (first) argument ends when '@end verbatim' is reached, ie:
7351 % \def\doverbatim#1@end verbatim{#1}
7353 % For Texinfo it's a lot easier than for LaTeX,
7354 % because texinfo's \verbatim doesn't stop at '\end{verbatim}':
7355 % we need not redefine '\', '{' and '}'.
7357 % Inspired by LaTeX's verbatim command set [latex.ltx]
7359 \begingroup
7360 \catcode`\ =\active
7361 \obeylines %
7362 % ignore everything up to the first ^^M, that's the newline at the end
7363 % of the @verbatim input line itself. Otherwise we get an extra blank
7364 % line in the output.
7365 \xdef\doverbatim#1^^M#2@end verbatim{#2\noexpand\end\gobble verbatim}%
7366 % We really want {...\end verbatim} in the body of the macro, but
7367 % without the active space; thus we have to use \xdef and \gobble.
7368 \endgroup
7370 \envdef\verbatim{%
7371 \setupverbatim\doverbatim
7373 \let\Everbatim = \afterenvbreak
7376 % @verbatiminclude FILE - insert text of file in verbatim environment.
7378 \def\verbatiminclude{\parseargusing\filenamecatcodes\doverbatiminclude}
7380 \def\doverbatiminclude#1{%
7382 \makevalueexpandable
7383 \setupverbatim
7384 \indexnofonts % Allow `@@' and other weird things in file names.
7385 \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}%
7386 \input #1
7387 \afterenvbreak
7391 % @copying ... @end copying.
7392 % Save the text away for @insertcopying later.
7394 % We save the uninterpreted tokens, rather than creating a box.
7395 % Saving the text in a box would be much easier, but then all the
7396 % typesetting commands (@smallbook, font changes, etc.) have to be done
7397 % beforehand -- and a) we want @copying to be done first in the source
7398 % file; b) letting users define the frontmatter in as flexible order as
7399 % possible is desirable.
7401 \def\copying{\checkenv{}\begingroup\scanargctxt\docopying}
7402 \def\docopying#1@end copying{\endgroup\def\copyingtext{#1}}
7404 \def\insertcopying{%
7405 \begingroup
7406 \parindent = 0pt % paragraph indentation looks wrong on title page
7407 \scanexp\copyingtext
7408 \endgroup
7412 \message{defuns,}
7413 % @defun etc.
7415 \newskip\defbodyindent \defbodyindent=.4in
7416 \newskip\defargsindent \defargsindent=50pt
7417 \newskip\deflastargmargin \deflastargmargin=18pt
7418 \newcount\defunpenalty
7420 % Start the processing of @deffn:
7421 \def\startdefun{%
7422 \ifnum\lastpenalty<10000
7423 \medbreak
7424 \defunpenalty=10003 % Will keep this @deffn together with the
7425 % following @def command, see below.
7426 \else
7427 % If there are two @def commands in a row, we'll have a \nobreak,
7428 % which is there to keep the function description together with its
7429 % header. But if there's nothing but headers, we need to allow a
7430 % break somewhere. Check specifically for penalty 10002, inserted
7431 % by \printdefunline, instead of 10000, since the sectioning
7432 % commands also insert a nobreak penalty, and we don't want to allow
7433 % a break between a section heading and a defun.
7435 % As a further refinement, we avoid "club" headers by signalling
7436 % with penalty of 10003 after the very first @deffn in the
7437 % sequence (see above), and penalty of 10002 after any following
7438 % @def command.
7439 \ifnum\lastpenalty=10002 \penalty2000 \else \defunpenalty=10002 \fi
7441 % Similarly, after a section heading, do not allow a break.
7442 % But do insert the glue.
7443 \medskip % preceded by discardable penalty, so not a breakpoint
7446 \parindent=0in
7447 \advance\leftskip by \defbodyindent
7448 \exdentamount=\defbodyindent
7451 \def\dodefunx#1{%
7452 % First, check whether we are in the right environment:
7453 \checkenv#1%
7455 % As above, allow line break if we have multiple x headers in a row.
7456 % It's not a great place, though.
7457 \ifnum\lastpenalty=10002 \penalty3000 \else \defunpenalty=10002 \fi
7459 % And now, it's time to reuse the body of the original defun:
7460 \expandafter\gobbledefun#1%
7462 \def\gobbledefun#1\startdefun{}
7464 % \printdefunline \deffnheader{text}
7466 \def\printdefunline#1#2{%
7467 \begingroup
7468 % call \deffnheader:
7469 #1#2 \endheader
7470 % common ending:
7471 \interlinepenalty = 10000
7472 \advance\rightskip by 0pt plus 1fil\relax
7473 \endgraf
7474 \nobreak\vskip -\parskip
7475 \penalty\defunpenalty % signal to \startdefun and \dodefunx
7476 % Some of the @defun-type tags do not enable magic parentheses,
7477 % rendering the following check redundant. But we don't optimize.
7478 \checkparencounts
7479 \endgroup
7482 \def\Edefun{\endgraf\medbreak}
7484 % \makedefun{deffn} creates \deffn, \deffnx and \Edeffn;
7485 % the only thing remaining is to define \deffnheader.
7487 \def\makedefun#1{%
7488 \expandafter\let\csname E#1\endcsname = \Edefun
7489 \edef\temp{\noexpand\domakedefun
7490 \makecsname{#1}\makecsname{#1x}\makecsname{#1header}}%
7491 \temp
7494 % \domakedefun \deffn \deffnx \deffnheader { (defn. of \deffnheader) }
7496 % Define \deffn and \deffnx, without parameters.
7497 % \deffnheader has to be defined explicitly.
7499 \def\domakedefun#1#2#3{%
7500 \envdef#1{%
7501 \startdefun
7502 \doingtypefnfalse % distinguish typed functions from all else
7503 \parseargusing\activeparens{\printdefunline#3}%
7505 \def#2{\dodefunx#1}%
7506 \def#3%
7509 \newif\ifdoingtypefn % doing typed function?
7510 \newif\ifrettypeownline % typeset return type on its own line?
7512 % @deftypefnnewline on|off says whether the return type of typed functions
7513 % are printed on their own line. This affects @deftypefn, @deftypefun,
7514 % @deftypeop, and @deftypemethod.
7516 \parseargdef\deftypefnnewline{%
7517 \def\temp{#1}%
7518 \ifx\temp\onword
7519 \expandafter\let\csname SETtxideftypefnnl\endcsname
7520 = \empty
7521 \else\ifx\temp\offword
7522 \expandafter\let\csname SETtxideftypefnnl\endcsname
7523 = \relax
7524 \else
7525 \errhelp = \EMsimple
7526 \errmessage{Unknown @txideftypefnnl value `\temp',
7527 must be on|off}%
7528 \fi\fi
7531 % Untyped functions:
7533 % @deffn category name args
7534 \makedefun{deffn}{\deffngeneral{}}
7536 % @deffn category class name args
7537 \makedefun{defop}#1 {\defopon{#1\ \putwordon}}
7539 % \defopon {category on}class name args
7540 \def\defopon#1#2 {\deffngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} }
7542 % \deffngeneral {subind}category name args
7544 \def\deffngeneral#1#2 #3 #4\endheader{%
7545 % Remember that \dosubind{fn}{foo}{} is equivalent to \doind{fn}{foo}.
7546 \dosubind{fn}{\code{#3}}{#1}%
7547 \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}%
7550 % Typed functions:
7552 % @deftypefn category type name args
7553 \makedefun{deftypefn}{\deftypefngeneral{}}
7555 % @deftypeop category class type name args
7556 \makedefun{deftypeop}#1 {\deftypeopon{#1\ \putwordon}}
7558 % \deftypeopon {category on}class type name args
7559 \def\deftypeopon#1#2 {\deftypefngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} }
7561 % \deftypefngeneral {subind}category type name args
7563 \def\deftypefngeneral#1#2 #3 #4 #5\endheader{%
7564 \dosubind{fn}{\code{#4}}{#1}%
7565 \doingtypefntrue
7566 \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
7569 % Typed variables:
7571 % @deftypevr category type var args
7572 \makedefun{deftypevr}{\deftypecvgeneral{}}
7574 % @deftypecv category class type var args
7575 \makedefun{deftypecv}#1 {\deftypecvof{#1\ \putwordof}}
7577 % \deftypecvof {category of}class type var args
7578 \def\deftypecvof#1#2 {\deftypecvgeneral{\putwordof\ \code{#2}}{#1\ \code{#2}} }
7580 % \deftypecvgeneral {subind}category type var args
7582 \def\deftypecvgeneral#1#2 #3 #4 #5\endheader{%
7583 \dosubind{vr}{\code{#4}}{#1}%
7584 \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
7587 % Untyped variables:
7589 % @defvr category var args
7590 \makedefun{defvr}#1 {\deftypevrheader{#1} {} }
7592 % @defcv category class var args
7593 \makedefun{defcv}#1 {\defcvof{#1\ \putwordof}}
7595 % \defcvof {category of}class var args
7596 \def\defcvof#1#2 {\deftypecvof{#1}#2 {} }
7598 % Types:
7600 % @deftp category name args
7601 \makedefun{deftp}#1 #2 #3\endheader{%
7602 \doind{tp}{\code{#2}}%
7603 \defname{#1}{}{#2}\defunargs{#3\unskip}%
7606 % Remaining @defun-like shortcuts:
7607 \makedefun{defun}{\deffnheader{\putwordDeffunc} }
7608 \makedefun{defmac}{\deffnheader{\putwordDefmac} }
7609 \makedefun{defspec}{\deffnheader{\putwordDefspec} }
7610 \makedefun{deftypefun}{\deftypefnheader{\putwordDeffunc} }
7611 \makedefun{defvar}{\defvrheader{\putwordDefvar} }
7612 \makedefun{defopt}{\defvrheader{\putwordDefopt} }
7613 \makedefun{deftypevar}{\deftypevrheader{\putwordDefvar} }
7614 \makedefun{defmethod}{\defopon\putwordMethodon}
7615 \makedefun{deftypemethod}{\deftypeopon\putwordMethodon}
7616 \makedefun{defivar}{\defcvof\putwordInstanceVariableof}
7617 \makedefun{deftypeivar}{\deftypecvof\putwordInstanceVariableof}
7619 % \defname, which formats the name of the @def (not the args).
7620 % #1 is the category, such as "Function".
7621 % #2 is the return type, if any.
7622 % #3 is the function name.
7624 % We are followed by (but not passed) the arguments, if any.
7626 \def\defname#1#2#3{%
7627 \par
7628 % Get the values of \leftskip and \rightskip as they were outside the @def...
7629 \advance\leftskip by -\defbodyindent
7631 % Determine if we are typesetting the return type of a typed function
7632 % on a line by itself.
7633 \rettypeownlinefalse
7634 \ifdoingtypefn % doing a typed function specifically?
7635 % then check user option for putting return type on its own line:
7636 \expandafter\ifx\csname SETtxideftypefnnl\endcsname\relax \else
7637 \rettypeownlinetrue
7641 % How we'll format the category name. Putting it in brackets helps
7642 % distinguish it from the body text that may end up on the next line
7643 % just below it.
7644 \def\temp{#1}%
7645 \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi}
7647 % Figure out line sizes for the paragraph shape. We'll always have at
7648 % least two.
7649 \tempnum = 2
7651 % The first line needs space for \box0; but if \rightskip is nonzero,
7652 % we need only space for the part of \box0 which exceeds it:
7653 \dimen0=\hsize \advance\dimen0 by -\wd0 \advance\dimen0 by \rightskip
7655 % If doing a return type on its own line, we'll have another line.
7656 \ifrettypeownline
7657 \advance\tempnum by 1
7658 \def\maybeshapeline{0in \hsize}%
7659 \else
7660 \def\maybeshapeline{}%
7663 % The continuations:
7664 \dimen2=\hsize \advance\dimen2 by -\defargsindent
7666 % The final paragraph shape:
7667 \parshape \tempnum 0in \dimen0 \maybeshapeline \defargsindent \dimen2
7669 % Put the category name at the right margin.
7670 \noindent
7671 \hbox to 0pt{%
7672 \hfil\box0 \kern-\hsize
7673 % \hsize has to be shortened this way:
7674 \kern\leftskip
7675 % Intentionally do not respect \rightskip, since we need the space.
7678 % Allow all lines to be underfull without complaint:
7679 \tolerance=10000 \hbadness=10000
7680 \exdentamount=\defbodyindent
7682 % defun fonts. We use typewriter by default (used to be bold) because:
7683 % . we're printing identifiers, they should be in tt in principle.
7684 % . in languages with many accents, such as Czech or French, it's
7685 % common to leave accents off identifiers. The result looks ok in
7686 % tt, but exceedingly strange in rm.
7687 % . we don't want -- and --- to be treated as ligatures.
7688 % . this still does not fix the ?` and !` ligatures, but so far no
7689 % one has made identifiers using them :).
7690 \df \tt
7691 \def\temp{#2}% text of the return type
7692 \ifx\temp\empty\else
7693 \tclose{\temp}% typeset the return type
7694 \ifrettypeownline
7695 % put return type on its own line; prohibit line break following:
7696 \hfil\vadjust{\nobreak}\break
7697 \else
7698 \space % type on same line, so just followed by a space
7700 \fi % no return type
7701 #3% output function name
7703 {\rm\enskip}% hskip 0.5 em of \tenrm
7705 \boldbrax
7706 % arguments will be output next, if any.
7709 % Print arguments in slanted roman (not ttsl), inconsistently with using
7710 % tt for the name. This is because literal text is sometimes needed in
7711 % the argument list (groff manual), and ttsl and tt are not very
7712 % distinguishable. Prevent hyphenation at `-' chars.
7714 \def\defunargs#1{%
7715 % use sl by default (not ttsl),
7716 % tt for the names.
7717 \df \sl \hyphenchar\font=0
7719 % On the other hand, if an argument has two dashes (for instance), we
7720 % want a way to get ttsl. We used to recommend @var for that, so
7721 % leave the code in, but it's strange for @var to lead to typewriter.
7722 % Nowadays we recommend @code, since the difference between a ttsl hyphen
7723 % and a tt hyphen is pretty tiny. @code also disables ?` !`.
7724 \def\var##1{{\setupmarkupstyle{var}\ttslanted{##1}}}%
7726 \sl\hyphenchar\font=45
7729 % We want ()&[] to print specially on the defun line.
7731 \def\activeparens{%
7732 \catcode`\(=\active \catcode`\)=\active
7733 \catcode`\[=\active \catcode`\]=\active
7734 \catcode`\&=\active
7737 % Make control sequences which act like normal parenthesis chars.
7738 \let\lparen = ( \let\rparen = )
7740 % Be sure that we always have a definition for `(', etc. For example,
7741 % if the fn name has parens in it, \boldbrax will not be in effect yet,
7742 % so TeX would otherwise complain about undefined control sequence.
7744 \activeparens
7745 \global\let(=\lparen \global\let)=\rparen
7746 \global\let[=\lbrack \global\let]=\rbrack
7747 \global\let& = \&
7749 \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}
7750 \gdef\magicamp{\let&=\amprm}
7753 \newcount\parencount
7755 % If we encounter &foo, then turn on ()-hacking afterwards
7756 \newif\ifampseen
7757 \def\amprm#1 {\ampseentrue{\bf\&#1 }}
7759 \def\parenfont{%
7760 \ifampseen
7761 % At the first level, print parens in roman,
7762 % otherwise use the default font.
7763 \ifnum \parencount=1 \rm \fi
7764 \else
7765 % The \sf parens (in \boldbrax) actually are a little bolder than
7766 % the contained text. This is especially needed for [ and ] .
7770 \def\infirstlevel#1{%
7771 \ifampseen
7772 \ifnum\parencount=1
7777 \def\bfafterword#1 {#1 \bf}
7779 \def\opnr{%
7780 \global\advance\parencount by 1
7781 {\parenfont(}%
7782 \infirstlevel \bfafterword
7784 \def\clnr{%
7785 {\parenfont)}%
7786 \infirstlevel \sl
7787 \global\advance\parencount by -1
7790 \newcount\brackcount
7791 \def\lbrb{%
7792 \global\advance\brackcount by 1
7793 {\bf[}%
7795 \def\rbrb{%
7796 {\bf]}%
7797 \global\advance\brackcount by -1
7800 \def\checkparencounts{%
7801 \ifnum\parencount=0 \else \badparencount \fi
7802 \ifnum\brackcount=0 \else \badbrackcount \fi
7804 % these should not use \errmessage; the glibc manual, at least, actually
7805 % has such constructs (when documenting function pointers).
7806 \def\badparencount{%
7807 \message{Warning: unbalanced parentheses in @def...}%
7808 \global\parencount=0
7810 \def\badbrackcount{%
7811 \message{Warning: unbalanced square brackets in @def...}%
7812 \global\brackcount=0
7816 \message{macros,}
7817 % @macro.
7819 % To do this right we need a feature of e-TeX, \scantokens,
7820 % which we arrange to emulate with a temporary file in ordinary TeX.
7821 \ifx\eTeXversion\thisisundefined
7822 \newwrite\macscribble
7823 \def\scantokens#1{%
7824 \toks0={#1}%
7825 \immediate\openout\macscribble=\jobname.tmp
7826 \immediate\write\macscribble{\the\toks0}%
7827 \immediate\closeout\macscribble
7828 \input \jobname.tmp
7832 \let\aftermacroxxx\relax
7833 \def\aftermacro{\aftermacroxxx}
7835 % alias because \c means cedilla in @tex or @math
7836 \let\texinfoc=\c
7838 % Used at the time of macro expansion.
7839 % Argument is macro body with arguments substituted
7840 \def\scanmacro#1{%
7841 \newlinechar`\^^M
7842 \def\xprocessmacroarg{\eatspaces}%
7844 % Process the macro body under the current catcode regime.
7845 \scantokens{#1\texinfoc}\aftermacro%
7847 % The \c is to remove the \newlinechar added by \scantokens, and
7848 % can be noticed by \parsearg.
7849 % The \aftermacro allows a \comment at the end of the macro definition
7850 % to duplicate itself past the final \newlinechar added by \scantokens:
7851 % this is used in the definition of \group to comment out a newline. We
7852 % don't do the same for \c to support Texinfo files with macros that ended
7853 % with a @c, which should no longer be necessary.
7854 % We avoid surrounding the call to \scantokens with \bgroup and \egroup
7855 % to allow macros to open or close groups themselves.
7858 % Used for copying and captions
7859 \def\scanexp#1{%
7860 \bgroup
7861 % Undo catcode changes of \startcontents and \printindex
7862 % When called from @insertcopying or (short)caption, we need active
7863 % backslash to get it printed correctly.
7864 % FIXME: This may not be needed.
7865 %\catcode`\@=0 \catcode`\\=\active \escapechar=`\@
7866 \edef\temp{\noexpand\scanmacro{#1}}%
7867 \temp
7868 \egroup
7871 \newcount\paramno % Count of parameters
7872 \newtoks\macname % Macro name
7873 \newif\ifrecursive % Is it recursive?
7875 % List of all defined macros in the form
7876 % \definedummyword\macro1\definedummyword\macro2...
7877 % Currently is also contains all @aliases; the list can be split
7878 % if there is a need.
7879 \def\macrolist{}
7881 % Add the macro to \macrolist
7882 \def\addtomacrolist#1{\expandafter \addtomacrolistxxx \csname#1\endcsname}
7883 \def\addtomacrolistxxx#1{%
7884 \toks0 = \expandafter{\macrolist\definedummyword#1}%
7885 \xdef\macrolist{\the\toks0}%
7888 % Utility routines.
7889 % This does \let #1 = #2, with \csnames; that is,
7890 % \let \csname#1\endcsname = \csname#2\endcsname
7891 % (except of course we have to play expansion games).
7893 \def\cslet#1#2{%
7894 \expandafter\let
7895 \csname#1\expandafter\endcsname
7896 \csname#2\endcsname
7899 % Trim leading and trailing spaces off a string.
7900 % Concepts from aro-bend problem 15 (see CTAN).
7901 {\catcode`\@=11
7902 \gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }}
7903 \gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@}
7904 \gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @}
7905 \def\unbrace#1{#1}
7906 \unbrace{\gdef\trim@@@ #1 } #2@{#1}
7909 % Trim a single trailing ^^M off a string.
7910 {\catcode`\^^M=\other \catcode`\Q=3%
7911 \gdef\eatcr #1{\eatcra #1Q^^MQ}%
7912 \gdef\eatcra#1^^MQ{\eatcrb#1Q}%
7913 \gdef\eatcrb#1Q#2Q{#1}%
7916 % Macro bodies are absorbed as an argument in a context where
7917 % all characters are catcode 10, 11 or 12, except \ which is active
7918 % (as in normal texinfo). It is necessary to change the definition of \
7919 % to recognize macro arguments; this is the job of \mbodybackslash.
7921 % Non-ASCII encodings make 8-bit characters active, so un-activate
7922 % them to avoid their expansion. Must do this non-globally, to
7923 % confine the change to the current group.
7925 % It's necessary to have hard CRs when the macro is executed. This is
7926 % done by making ^^M (\endlinechar) catcode 12 when reading the macro
7927 % body, and then making it the \newlinechar in \scanmacro.
7929 \def\scanctxt{% used as subroutine
7930 \catcode`\"=\other
7931 \catcode`\+=\other
7932 \catcode`\<=\other
7933 \catcode`\>=\other
7934 \catcode`\^=\other
7935 \catcode`\_=\other
7936 \catcode`\|=\other
7937 \catcode`\~=\other
7938 \ifx\declaredencoding\ascii \else \setcharscatcodeothernonglobal \fi
7941 \def\scanargctxt{% used for copying and captions, not macros.
7942 \scanctxt
7943 \catcode`\@=\other
7944 \catcode`\\=\other
7945 \catcode`\^^M=\other
7948 \def\macrobodyctxt{% used for @macro definitions
7949 \scanctxt
7950 \catcode`\ =\other
7951 \catcode`\@=\other
7952 \catcode`\{=\other
7953 \catcode`\}=\other
7954 \catcode`\^^M=\other
7955 \usembodybackslash
7958 % Used when scanning braced macro arguments. Note, however, that catcode
7959 % changes here are ineffectual if the macro invocation was nested inside
7960 % an argument to another Texinfo command.
7961 \def\macroargctxt{%
7962 \scanctxt
7963 \catcode`\ =\active
7964 \catcode`\^^M=\other
7965 \catcode`\\=\active
7968 \def\macrolineargctxt{% used for whole-line arguments without braces
7969 \scanctxt
7970 \catcode`\{=\other
7971 \catcode`\}=\other
7974 % \mbodybackslash is the definition of \ in @macro bodies.
7975 % It maps \foo\ => \csname macarg.foo\endcsname => #N
7976 % where N is the macro parameter number.
7977 % We define \csname macarg.\endcsname to be \realbackslash, so
7978 % \\ in macro replacement text gets you a backslash.
7980 {\catcode`@=0 @catcode`@\=@active
7981 @gdef@usembodybackslash{@let\=@mbodybackslash}
7982 @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname}
7984 \expandafter\def\csname macarg.\endcsname{\realbackslash}
7986 \def\margbackslash#1{\char`\#1 }
7988 \def\macro{\recursivefalse\parsearg\macroxxx}
7989 \def\rmacro{\recursivetrue\parsearg\macroxxx}
7991 \def\macroxxx#1{%
7992 \getargs{#1}% now \macname is the macname and \argl the arglist
7993 \ifx\argl\empty % no arguments
7994 \paramno=0\relax
7995 \else
7996 \expandafter\parsemargdef \argl;%
7997 \if\paramno>256\relax
7998 \ifx\eTeXversion\thisisundefined
7999 \errhelp = \EMsimple
8000 \errmessage{You need eTeX to compile a file with macros with more than 256 arguments}
8004 \if1\csname ismacro.\the\macname\endcsname
8005 \message{Warning: redefining \the\macname}%
8006 \else
8007 \expandafter\ifx\csname \the\macname\endcsname \relax
8008 \else \errmessage{Macro name \the\macname\space already defined}\fi
8009 \global\cslet{macsave.\the\macname}{\the\macname}%
8010 \global\expandafter\let\csname ismacro.\the\macname\endcsname=1%
8011 \addtomacrolist{\the\macname}%
8013 \begingroup \macrobodyctxt
8014 \ifrecursive \expandafter\parsermacbody
8015 \else \expandafter\parsemacbody
8016 \fi}
8018 \parseargdef\unmacro{%
8019 \if1\csname ismacro.#1\endcsname
8020 \global\cslet{#1}{macsave.#1}%
8021 \global\expandafter\let \csname ismacro.#1\endcsname=0%
8022 % Remove the macro name from \macrolist:
8023 \begingroup
8024 \expandafter\let\csname#1\endcsname \relax
8025 \let\definedummyword\unmacrodo
8026 \xdef\macrolist{\macrolist}%
8027 \endgroup
8028 \else
8029 \errmessage{Macro #1 not defined}%
8033 % Called by \do from \dounmacro on each macro. The idea is to omit any
8034 % macro definitions that have been changed to \relax.
8036 \def\unmacrodo#1{%
8037 \ifx #1\relax
8038 % remove this
8039 \else
8040 \noexpand\definedummyword \noexpand#1%
8044 % \getargs -- Parse the arguments to a @macro line. Set \macname to
8045 % the name of the macro, and \argl to the braced argument list.
8046 \def\getargs#1{\getargsxxx#1{}}
8047 \def\getargsxxx#1#{\getmacname #1 \relax\getmacargs}
8048 \def\getmacname#1 #2\relax{\macname={#1}}
8049 \def\getmacargs#1{\def\argl{#1}}
8050 % This made use of the feature that if the last token of a
8051 % <parameter list> is #, then the preceding argument is delimited by
8052 % an opening brace, and that opening brace is not consumed.
8054 % Parse the optional {params} list to @macro or @rmacro.
8055 % Set \paramno to the number of arguments,
8056 % and \paramlist to a parameter text for the macro (e.g. #1,#2,#3 for a
8057 % three-param macro.) Define \macarg.BLAH for each BLAH in the params
8058 % list to some hook where the argument is to be expanded. If there are
8059 % less than 10 arguments that hook is to be replaced by ##N where N
8060 % is the position in that list, that is to say the macro arguments are to be
8061 % defined `a la TeX in the macro body.
8063 % That gets used by \mbodybackslash (above).
8065 % If there are 10 or more arguments, a different technique is used: see
8066 % \parsemmanyargdef.
8068 \def\parsemargdef#1;{%
8069 \paramno=0\def\paramlist{}%
8070 \let\hash\relax
8071 % \hash is redefined to `#' later to get it into definitions
8072 \let\processmacroarg\relax
8073 \parsemargdefxxx#1,;,%
8074 \ifnum\paramno<10\relax\else
8075 \paramno0\relax
8076 \parsemmanyargdef@@#1,;,% 10 or more arguments
8079 \def\parsemargdefxxx#1,{%
8080 \if#1;\let\next=\relax
8081 \else \let\next=\parsemargdefxxx
8082 \advance\paramno by 1
8083 \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname
8084 {\processmacroarg{\hash\the\paramno}}%
8085 \edef\paramlist{\paramlist\hash\the\paramno,}%
8086 \fi\next}
8088 % \parsemacbody, \parsermacbody
8090 % Read recursive and nonrecursive macro bodies. (They're different since
8091 % rec and nonrec macros end differently.)
8093 % We are in \macrobodyctxt, and the \xdef causes backslashshes in the macro
8094 % body to be transformed.
8095 % Set \macrobody to the body of the macro, and call \defmacro.
8097 {\catcode`\ =\other\long\gdef\parsemacbody#1@end macro{%
8098 \xdef\macrobody{\eatcr{#1}}\endgroup\defmacro}}%
8099 {\catcode`\ =\other\long\gdef\parsermacbody#1@end rmacro{%
8100 \xdef\macrobody{\eatcr{#1}}\endgroup\defmacro}}%
8102 % Make @ a letter, so that we can make private-to-Texinfo macro names.
8103 \edef\texiatcatcode{\the\catcode`\@}
8104 \catcode `@=11\relax
8106 %%%%%%%%%%%%%% Code for > 10 arguments only %%%%%%%%%%%%%%%%%%
8108 % If there are 10 or more arguments, a different technique is used, where the
8109 % hook remains in the body, and when macro is to be expanded the body is
8110 % processed again to replace the arguments.
8112 % In that case, the hook is \the\toks N-1, and we simply set \toks N-1 to the
8113 % argument N value and then \edef the body (nothing else will expand because of
8114 % the catcode regime under which the body was input).
8116 % If you compile with TeX (not eTeX), and you have macros with 10 or more
8117 % arguments, no macro can have more than 256 arguments (else error).
8119 % In case that there are 10 or more arguments we parse again the arguments
8120 % list to set new definitions for the \macarg.BLAH macros corresponding to
8121 % each BLAH argument. It was anyhow needed to parse already once this list
8122 % in order to count the arguments, and as macros with at most 9 arguments
8123 % are by far more frequent than macro with 10 or more arguments, defining
8124 % twice the \macarg.BLAH macros does not cost too much processing power.
8125 \def\parsemmanyargdef@@#1,{%
8126 \if#1;\let\next=\relax
8127 \else
8128 \let\next=\parsemmanyargdef@@
8129 \edef\tempb{\eatspaces{#1}}%
8130 \expandafter\def\expandafter\tempa
8131 \expandafter{\csname macarg.\tempb\endcsname}%
8132 % Note that we need some extra \noexpand\noexpand, this is because we
8133 % don't want \the to be expanded in the \parsermacbody as it uses an
8134 % \xdef .
8135 \expandafter\edef\tempa
8136 {\noexpand\noexpand\noexpand\the\toks\the\paramno}%
8137 \advance\paramno by 1\relax
8138 \fi\next}
8141 \let\endargs@\relax
8142 \let\nil@\relax
8143 \def\nilm@{\nil@}%
8144 \long\def\nillm@{\nil@}%
8146 % This macro is expanded during the Texinfo macro expansion, not during its
8147 % definition. It gets all the arguments' values and assigns them to macros
8148 % macarg.ARGNAME
8150 % #1 is the macro name
8151 % #2 is the list of argument names
8152 % #3 is the list of argument values
8153 \def\getargvals@#1#2#3{%
8154 \def\macargdeflist@{}%
8155 \def\saveparamlist@{#2}% Need to keep a copy for parameter expansion.
8156 \def\paramlist{#2,\nil@}%
8157 \def\macroname{#1}%
8158 \begingroup
8159 \macroargctxt
8160 \def\argvaluelist{#3,\nil@}%
8161 \def\@tempa{#3}%
8162 \ifx\@tempa\empty
8163 \setemptyargvalues@
8164 \else
8165 \getargvals@@
8168 \def\getargvals@@{%
8169 \ifx\paramlist\nilm@
8170 % Some sanity check needed here that \argvaluelist is also empty.
8171 \ifx\argvaluelist\nillm@
8172 \else
8173 \errhelp = \EMsimple
8174 \errmessage{Too many arguments in macro `\macroname'!}%
8176 \let\next\macargexpandinbody@
8177 \else
8178 \ifx\argvaluelist\nillm@
8179 % No more arguments values passed to macro. Set remaining named-arg
8180 % macros to empty.
8181 \let\next\setemptyargvalues@
8182 \else
8183 % pop current arg name into \@tempb
8184 \def\@tempa##1{\pop@{\@tempb}{\paramlist}##1\endargs@}%
8185 \expandafter\@tempa\expandafter{\paramlist}%
8186 % pop current argument value into \@tempc
8187 \def\@tempa##1{\longpop@{\@tempc}{\argvaluelist}##1\endargs@}%
8188 \expandafter\@tempa\expandafter{\argvaluelist}%
8189 % Here \@tempb is the current arg name and \@tempc is the current arg value.
8190 % First place the new argument macro definition into \@tempd
8191 \expandafter\macname\expandafter{\@tempc}%
8192 \expandafter\let\csname macarg.\@tempb\endcsname\relax
8193 \expandafter\def\expandafter\@tempe\expandafter{%
8194 \csname macarg.\@tempb\endcsname}%
8195 \edef\@tempd{\long\def\@tempe{\the\macname}}%
8196 \push@\@tempd\macargdeflist@
8197 \let\next\getargvals@@
8200 \next
8203 \def\push@#1#2{%
8204 \expandafter\expandafter\expandafter\def
8205 \expandafter\expandafter\expandafter#2%
8206 \expandafter\expandafter\expandafter{%
8207 \expandafter#1#2}%
8210 % Replace arguments by their values in the macro body, and place the result
8211 % in macro \@tempa.
8213 \def\macvalstoargs@{%
8214 % To do this we use the property that token registers that are \the'ed
8215 % within an \edef expand only once. So we are going to place all argument
8216 % values into respective token registers.
8218 % First we save the token context, and initialize argument numbering.
8219 \begingroup
8220 \paramno0\relax
8221 % Then, for each argument number #N, we place the corresponding argument
8222 % value into a new token list register \toks#N
8223 \expandafter\putargsintokens@\saveparamlist@,;,%
8224 % Then, we expand the body so that argument are replaced by their
8225 % values. The trick for values not to be expanded themselves is that they
8226 % are within tokens and that tokens expand only once in an \edef .
8227 \edef\@tempc{\csname mac.\macroname .body\endcsname}%
8228 % Now we restore the token stack pointer to free the token list registers
8229 % which we have used, but we make sure that expanded body is saved after
8230 % group.
8231 \expandafter
8232 \endgroup
8233 \expandafter\def\expandafter\@tempa\expandafter{\@tempc}%
8236 % Define the named-macro outside of this group and then close this group.
8238 \def\macargexpandinbody@{%
8239 \expandafter
8240 \endgroup
8241 \macargdeflist@
8242 % First the replace in body the macro arguments by their values, the result
8243 % is in \@tempa .
8244 \macvalstoargs@
8245 % Then we point at the \norecurse or \gobble (for recursive) macro value
8246 % with \@tempb .
8247 \expandafter\let\expandafter\@tempb\csname mac.\macroname .recurse\endcsname
8248 % Depending on whether it is recursive or not, we need some tailing
8249 % \egroup .
8250 \ifx\@tempb\gobble
8251 \let\@tempc\relax
8252 \else
8253 \let\@tempc\egroup
8255 % And now we do the real job:
8256 \edef\@tempd{\noexpand\@tempb{\macroname}\noexpand\scanmacro{\@tempa}\@tempc}%
8257 \@tempd
8260 \def\putargsintokens@#1,{%
8261 \if#1;\let\next\relax
8262 \else
8263 \let\next\putargsintokens@
8264 % First we allocate the new token list register, and give it a temporary
8265 % alias \@tempb .
8266 \toksdef\@tempb\the\paramno
8267 % Then we place the argument value into that token list register.
8268 \expandafter\let\expandafter\@tempa\csname macarg.#1\endcsname
8269 \expandafter\@tempb\expandafter{\@tempa}%
8270 \advance\paramno by 1\relax
8272 \next
8275 % Trailing missing arguments are set to empty.
8277 \def\setemptyargvalues@{%
8278 \ifx\paramlist\nilm@
8279 \let\next\macargexpandinbody@
8280 \else
8281 \expandafter\setemptyargvaluesparser@\paramlist\endargs@
8282 \let\next\setemptyargvalues@
8284 \next
8287 \def\setemptyargvaluesparser@#1,#2\endargs@{%
8288 \expandafter\def\expandafter\@tempa\expandafter{%
8289 \expandafter\def\csname macarg.#1\endcsname{}}%
8290 \push@\@tempa\macargdeflist@
8291 \def\paramlist{#2}%
8294 % #1 is the element target macro
8295 % #2 is the list macro
8296 % #3,#4\endargs@ is the list value
8297 \def\pop@#1#2#3,#4\endargs@{%
8298 \def#1{#3}%
8299 \def#2{#4}%
8301 \long\def\longpop@#1#2#3,#4\endargs@{%
8302 \long\def#1{#3}%
8303 \long\def#2{#4}%
8307 %%%%%%%%%%%%%% End of code for > 10 arguments %%%%%%%%%%%%%%%%%%
8311 % Remove following spaces at the expansion stage.
8312 % This works because spaces are discarded before each argument when TeX is
8313 % getting the arguments for a macro.
8314 % This must not be immediately followed by a }.
8315 \long\def\gobblespaces#1{#1}
8317 % This defines a Texinfo @macro or @rmacro, called by \parsemacbody.
8318 % \macrobody has the body of the macro in it, with placeholders for
8319 % its parameters, looking like "\processmacroarg{\hash 1}".
8320 % \paramno is the number of parameters
8321 % \paramlist is a TeX parameter text, e.g. "#1,#2,#3,"
8322 % There are eight cases: recursive and nonrecursive macros of zero, one,
8323 % up to nine, and many arguments.
8324 % \xdef is used so that macro definitions will survive the file
8325 % they're defined in: @include reads the file inside a group.
8327 \def\defmacro{%
8328 \let\hash=##% convert placeholders to macro parameter chars
8329 \ifnum\paramno=1
8330 \def\processmacroarg{\gobblespaces}%
8331 % This removes the pair of braces around the argument. We don't
8332 % use \eatspaces, because this can cause ends of lines to be lost
8333 % when the argument to \eatspaces is read, leading to line-based
8334 % commands like "@itemize" not being read correctly.
8335 \else
8336 \def\processmacroarg{\xprocessmacroarg}%
8337 \let\xprocessmacroarg\relax
8339 \ifrecursive %%%%%%%%%%%%%% Recursive %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8340 \ifcase\paramno
8342 \expandafter\xdef\csname\the\macname\endcsname{%
8343 \noexpand\scanmacro{\macrobody}}%
8344 \or % 1
8345 \expandafter\xdef\csname\the\macname\endcsname{%
8346 \bgroup
8347 \noexpand\braceorline
8348 \expandafter\noexpand\csname\the\macname @@@\endcsname}%
8349 \expandafter\xdef\csname\the\macname @@@\endcsname##1{%
8350 \expandafter\noexpand\csname\the\macname @@@@\endcsname{%
8351 \noexpand\gobblespaces##1\empty}%
8352 % The \empty is for \gobblespaces in case #1 is empty
8354 \expandafter\xdef\csname\the\macname @@@@\endcsname##1{%
8355 \egroup\noexpand\scanmacro{\macrobody}}%
8356 \else
8357 \ifnum\paramno<10\relax % at most 9
8358 % See non-recursive section below for comments
8359 \expandafter\xdef\csname\the\macname\endcsname{%
8360 \bgroup
8361 \noexpand\expandafter
8362 \noexpand\macroargctxt
8363 \noexpand\expandafter
8364 \expandafter\noexpand\csname\the\macname @@\endcsname}%
8365 \expandafter\xdef\csname\the\macname @@\endcsname##1{%
8366 \noexpand\passargtomacro
8367 \expandafter\noexpand\csname\the\macname @@@\endcsname{##1,}}%
8368 \expandafter\xdef\csname\the\macname @@@\endcsname##1{%
8369 \expandafter\noexpand\csname\the\macname @@@@\endcsname ##1}%
8370 \expandafter\expandafter
8371 \expandafter\xdef
8372 \expandafter\expandafter
8373 \csname\the\macname @@@@\endcsname\paramlist{%
8374 \egroup\noexpand\scanmacro{\macrobody}}%
8375 \else % 10 or more
8376 \expandafter\xdef\csname\the\macname\endcsname{%
8377 \noexpand\getargvals@{\the\macname}{\argl}%
8379 \global\expandafter\let\csname mac.\the\macname .body\endcsname\macrobody
8380 \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\gobble
8383 \else %%%%%%%%%%%%%%%%%%%%%% Non-recursive %%%%%%%%%%%%%%%%%%%%%%%%%%
8384 \ifcase\paramno
8386 \expandafter\xdef\csname\the\macname\endcsname{%
8387 \noexpand\scanmacro{\macrobody}}%
8388 \or % 1
8389 \expandafter\xdef\csname\the\macname\endcsname{%
8390 \bgroup
8391 \noexpand\braceorline
8392 \expandafter\noexpand\csname\the\macname @@@\endcsname}%
8393 \expandafter\xdef\csname\the\macname @@@\endcsname##1{%
8394 \expandafter\noexpand\csname\the\macname @@@@\endcsname{%
8395 \noexpand\gobblespaces##1\empty}%
8396 % The \empty is for \gobblespaces in case #1 is empty
8398 \expandafter\xdef\csname\the\macname @@@@\endcsname##1{%
8399 \egroup
8400 \noexpand\scanmacro{\macrobody}%
8402 \else % at most 9
8403 \ifnum\paramno<10\relax
8404 % @MACNAME sets the context for reading the macro argument
8405 % @MACNAME@@ gets the argument, processes backslashes and appends a
8406 % comma.
8407 % @MACNAME@@@ removes braces surrounding the argument list.
8408 % @MACNAME@@@@ scans the macro body with arguments substituted.
8409 \expandafter\xdef\csname\the\macname\endcsname{%
8410 \bgroup
8411 \noexpand\expandafter % This \expandafter skip any spaces after the
8412 \noexpand\macroargctxt % macro before we change the catcode of space.
8413 \noexpand\expandafter
8414 \expandafter\noexpand\csname\the\macname @@\endcsname}%
8415 \expandafter\xdef\csname\the\macname @@\endcsname##1{%
8416 \noexpand\passargtomacro
8417 \expandafter\noexpand\csname\the\macname @@@\endcsname{##1,}}%
8418 \expandafter\xdef\csname\the\macname @@@\endcsname##1{%
8419 \expandafter\noexpand\csname\the\macname @@@@\endcsname ##1}%
8420 \expandafter\expandafter
8421 \expandafter\xdef
8422 \expandafter\expandafter
8423 \csname\the\macname @@@@\endcsname\paramlist{%
8424 \egroup\noexpand\scanmacro{\macrobody}}%
8425 \else % 10 or more:
8426 \expandafter\xdef\csname\the\macname\endcsname{%
8427 \noexpand\getargvals@{\the\macname}{\argl}%
8429 \global\expandafter\let\csname mac.\the\macname .body\endcsname\macrobody
8430 \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\norecurse
8433 \fi}
8435 \catcode `\@\texiatcatcode\relax % end private-to-Texinfo catcodes
8437 \def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}}
8440 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8442 {\catcode`\@=0 \catcode`\\=13 % We need to manipulate \ so use @ as escape
8443 @catcode`@_=11 % private names
8444 @catcode`@!=11 % used as argument separator
8446 % \passargtomacro#1#2 -
8447 % Call #1 with a list of tokens #2, with any doubled backslashes in #2
8448 % compressed to one.
8450 % This implementation works by expansion, and not execution (so we cannot use
8451 % \def or similar). This reduces the risk of this failing in contexts where
8452 % complete expansion is done with no execution (for example, in writing out to
8453 % an auxiliary file for an index entry).
8455 % State is kept in the input stream: the argument passed to
8456 % @look_ahead, @gobble_and_check_finish and @add_segment is
8458 % THE_MACRO ARG_RESULT ! {PENDING_BS} NEXT_TOKEN (... rest of input)
8460 % where:
8461 % THE_MACRO - name of the macro we want to call
8462 % ARG_RESULT - argument list we build to pass to that macro
8463 % PENDING_BS - either a backslash or nothing
8464 % NEXT_TOKEN - used to look ahead in the input stream to see what's coming next
8466 @gdef@passargtomacro#1#2{%
8467 @add_segment #1!{}@relax#2\@_finish\%
8469 @gdef@_finish{@_finishx} @global@let@_finishx@relax
8471 % #1 - THE_MACRO ARG_RESULT
8472 % #2 - PENDING_BS
8473 % #3 - NEXT_TOKEN
8474 % #4 used to look ahead
8476 % If the next token is not a backslash, process the rest of the argument;
8477 % otherwise, remove the next token.
8478 @gdef@look_ahead#1!#2#3#4{%
8479 @ifx#4\%
8480 @expandafter@gobble_and_check_finish
8481 @else
8482 @expandafter@add_segment
8483 @fi#1!{#2}#4#4%
8486 % #1 - THE_MACRO ARG_RESULT
8487 % #2 - PENDING_BS
8488 % #3 - NEXT_TOKEN
8489 % #4 should be a backslash, which is gobbled.
8490 % #5 looks ahead
8492 % Double backslash found. Add a single backslash, and look ahead.
8493 @gdef@gobble_and_check_finish#1!#2#3#4#5{%
8494 @add_segment#1\!{}#5#5%
8497 @gdef@is_fi{@fi}
8499 % #1 - THE_MACRO ARG_RESULT
8500 % #2 - PENDING_BS
8501 % #3 - NEXT_TOKEN
8502 % #4 is input stream until next backslash
8504 % Input stream is either at the start of the argument, or just after a
8505 % backslash sequence, either a lone backslash, or a doubled backslash.
8506 % NEXT_TOKEN contains the first token in the input stream: if it is \finish,
8507 % finish; otherwise, append to ARG_RESULT the segment of the argument up until
8508 % the next backslash. PENDING_BACKSLASH contains a backslash to represent
8509 % a backslash just before the start of the input stream that has not been
8510 % added to ARG_RESULT.
8511 @gdef@add_segment#1!#2#3#4\{%
8512 @ifx#3@_finish
8513 @call_the_macro#1!%
8514 @else
8515 % append the pending backslash to the result, followed by the next segment
8516 @expandafter@is_fi@look_ahead#1#2#4!{\}@fi
8517 % this @fi is discarded by @look_ahead.
8518 % we can't get rid of it with \expandafter because we don't know how
8519 % long #4 is.
8522 % #1 - THE_MACRO
8523 % #2 - ARG_RESULT
8524 % #3 discards the res of the conditional in @add_segment, and @is_fi ends the
8525 % conditional.
8526 @gdef@call_the_macro#1#2!#3@fi{@is_fi #1{#2}}
8529 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
8531 % \braceorline MAC is used for a one-argument macro MAC. It checks
8532 % whether the next non-whitespace character is a {. It sets the context
8533 % for reading the argument (slightly different in the two cases). Then,
8534 % to read the argument, in the whole-line case, it then calls the regular
8535 % \parsearg MAC; in the lbrace case, it calls \passargtomacro MAC.
8537 \def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx}
8538 \def\braceorlinexxx{%
8539 \ifx\nchar\bgroup
8540 \macroargctxt
8541 \expandafter\passargtomacro
8542 \else
8543 \macrolineargctxt\expandafter\parsearg
8544 \fi \macnamexxx}
8547 % @alias.
8548 % We need some trickery to remove the optional spaces around the equal
8549 % sign. Make them active and then expand them all to nothing.
8551 \def\alias{\parseargusing\obeyspaces\aliasxxx}
8552 \def\aliasxxx #1{\aliasyyy#1\relax}
8553 \def\aliasyyy #1=#2\relax{%
8555 \expandafter\let\obeyedspace=\empty
8556 \addtomacrolist{#1}%
8557 \xdef\next{\global\let\makecsname{#1}=\makecsname{#2}}%
8559 \next
8563 \message{cross references,}
8565 \newwrite\auxfile
8566 \newif\ifhavexrefs % True if xref values are known.
8567 \newif\ifwarnedxrefs % True if we warned once that they aren't known.
8569 % @inforef is relatively simple.
8570 \def\inforef #1{\inforefzzz #1,,,,**}
8571 \def\inforefzzz #1,#2,#3,#4**{%
8572 \putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
8573 node \samp{\ignorespaces#1{}}}
8575 % @node's only job in TeX is to define \lastnode, which is used in
8576 % cross-references. The @node line might or might not have commas, and
8577 % might or might not have spaces before the first comma, like:
8578 % @node foo , bar , ...
8579 % We don't want such trailing spaces in the node name.
8581 \parseargdef\node{\checkenv{}\donode #1 ,\finishnodeparse}
8583 % also remove a trailing comma, in case of something like this:
8584 % @node Help-Cross, , , Cross-refs
8585 \def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse}
8586 \def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}}
8588 \let\nwnode=\node
8589 \let\lastnode=\empty
8591 % Write a cross-reference definition for the current node. #1 is the
8592 % type (Ynumbered, Yappendix, Ynothing).
8594 \def\donoderef#1{%
8595 \ifx\lastnode\empty\else
8596 \setref{\lastnode}{#1}%
8597 \global\let\lastnode=\empty
8601 % @anchor{NAME} -- define xref target at arbitrary point.
8603 \newcount\savesfregister
8605 \def\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi}
8606 \def\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi}
8607 \def\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces}
8609 % \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an
8610 % anchor), which consists of three parts:
8611 % 1) NAME-title - the current sectioning name taken from \lastsection,
8612 % or the anchor name.
8613 % 2) NAME-snt - section number and type, passed as the SNT arg, or
8614 % empty for anchors.
8615 % 3) NAME-pg - the page number.
8617 % This is called from \donoderef, \anchor, and \dofloat. In the case of
8618 % floats, there is an additional part, which is not written here:
8619 % 4) NAME-lof - the text as it should appear in a @listoffloats.
8621 \def\setref#1#2{%
8622 \pdfmkdest{#1}%
8623 \iflinks
8625 \requireauxfile
8626 \atdummies % preserve commands, but don't expand them
8627 \edef\writexrdef##1##2{%
8628 \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef
8629 ##1}{##2}}% these are parameters of \writexrdef
8631 \toks0 = \expandafter{\lastsection}%
8632 \immediate \writexrdef{title}{\the\toks0 }%
8633 \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc.
8634 \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, at \shipout
8639 % @xrefautosectiontitle on|off says whether @section(ing) names are used
8640 % automatically in xrefs, if the third arg is not explicitly specified.
8641 % This was provided as a "secret" @set xref-automatic-section-title
8642 % variable, now it's official.
8644 \parseargdef\xrefautomaticsectiontitle{%
8645 \def\temp{#1}%
8646 \ifx\temp\onword
8647 \expandafter\let\csname SETxref-automatic-section-title\endcsname
8648 = \empty
8649 \else\ifx\temp\offword
8650 \expandafter\let\csname SETxref-automatic-section-title\endcsname
8651 = \relax
8652 \else
8653 \errhelp = \EMsimple
8654 \errmessage{Unknown @xrefautomaticsectiontitle value `\temp',
8655 must be on|off}%
8656 \fi\fi
8659 % \f
8660 % @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is
8661 % the node name, #2 the name of the Info cross-reference, #3 the printed
8662 % node name, #4 the name of the Info file, #5 the name of the printed
8663 % manual. All but the node name can be omitted.
8665 \def\pxref{\putwordsee{} \xrefXX}
8666 \def\xref{\putwordSee{} \xrefXX}
8667 \def\ref{\xrefXX}
8669 \def\xrefXX#1{\def\xrefXXarg{#1}\futurelet\tokenafterxref\xrefXXX}
8670 \def\xrefXXX{\expandafter\xrefX\expandafter[\xrefXXarg,,,,,,,]}
8672 \newbox\toprefbox
8673 \newbox\printedrefnamebox
8674 \newbox\infofilenamebox
8675 \newbox\printedmanualbox
8677 \def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
8678 \unsepspaces
8680 % Get args without leading/trailing spaces.
8681 \def\printedrefname{\ignorespaces #3}%
8682 \setbox\printedrefnamebox = \hbox{\printedrefname\unskip}%
8684 \def\infofilename{\ignorespaces #4}%
8685 \setbox\infofilenamebox = \hbox{\infofilename\unskip}%
8687 \def\printedmanual{\ignorespaces #5}%
8688 \setbox\printedmanualbox = \hbox{\printedmanual\unskip}%
8690 % If the printed reference name (arg #3) was not explicitly given in
8691 % the @xref, figure out what we want to use.
8692 \ifdim \wd\printedrefnamebox = 0pt
8693 % No printed node name was explicitly given.
8694 \expandafter\ifx\csname SETxref-automatic-section-title\endcsname \relax
8695 % Not auto section-title: use node name inside the square brackets.
8696 \def\printedrefname{\ignorespaces #1}%
8697 \else
8698 % Auto section-title: use chapter/section title inside
8699 % the square brackets if we have it.
8700 \ifdim \wd\printedmanualbox > 0pt
8701 % It is in another manual, so we don't have it; use node name.
8702 \def\printedrefname{\ignorespaces #1}%
8703 \else
8704 \ifhavexrefs
8705 % We (should) know the real title if we have the xref values.
8706 \def\printedrefname{\refx{#1-title}{}}%
8707 \else
8708 % Otherwise just copy the Info node name.
8709 \def\printedrefname{\ignorespaces #1}%
8710 \fi%
8715 % Make link in pdf output.
8716 \ifpdf
8717 {\indexnofonts
8718 \turnoffactive
8719 \makevalueexpandable
8720 % This expands tokens, so do it after making catcode changes, so _
8721 % etc. don't get their TeX definitions. This ignores all spaces in
8722 % #4, including (wrongly) those in the middle of the filename.
8723 \getfilename{#4}%
8725 % This (wrongly) does not take account of leading or trailing
8726 % spaces in #1, which should be ignored.
8727 \edef\pdfxrefdest{#1}%
8728 \ifx\pdfxrefdest\empty
8729 \def\pdfxrefdest{Top}% no empty targets
8730 \else
8731 \txiescapepdf\pdfxrefdest % escape PDF special chars
8734 \leavevmode
8735 \startlink attr{/Border [0 0 0]}%
8736 \ifnum\filenamelength>0
8737 goto file{\the\filename.pdf} name{\pdfxrefdest}%
8738 \else
8739 goto name{\pdfmkpgn{\pdfxrefdest}}%
8742 \setcolor{\linkcolor}%
8745 % Have to otherify everything special to allow the \csname to
8746 % include an _ in the xref name, etc.
8747 \indexnofonts
8748 \turnoffactive
8749 \expandafter\global\expandafter\let\expandafter\Xthisreftitle
8750 \csname XR#1-title\endcsname
8753 % Float references are printed completely differently: "Figure 1.2"
8754 % instead of "[somenode], p.3". \iffloat distinguishes them by
8755 % \Xthisreftitle being set to a magic string.
8756 \iffloat\Xthisreftitle
8757 % If the user specified the print name (third arg) to the ref,
8758 % print it instead of our usual "Figure 1.2".
8759 \ifdim\wd\printedrefnamebox = 0pt
8760 \refx{#1-snt}{}%
8761 \else
8762 \printedrefname
8765 % If the user also gave the printed manual name (fifth arg), append
8766 % "in MANUALNAME".
8767 \ifdim \wd\printedmanualbox > 0pt
8768 \space \putwordin{} \cite{\printedmanual}%
8770 \else
8771 % node/anchor (non-float) references.
8773 % If we use \unhbox to print the node names, TeX does not insert
8774 % empty discretionaries after hyphens, which means that it will not
8775 % find a line break at a hyphen in a node names. Since some manuals
8776 % are best written with fairly long node names, containing hyphens,
8777 % this is a loss. Therefore, we give the text of the node name
8778 % again, so it is as if TeX is seeing it for the first time.
8780 \ifdim \wd\printedmanualbox > 0pt
8781 % Cross-manual reference with a printed manual name.
8783 \crossmanualxref{\cite{\printedmanual\unskip}}%
8785 \else\ifdim \wd\infofilenamebox > 0pt
8786 % Cross-manual reference with only an info filename (arg 4), no
8787 % printed manual name (arg 5). This is essentially the same as
8788 % the case above; we output the filename, since we have nothing else.
8790 \crossmanualxref{\code{\infofilename\unskip}}%
8792 \else
8793 % Reference within this manual.
8795 % _ (for example) has to be the character _ for the purposes of the
8796 % control sequence corresponding to the node, but it has to expand
8797 % into the usual \leavevmode...\vrule stuff for purposes of
8798 % printing. So we \turnoffactive for the \refx-snt, back on for the
8799 % printing, back off for the \refx-pg.
8800 {\turnoffactive
8801 % Only output a following space if the -snt ref is nonempty; for
8802 % @unnumbered and @anchor, it won't be.
8803 \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}%
8804 \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
8806 % output the `[mynode]' via the macro below so it can be overridden.
8807 \xrefprintnodename\printedrefname
8809 % But we always want a comma and a space:
8810 ,\space
8812 % output the `page 3'.
8813 \turnoffactive \putwordpage\tie\refx{#1-pg}{}%
8814 % Add a , if xref followed by a space
8815 \if\space\noexpand\tokenafterxref ,%
8816 \else\ifx\ \tokenafterxref ,% @TAB
8817 \else\ifx\*\tokenafterxref ,% @*
8818 \else\ifx\ \tokenafterxref ,% @SPACE
8819 \else\ifx\
8820 \tokenafterxref ,% @NL
8821 \else\ifx\tie\tokenafterxref ,% @tie
8822 \fi\fi\fi\fi\fi\fi
8823 \fi\fi
8825 \endlink
8826 \endgroup}
8828 % Output a cross-manual xref to #1. Used just above (twice).
8830 % Only include the text "Section ``foo'' in" if the foo is neither
8831 % missing or Top. Thus, @xref{,,,foo,The Foo Manual} outputs simply
8832 % "see The Foo Manual", the idea being to refer to the whole manual.
8834 % But, this being TeX, we can't easily compare our node name against the
8835 % string "Top" while ignoring the possible spaces before and after in
8836 % the input. By adding the arbitrary 7sp below, we make it much less
8837 % likely that a real node name would have the same width as "Top" (e.g.,
8838 % in a monospaced font). Hopefully it will never happen in practice.
8840 % For the same basic reason, we retypeset the "Top" at every
8841 % reference, since the current font is indeterminate.
8843 \def\crossmanualxref#1{%
8844 \setbox\toprefbox = \hbox{Top\kern7sp}%
8845 \setbox2 = \hbox{\ignorespaces \printedrefname \unskip \kern7sp}%
8846 \ifdim \wd2 > 7sp % nonempty?
8847 \ifdim \wd2 = \wd\toprefbox \else % same as Top?
8848 \putwordSection{} ``\printedrefname'' \putwordin{}\space
8854 % This macro is called from \xrefX for the `[nodename]' part of xref
8855 % output. It's a separate macro only so it can be changed more easily,
8856 % since square brackets don't work well in some documents. Particularly
8857 % one that Bob is working on :).
8859 \def\xrefprintnodename#1{[#1]}
8861 % Things referred to by \setref.
8863 \def\Ynothing{}
8864 \def\Yomitfromtoc{}
8865 \def\Ynumbered{%
8866 \ifnum\secno=0
8867 \putwordChapter@tie \the\chapno
8868 \else \ifnum\subsecno=0
8869 \putwordSection@tie \the\chapno.\the\secno
8870 \else \ifnum\subsubsecno=0
8871 \putwordSection@tie \the\chapno.\the\secno.\the\subsecno
8872 \else
8873 \putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno
8874 \fi\fi\fi
8876 \def\Yappendix{%
8877 \ifnum\secno=0
8878 \putwordAppendix@tie @char\the\appendixno{}%
8879 \else \ifnum\subsecno=0
8880 \putwordSection@tie @char\the\appendixno.\the\secno
8881 \else \ifnum\subsubsecno=0
8882 \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno
8883 \else
8884 \putwordSection@tie
8885 @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno
8886 \fi\fi\fi
8889 % Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
8890 % If its value is nonempty, SUFFIX is output afterward.
8892 \def\refx#1#2{%
8893 \requireauxfile
8895 \indexnofonts
8896 \otherbackslash
8897 \expandafter\global\expandafter\let\expandafter\thisrefX
8898 \csname XR#1\endcsname
8900 \ifx\thisrefX\relax
8901 % If not defined, say something at least.
8902 \angleleft un\-de\-fined\angleright
8903 \iflinks
8904 \ifhavexrefs
8905 {\toks0 = {#1}% avoid expansion of possibly-complex value
8906 \message{\linenumber Undefined cross reference `\the\toks0'.}}%
8907 \else
8908 \ifwarnedxrefs\else
8909 \global\warnedxrefstrue
8910 \message{Cross reference values unknown; you must run TeX again.}%
8914 \else
8915 % It's defined, so just use it.
8916 \thisrefX
8918 #2% Output the suffix in any case.
8921 % This is the macro invoked by entries in the aux file. Usually it's
8922 % just a \def (we prepend XR to the control sequence name to avoid
8923 % collisions). But if this is a float type, we have more work to do.
8925 \def\xrdef#1#2{%
8926 {% The node name might contain 8-bit characters, which in our current
8927 % implementation are changed to commands like @'e. Don't let these
8928 % mess up the control sequence name.
8929 \indexnofonts
8930 \turnoffactive
8931 \xdef\safexrefname{#1}%
8934 \expandafter\gdef\csname XR\safexrefname\endcsname{#2}% remember this xref
8936 % Was that xref control sequence that we just defined for a float?
8937 \expandafter\iffloat\csname XR\safexrefname\endcsname
8938 % it was a float, and we have the (safe) float type in \iffloattype.
8939 \expandafter\let\expandafter\floatlist
8940 \csname floatlist\iffloattype\endcsname
8942 % Is this the first time we've seen this float type?
8943 \expandafter\ifx\floatlist\relax
8944 \toks0 = {\do}% yes, so just \do
8945 \else
8946 % had it before, so preserve previous elements in list.
8947 \toks0 = \expandafter{\floatlist\do}%
8950 % Remember this xref in the control sequence \floatlistFLOATTYPE,
8951 % for later use in \listoffloats.
8952 \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0
8953 {\safexrefname}}%
8957 % If working on a large document in chapters, it is convenient to
8958 % be able to disable indexing, cross-referencing, and contents, for test runs.
8959 % This is done with @novalidate at the beginning of the file.
8961 \newif\iflinks \linkstrue % by default we want the aux files.
8962 \let\novalidate = \linksfalse
8964 % Used when writing to the aux file, or when using data from it.
8965 \def\requireauxfile{%
8966 \iflinks
8967 \tryauxfile
8968 % Open the new aux file. TeX will close it automatically at exit.
8969 \immediate\openout\auxfile=\jobname.aux
8971 \global\let\requireauxfile=\relax % Only do this once.
8974 % Read the last existing aux file, if any. No error if none exists.
8976 \def\tryauxfile{%
8977 \openin 1 \jobname.aux
8978 \ifeof 1 \else
8979 \readdatafile{aux}%
8980 \global\havexrefstrue
8982 \closein 1
8985 \def\setupdatafile{%
8986 \catcode`\^^@=\other
8987 \catcode`\^^A=\other
8988 \catcode`\^^B=\other
8989 \catcode`\^^C=\other
8990 \catcode`\^^D=\other
8991 \catcode`\^^E=\other
8992 \catcode`\^^F=\other
8993 \catcode`\^^G=\other
8994 \catcode`\^^H=\other
8995 \catcode`\^^K=\other
8996 \catcode`\^^L=\other
8997 \catcode`\^^N=\other
8998 \catcode`\^^P=\other
8999 \catcode`\^^Q=\other
9000 \catcode`\^^R=\other
9001 \catcode`\^^S=\other
9002 \catcode`\^^T=\other
9003 \catcode`\^^U=\other
9004 \catcode`\^^V=\other
9005 \catcode`\^^W=\other
9006 \catcode`\^^X=\other
9007 \catcode`\^^Z=\other
9008 \catcode`\^^[=\other
9009 \catcode`\^^\=\other
9010 \catcode`\^^]=\other
9011 \catcode`\^^^=\other
9012 \catcode`\^^_=\other
9013 % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc.
9014 % in xref tags, i.e., node names. But since ^^e4 notation isn't
9015 % supported in the main text, it doesn't seem desirable. Furthermore,
9016 % that is not enough: for node names that actually contain a ^
9017 % character, we would end up writing a line like this: 'xrdef {'hat
9018 % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first
9019 % argument, and \hat is not an expandable control sequence. It could
9020 % all be worked out, but why? Either we support ^^ or we don't.
9022 % The other change necessary for this was to define \auxhat:
9023 % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter
9024 % and then to call \auxhat in \setq.
9026 \catcode`\^=\other
9028 % Special characters. Should be turned off anyway, but...
9029 \catcode`\~=\other
9030 \catcode`\[=\other
9031 \catcode`\]=\other
9032 \catcode`\"=\other
9033 \catcode`\_=\other
9034 \catcode`\|=\other
9035 \catcode`\<=\other
9036 \catcode`\>=\other
9037 \catcode`\$=\other
9038 \catcode`\#=\other
9039 \catcode`\&=\other
9040 \catcode`\%=\other
9041 \catcode`+=\other % avoid \+ for paranoia even though we've turned it off
9043 % This is to support \ in node names and titles, since the \
9044 % characters end up in a \csname. It's easier than
9045 % leaving it active and making its active definition an actual \
9046 % character. What I don't understand is why it works in the *value*
9047 % of the xrdef. Seems like it should be a catcode12 \, and that
9048 % should not typeset properly. But it works, so I'm moving on for
9049 % now. --karl, 15jan04.
9050 \catcode`\\=\other
9052 % Make the characters 128-255 be printing characters.
9053 {\setcharscatcodeothernonglobal}%
9055 % @ is our escape character in .aux files, and we need braces.
9056 \catcode`\{=1
9057 \catcode`\}=2
9058 \catcode`\@=0
9061 \def\readdatafile#1{%
9062 \begingroup
9063 \setupdatafile
9064 \input\jobname.#1
9065 \endgroup}
9068 \message{insertions,}
9069 % including footnotes.
9071 \newcount \footnoteno
9073 % The trailing space in the following definition for supereject is
9074 % vital for proper filling; pages come out unaligned when you do a
9075 % pagealignmacro call if that space before the closing brace is
9076 % removed. (Generally, numeric constants should always be followed by a
9077 % space to prevent strange expansion errors.)
9078 \def\supereject{\par\penalty -20000\footnoteno =0 }
9080 % @footnotestyle is meaningful for Info output only.
9081 \let\footnotestyle=\comment
9083 {\catcode `\@=11
9085 % Auto-number footnotes. Otherwise like plain.
9086 \gdef\footnote{%
9087 \global\advance\footnoteno by \@ne
9088 \edef\thisfootno{$^{\the\footnoteno}$}%
9090 % In case the footnote comes at the end of a sentence, preserve the
9091 % extra spacing after we do the footnote number.
9092 \let\@sf\empty
9093 \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi
9095 % Remove inadvertent blank space before typesetting the footnote number.
9096 \unskip
9097 \thisfootno\@sf
9098 \dofootnote
9101 % Don't bother with the trickery in plain.tex to not require the
9102 % footnote text as a parameter. Our footnotes don't need to be so general.
9104 % Oh yes, they do; otherwise, @ifset (and anything else that uses
9105 % \parseargline) fails inside footnotes because the tokens are fixed when
9106 % the footnote is read. --karl, 16nov96.
9108 \gdef\dofootnote{%
9109 \insert\footins\bgroup
9111 % Nested footnotes are not supported in TeX, that would take a lot
9112 % more work. (\startsavinginserts does not suffice.)
9113 \let\footnote=\errfootnotenest
9115 % We want to typeset this text as a normal paragraph, even if the
9116 % footnote reference occurs in (for example) a display environment.
9117 % So reset some parameters.
9118 \hsize=\txipagewidth
9119 \interlinepenalty\interfootnotelinepenalty
9120 \splittopskip\ht\strutbox % top baseline for broken footnotes
9121 \splitmaxdepth\dp\strutbox
9122 \floatingpenalty\@MM
9123 \leftskip\z@skip
9124 \rightskip\z@skip
9125 \spaceskip\z@skip
9126 \xspaceskip\z@skip
9127 \parindent\defaultparindent
9129 \smallfonts \rm
9131 % Because we use hanging indentation in footnotes, a @noindent appears
9132 % to exdent this text, so make it be a no-op. makeinfo does not use
9133 % hanging indentation so @noindent can still be needed within footnote
9134 % text after an @example or the like (not that this is good style).
9135 \let\noindent = \relax
9137 % Hang the footnote text off the number. Use \everypar in case the
9138 % footnote extends for more than one paragraph.
9139 \everypar = {\hang}%
9140 \textindent{\thisfootno}%
9142 % Don't crash into the line above the footnote text. Since this
9143 % expands into a box, it must come within the paragraph, lest it
9144 % provide a place where TeX can split the footnote.
9145 \footstrut
9147 % Invoke rest of plain TeX footnote routine.
9148 \futurelet\next\fo@t
9150 }%end \catcode `\@=11
9152 \def\errfootnotenest{%
9153 \errhelp=\EMsimple
9154 \errmessage{Nested footnotes not supported in texinfo.tex,
9155 even though they work in makeinfo; sorry}
9158 \def\errfootnoteheading{%
9159 \errhelp=\EMsimple
9160 \errmessage{Footnotes in chapters, sections, etc., are not supported}
9163 % In case a @footnote appears in a vbox, save the footnote text and create
9164 % the real \insert just after the vbox finished. Otherwise, the insertion
9165 % would be lost.
9166 % Similarly, if a @footnote appears inside an alignment, save the footnote
9167 % text to a box and make the \insert when a row of the table is finished.
9168 % And the same can be done for other insert classes. --kasal, 16nov03.
9170 % Replace the \insert primitive by a cheating macro.
9171 % Deeper inside, just make sure that the saved insertions are not spilled
9172 % out prematurely.
9174 \def\startsavinginserts{%
9175 \ifx \insert\ptexinsert
9176 \let\insert\saveinsert
9177 \else
9178 \let\checkinserts\relax
9182 % This \insert replacement works for both \insert\footins{foo} and
9183 % \insert\footins\bgroup foo\egroup, but it doesn't work for \insert27{foo}.
9185 \def\saveinsert#1{%
9186 \edef\next{\noexpand\savetobox \makeSAVEname#1}%
9187 \afterassignment\next
9188 % swallow the left brace
9189 \let\temp =
9191 \def\makeSAVEname#1{\makecsname{SAVE\expandafter\gobble\string#1}}
9192 \def\savetobox#1{\global\setbox#1 = \vbox\bgroup \unvbox#1}
9194 \def\checksaveins#1{\ifvoid#1\else \placesaveins#1\fi}
9196 \def\placesaveins#1{%
9197 \ptexinsert \csname\expandafter\gobblesave\string#1\endcsname
9198 {\box#1}%
9201 % eat @SAVE -- beware, all of them have catcode \other:
9203 \def\dospecials{\do S\do A\do V\do E} \uncatcodespecials % ;-)
9204 \gdef\gobblesave @SAVE{}
9207 % initialization:
9208 \def\newsaveins #1{%
9209 \edef\next{\noexpand\newsaveinsX \makeSAVEname#1}%
9210 \next
9212 \def\newsaveinsX #1{%
9213 \csname newbox\endcsname #1%
9214 \expandafter\def\expandafter\checkinserts\expandafter{\checkinserts
9215 \checksaveins #1}%
9218 % initialize:
9219 \let\checkinserts\empty
9220 \newsaveins\footins
9221 \newsaveins\margin
9224 % @image. We use the macros from epsf.tex to support this.
9225 % If epsf.tex is not installed and @image is used, we complain.
9227 % Check for and read epsf.tex up front. If we read it only at @image
9228 % time, we might be inside a group, and then its definitions would get
9229 % undone and the next image would fail.
9230 \openin 1 = epsf.tex
9231 \ifeof 1 \else
9232 % Do not bother showing banner with epsf.tex v2.7k (available in
9233 % doc/epsf.tex and on ctan).
9234 \def\epsfannounce{\toks0 = }%
9235 \input epsf.tex
9237 \closein 1
9239 % We will only complain once about lack of epsf.tex.
9240 \newif\ifwarnednoepsf
9241 \newhelp\noepsfhelp{epsf.tex must be installed for images to
9242 work. It is also included in the Texinfo distribution, or you can get
9243 it from ftp://tug.org/tex/epsf.tex.}
9245 \def\image#1{%
9246 \ifx\epsfbox\thisisundefined
9247 \ifwarnednoepsf \else
9248 \errhelp = \noepsfhelp
9249 \errmessage{epsf.tex not found, images will be ignored}%
9250 \global\warnednoepsftrue
9252 \else
9253 \imagexxx #1,,,,,\finish
9257 % Arguments to @image:
9258 % #1 is (mandatory) image filename; we tack on .eps extension.
9259 % #2 is (optional) width, #3 is (optional) height.
9260 % #4 is (ignored optional) html alt text.
9261 % #5 is (ignored optional) extension.
9262 % #6 is just the usual extra ignored arg for parsing stuff.
9263 \newif\ifimagevmode
9264 \def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup
9265 \catcode`\^^M = 5 % in case we're inside an example
9266 \normalturnoffactive % allow _ et al. in names
9267 \def\xprocessmacroarg{\eatspaces}% in case we are being used via a macro
9268 % If the image is by itself, center it.
9269 \ifvmode
9270 \imagevmodetrue
9271 \else \ifx\centersub\centerV
9272 % for @center @image, we need a vbox so we can have our vertical space
9273 \imagevmodetrue
9274 \vbox\bgroup % vbox has better behavior than vtop herev
9275 \fi\fi
9277 \ifimagevmode
9278 \nobreak\medskip
9279 % Usually we'll have text after the image which will insert
9280 % \parskip glue, so insert it here too to equalize the space
9281 % above and below.
9282 \nobreak\vskip\parskip
9283 \nobreak
9286 % Leave vertical mode so that indentation from an enclosing
9287 % environment such as @quotation is respected.
9288 % However, if we're at the top level, we don't want the
9289 % normal paragraph indentation.
9290 % On the other hand, if we are in the case of @center @image, we don't
9291 % want to start a paragraph, which will create a hsize-width box and
9292 % eradicate the centering.
9293 \ifx\centersub\centerV\else \noindent \fi
9295 % Output the image.
9296 \ifpdf
9297 % For pdfTeX and LuaTeX <= 0.80
9298 \dopdfimage{#1}{#2}{#3}%
9299 \else
9300 \ifx\XeTeXrevision\thisisundefined
9301 % For epsf.tex
9302 % \epsfbox itself resets \epsf?size at each figure.
9303 \setbox0 = \hbox{\ignorespaces #2}%
9304 \ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
9305 \setbox0 = \hbox{\ignorespaces #3}%
9306 \ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
9307 \epsfbox{#1.eps}%
9308 \else
9309 % For XeTeX
9310 \doxeteximage{#1}{#2}{#3}%
9314 \ifimagevmode
9315 \medskip % space after a standalone image
9316 \fi
9317 \ifx\centersub\centerV \egroup \fi
9318 \endgroup}
9321 % @float FLOATTYPE,LABEL,LOC ... @end float for displayed figures, tables,
9322 % etc. We don't actually implement floating yet, we always include the
9323 % float "here". But it seemed the best name for the future.
9325 \envparseargdef\float{\eatcommaspace\eatcommaspace\dofloat#1, , ,\finish}
9327 % There may be a space before second and/or third parameter; delete it.
9328 \def\eatcommaspace#1, {#1,}
9330 % #1 is the optional FLOATTYPE, the text label for this float, typically
9331 % "Figure", "Table", "Example", etc. Can't contain commas. If omitted,
9332 % this float will not be numbered and cannot be referred to.
9334 % #2 is the optional xref label. Also must be present for the float to
9335 % be referable.
9337 % #3 is the optional positioning argument; for now, it is ignored. It
9338 % will somehow specify the positions allowed to float to (here, top, bottom).
9340 % We keep a separate counter for each FLOATTYPE, which we reset at each
9341 % chapter-level command.
9342 \let\resetallfloatnos=\empty
9344 \def\dofloat#1,#2,#3,#4\finish{%
9345 \let\thiscaption=\empty
9346 \let\thisshortcaption=\empty
9348 % don't lose footnotes inside @float.
9350 % BEWARE: when the floats start float, we have to issue warning whenever an
9351 % insert appears inside a float which could possibly float. --kasal, 26may04
9353 \startsavinginserts
9355 % We can't be used inside a paragraph.
9356 \par
9358 \vtop\bgroup
9359 \def\floattype{#1}%
9360 \def\floatlabel{#2}%
9361 \def\floatloc{#3}% we do nothing with this yet.
9363 \ifx\floattype\empty
9364 \let\safefloattype=\empty
9365 \else
9367 % the floattype might have accents or other special characters,
9368 % but we need to use it in a control sequence name.
9369 \indexnofonts
9370 \turnoffactive
9371 \xdef\safefloattype{\floattype}%
9375 % If label is given but no type, we handle that as the empty type.
9376 \ifx\floatlabel\empty \else
9377 % We want each FLOATTYPE to be numbered separately (Figure 1,
9378 % Table 1, Figure 2, ...). (And if no label, no number.)
9380 \expandafter\getfloatno\csname\safefloattype floatno\endcsname
9381 \global\advance\floatno by 1
9384 % This magic value for \lastsection is output by \setref as the
9385 % XREFLABEL-title value. \xrefX uses it to distinguish float
9386 % labels (which have a completely different output format) from
9387 % node and anchor labels. And \xrdef uses it to construct the
9388 % lists of floats.
9390 \edef\lastsection{\floatmagic=\safefloattype}%
9391 \setref{\floatlabel}{Yfloat}%
9395 % start with \parskip glue, I guess.
9396 \vskip\parskip
9398 % Don't suppress indentation if a float happens to start a section.
9399 \restorefirstparagraphindent
9402 % we have these possibilities:
9403 % @float Foo,lbl & @caption{Cap}: Foo 1.1: Cap
9404 % @float Foo,lbl & no caption: Foo 1.1
9405 % @float Foo & @caption{Cap}: Foo: Cap
9406 % @float Foo & no caption: Foo
9407 % @float ,lbl & Caption{Cap}: 1.1: Cap
9408 % @float ,lbl & no caption: 1.1
9409 % @float & @caption{Cap}: Cap
9410 % @float & no caption:
9412 \def\Efloat{%
9413 \let\floatident = \empty
9415 % In all cases, if we have a float type, it comes first.
9416 \ifx\floattype\empty \else \def\floatident{\floattype}\fi
9418 % If we have an xref label, the number comes next.
9419 \ifx\floatlabel\empty \else
9420 \ifx\floattype\empty \else % if also had float type, need tie first.
9421 \appendtomacro\floatident{\tie}%
9423 % the number.
9424 \appendtomacro\floatident{\chaplevelprefix\the\floatno}%
9427 % Start the printed caption with what we've constructed in
9428 % \floatident, but keep it separate; we need \floatident again.
9429 \let\captionline = \floatident
9431 \ifx\thiscaption\empty \else
9432 \ifx\floatident\empty \else
9433 \appendtomacro\captionline{: }% had ident, so need a colon between
9436 % caption text.
9437 \appendtomacro\captionline{\scanexp\thiscaption}%
9440 % If we have anything to print, print it, with space before.
9441 % Eventually this needs to become an \insert.
9442 \ifx\captionline\empty \else
9443 \vskip.5\parskip
9444 \captionline
9446 % Space below caption.
9447 \vskip\parskip
9450 % If have an xref label, write the list of floats info. Do this
9451 % after the caption, to avoid chance of it being a breakpoint.
9452 \ifx\floatlabel\empty \else
9453 % Write the text that goes in the lof to the aux file as
9454 % \floatlabel-lof. Besides \floatident, we include the short
9455 % caption if specified, else the full caption if specified, else nothing.
9457 \requireauxfile
9458 \atdummies
9460 % since we read the caption text in the macro world, where ^^M
9461 % is turned into a normal character, we have to scan it back, so
9462 % we don't write the literal three characters "^^M" into the aux file.
9463 \scanexp{%
9464 \xdef\noexpand\gtemp{%
9465 \ifx\thisshortcaption\empty
9466 \thiscaption
9467 \else
9468 \thisshortcaption
9472 \immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident
9473 \ifx\gtemp\empty \else : \gtemp \fi}}%
9476 \egroup % end of \vtop
9478 % place the captured inserts
9480 % BEWARE: when the floats start floating, we have to issue warning
9481 % whenever an insert appears inside a float which could possibly
9482 % float. --kasal, 26may04
9484 \checkinserts
9487 % Append the tokens #2 to the definition of macro #1, not expanding either.
9489 \def\appendtomacro#1#2{%
9490 \expandafter\def\expandafter#1\expandafter{#1#2}%
9493 % @caption, @shortcaption
9495 \def\caption{\docaption\thiscaption}
9496 \def\shortcaption{\docaption\thisshortcaption}
9497 \def\docaption{\checkenv\float \bgroup\scanargctxt\defcaption}
9498 \def\defcaption#1#2{\egroup \def#1{#2}}
9500 % The parameter is the control sequence identifying the counter we are
9501 % going to use. Create it if it doesn't exist and assign it to \floatno.
9502 \def\getfloatno#1{%
9503 \ifx#1\relax
9504 % Haven't seen this figure type before.
9505 \csname newcount\endcsname #1%
9507 % Remember to reset this floatno at the next chap.
9508 \expandafter\gdef\expandafter\resetallfloatnos
9509 \expandafter{\resetallfloatnos #1=0 }%
9511 \let\floatno#1%
9514 % \setref calls this to get the XREFLABEL-snt value. We want an @xref
9515 % to the FLOATLABEL to expand to "Figure 3.1". We call \setref when we
9516 % first read the @float command.
9518 \def\Yfloat{\floattype@tie \chaplevelprefix\the\floatno}%
9520 % Magic string used for the XREFLABEL-title value, so \xrefX can
9521 % distinguish floats from other xref types.
9522 \def\floatmagic{!!float!!}
9524 % #1 is the control sequence we are passed; we expand into a conditional
9525 % which is true if #1 represents a float ref. That is, the magic
9526 % \lastsection value which we \setref above.
9528 \def\iffloat#1{\expandafter\doiffloat#1==\finish}
9530 % #1 is (maybe) the \floatmagic string. If so, #2 will be the
9531 % (safe) float type for this float. We set \iffloattype to #2.
9533 \def\doiffloat#1=#2=#3\finish{%
9534 \def\temp{#1}%
9535 \def\iffloattype{#2}%
9536 \ifx\temp\floatmagic
9539 % @listoffloats FLOATTYPE - print a list of floats like a table of contents.
9541 \parseargdef\listoffloats{%
9542 \def\floattype{#1}% floattype
9544 % the floattype might have accents or other special characters,
9545 % but we need to use it in a control sequence name.
9546 \indexnofonts
9547 \turnoffactive
9548 \xdef\safefloattype{\floattype}%
9551 % \xrdef saves the floats as a \do-list in \floatlistSAFEFLOATTYPE.
9552 \expandafter\ifx\csname floatlist\safefloattype\endcsname \relax
9553 \ifhavexrefs
9554 % if the user said @listoffloats foo but never @float foo.
9555 \message{\linenumber No `\safefloattype' floats to list.}%
9557 \else
9558 \begingroup
9559 \leftskip=\tocindent % indent these entries like a toc
9560 \let\do=\listoffloatsdo
9561 \csname floatlist\safefloattype\endcsname
9562 \endgroup
9566 % This is called on each entry in a list of floats. We're passed the
9567 % xref label, in the form LABEL-title, which is how we save it in the
9568 % aux file. We strip off the -title and look up \XRLABEL-lof, which
9569 % has the text we're supposed to typeset here.
9571 % Figures without xref labels will not be included in the list (since
9572 % they won't appear in the aux file).
9574 \def\listoffloatsdo#1{\listoffloatsdoentry#1\finish}
9575 \def\listoffloatsdoentry#1-title\finish{{%
9576 % Can't fully expand XR#1-lof because it can contain anything. Just
9577 % pass the control sequence. On the other hand, XR#1-pg is just the
9578 % page number, and we want to fully expand that so we can get a link
9579 % in pdf output.
9580 \toksA = \expandafter{\csname XR#1-lof\endcsname}%
9582 % use the same \entry macro we use to generate the TOC and index.
9583 \edef\writeentry{\noexpand\entry{\the\toksA}{\csname XR#1-pg\endcsname}}%
9584 \writeentry
9588 \message{localization,}
9590 % For single-language documents, @documentlanguage is usually given very
9591 % early, just after @documentencoding. Single argument is the language
9592 % (de) or locale (de_DE) abbreviation.
9595 \catcode`\_ = \active
9596 \globaldefs=1
9597 \parseargdef\documentlanguage{%
9598 \tex % read txi-??.tex file in plain TeX.
9599 % Read the file by the name they passed if it exists.
9600 \let_ = \normalunderscore % normal _ character for filename test
9601 \openin 1 txi-#1.tex
9602 \ifeof 1
9603 \documentlanguagetrywithoutunderscore #1_\finish
9604 \else
9605 \globaldefs = 1 % everything in the txi-LL files needs to persist
9606 \input txi-#1.tex
9608 \closein 1
9609 \endgroup % end raw TeX
9612 % If they passed de_DE, and txi-de_DE.tex doesn't exist,
9613 % try txi-de.tex.
9615 \gdef\documentlanguagetrywithoutunderscore#1_#2\finish{%
9616 \openin 1 txi-#1.tex
9617 \ifeof 1
9618 \errhelp = \nolanghelp
9619 \errmessage{Cannot read language file txi-#1.tex}%
9620 \else
9621 \globaldefs = 1 % everything in the txi-LL files needs to persist
9622 \input txi-#1.tex
9624 \closein 1
9626 }% end of special _ catcode
9628 \newhelp\nolanghelp{The given language definition file cannot be found or
9629 is empty. Maybe you need to install it? Putting it in the current
9630 directory should work if nowhere else does.}
9632 % This macro is called from txi-??.tex files; the first argument is the
9633 % \language name to set (without the "\lang@" prefix), the second and
9634 % third args are \{left,right}hyphenmin.
9636 % The language names to pass are determined when the format is built.
9637 % See the etex.log file created at that time, e.g.,
9638 % /usr/local/texlive/2008/texmf-var/web2c/pdftex/etex.log.
9640 % With TeX Live 2008, etex now includes hyphenation patterns for all
9641 % available languages. This means we can support hyphenation in
9642 % Texinfo, at least to some extent. (This still doesn't solve the
9643 % accented characters problem.)
9645 \catcode`@=11
9646 \def\txisetlanguage#1#2#3{%
9647 % do not set the language if the name is undefined in the current TeX.
9648 \expandafter\ifx\csname lang@#1\endcsname \relax
9649 \message{no patterns for #1}%
9650 \else
9651 \global\language = \csname lang@#1\endcsname
9653 % but there is no harm in adjusting the hyphenmin values regardless.
9654 \global\lefthyphenmin = #2\relax
9655 \global\righthyphenmin = #3\relax
9658 % XeTeX and LuaTeX can handle native Unicode.
9659 % Their default I/O is UTF-8 sequence instead of byte-wise.
9660 % Other TeX engine (pdfTeX etc.) I/O is byte-wise.
9662 \newif\iftxinativeunicodecapable
9663 \newif\iftxiusebytewiseio
9665 \ifx\XeTeXrevision\thisisundefined
9666 \ifx\luatexversion\thisisundefined
9667 \txinativeunicodecapablefalse
9668 \txiusebytewiseiotrue
9669 \else
9670 \txinativeunicodecapabletrue
9671 \txiusebytewiseiofalse
9673 \else
9674 \txinativeunicodecapabletrue
9675 \txiusebytewiseiofalse
9678 % Set I/O by bytes instead of UTF-8 sequence for XeTeX and LuaTex
9679 % for non-UTF-8 (byte-wise) encodings.
9681 \def\setbytewiseio{%
9682 \ifx\XeTeXrevision\thisisundefined
9683 \else
9684 \XeTeXdefaultencoding "bytes" % For subsequent files to be read
9685 \XeTeXinputencoding "bytes" % For document root file
9686 % Unfortunately, there seems to be no corresponding XeTeX command for
9687 % output encoding. This is a problem for auxiliary index and TOC files.
9688 % The only solution would be perhaps to write out @U{...} sequences in
9689 % place of non-ASCII characters.
9692 \ifx\luatexversion\thisisundefined
9693 \else
9694 \directlua{
9695 local utf8_char, byte, gsub = unicode.utf8.char, string.byte, string.gsub
9696 local function convert_char (char)
9697 return utf8_char(byte(char))
9700 local function convert_line (line)
9701 return gsub(line, ".", convert_char)
9704 callback.register("process_input_buffer", convert_line)
9706 local function convert_line_out (line)
9707 local line_out = ""
9708 for c in string.utfvalues(line) do
9709 line_out = line_out .. string.char(c)
9711 return line_out
9714 callback.register("process_output_buffer", convert_line_out)
9718 \txiusebytewiseiotrue
9722 % Helpers for encodings.
9723 % Set the catcode of characters 128 through 255 to the specified number.
9725 \def\setnonasciicharscatcode#1{%
9726 \count255=128
9727 \loop\ifnum\count255<256
9728 \global\catcode\count255=#1\relax
9729 \advance\count255 by 1
9730 \repeat
9733 \def\setnonasciicharscatcodenonglobal#1{%
9734 \count255=128
9735 \loop\ifnum\count255<256
9736 \catcode\count255=#1\relax
9737 \advance\count255 by 1
9738 \repeat
9741 % @documentencoding sets the definition of non-ASCII characters
9742 % according to the specified encoding.
9744 \def\documentencoding{\parseargusing\filenamecatcodes\documentencodingzzz}
9745 \def\documentencodingzzz#1{%
9747 % Encoding being declared for the document.
9748 \def\declaredencoding{\csname #1.enc\endcsname}%
9750 % Supported encodings: names converted to tokens in order to be able
9751 % to compare them with \ifx.
9752 \def\ascii{\csname US-ASCII.enc\endcsname}%
9753 \def\latnine{\csname ISO-8859-15.enc\endcsname}%
9754 \def\latone{\csname ISO-8859-1.enc\endcsname}%
9755 \def\lattwo{\csname ISO-8859-2.enc\endcsname}%
9756 \def\utfeight{\csname UTF-8.enc\endcsname}%
9758 \ifx \declaredencoding \ascii
9759 \asciichardefs
9761 \else \ifx \declaredencoding \lattwo
9762 \iftxinativeunicodecapable
9763 \setbytewiseio
9765 \setnonasciicharscatcode\active
9766 \lattwochardefs
9768 \else \ifx \declaredencoding \latone
9769 \iftxinativeunicodecapable
9770 \setbytewiseio
9772 \setnonasciicharscatcode\active
9773 \latonechardefs
9775 \else \ifx \declaredencoding \latnine
9776 \iftxinativeunicodecapable
9777 \setbytewiseio
9779 \setnonasciicharscatcode\active
9780 \latninechardefs
9782 \else \ifx \declaredencoding \utfeight
9783 \iftxinativeunicodecapable
9784 % For native Unicode (XeTeX and LuaTeX)
9785 \nativeunicodechardefs
9786 \else
9787 % For UTF-8 byte sequence (TeX, eTeX and pdfTeX)
9788 \setnonasciicharscatcode\active
9789 % since we already invoked \utfeightchardefs at the top level
9790 % (below), do not re-invoke it, then our check for duplicated
9791 % definitions triggers. Making non-ascii chars active is enough.
9794 \else
9795 \message{Ignoring unknown document encoding: #1.}%
9797 \fi % utfeight
9798 \fi % latnine
9799 \fi % latone
9800 \fi % lattwo
9801 \fi % ascii
9804 % emacs-page
9805 % A message to be logged when using a character that isn't available
9806 % the default font encoding (OT1).
9808 \def\missingcharmsg#1{\message{Character missing, sorry: #1.}}
9810 % Take account of \c (plain) vs. \, (Texinfo) difference.
9811 \def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi}
9813 % First, make active non-ASCII characters in order for them to be
9814 % correctly categorized when TeX reads the replacement text of
9815 % macros containing the character definitions.
9816 \setnonasciicharscatcode\active
9818 % Latin1 (ISO-8859-1) character definitions.
9819 \def\latonechardefs{%
9820 \gdef^^a0{\tie}
9821 \gdef^^a1{\exclamdown}
9822 \gdef^^a2{{\tcfont \char162}} % cent
9823 \gdef^^a3{\pounds}
9824 \gdef^^a4{{\tcfont \char164}} % currency
9825 \gdef^^a5{{\tcfont \char165}} % yen
9826 \gdef^^a6{{\tcfont \char166}} % broken bar
9827 \gdef^^a7{\S}
9828 \gdef^^a8{\"{}}
9829 \gdef^^a9{\copyright}
9830 \gdef^^aa{\ordf}
9831 \gdef^^ab{\guillemetleft}
9832 \gdef^^ac{\ensuremath\lnot}
9833 \gdef^^ad{\-}
9834 \gdef^^ae{\registeredsymbol}
9835 \gdef^^af{\={}}
9837 \gdef^^b0{\textdegree}
9838 \gdef^^b1{$\pm$}
9839 \gdef^^b2{$^2$}
9840 \gdef^^b3{$^3$}
9841 \gdef^^b4{\'{}}
9842 \gdef^^b5{$\mu$}
9843 \gdef^^b6{\P}
9844 \gdef^^b7{\ensuremath\cdot}
9845 \gdef^^b8{\cedilla\ }
9846 \gdef^^b9{$^1$}
9847 \gdef^^ba{\ordm}
9848 \gdef^^bb{\guillemetright}
9849 \gdef^^bc{$1\over4$}
9850 \gdef^^bd{$1\over2$}
9851 \gdef^^be{$3\over4$}
9852 \gdef^^bf{\questiondown}
9854 \gdef^^c0{\`A}
9855 \gdef^^c1{\'A}
9856 \gdef^^c2{\^A}
9857 \gdef^^c3{\~A}
9858 \gdef^^c4{\"A}
9859 \gdef^^c5{\ringaccent A}
9860 \gdef^^c6{\AE}
9861 \gdef^^c7{\cedilla C}
9862 \gdef^^c8{\`E}
9863 \gdef^^c9{\'E}
9864 \gdef^^ca{\^E}
9865 \gdef^^cb{\"E}
9866 \gdef^^cc{\`I}
9867 \gdef^^cd{\'I}
9868 \gdef^^ce{\^I}
9869 \gdef^^cf{\"I}
9871 \gdef^^d0{\DH}
9872 \gdef^^d1{\~N}
9873 \gdef^^d2{\`O}
9874 \gdef^^d3{\'O}
9875 \gdef^^d4{\^O}
9876 \gdef^^d5{\~O}
9877 \gdef^^d6{\"O}
9878 \gdef^^d7{$\times$}
9879 \gdef^^d8{\O}
9880 \gdef^^d9{\`U}
9881 \gdef^^da{\'U}
9882 \gdef^^db{\^U}
9883 \gdef^^dc{\"U}
9884 \gdef^^dd{\'Y}
9885 \gdef^^de{\TH}
9886 \gdef^^df{\ss}
9888 \gdef^^e0{\`a}
9889 \gdef^^e1{\'a}
9890 \gdef^^e2{\^a}
9891 \gdef^^e3{\~a}
9892 \gdef^^e4{\"a}
9893 \gdef^^e5{\ringaccent a}
9894 \gdef^^e6{\ae}
9895 \gdef^^e7{\cedilla c}
9896 \gdef^^e8{\`e}
9897 \gdef^^e9{\'e}
9898 \gdef^^ea{\^e}
9899 \gdef^^eb{\"e}
9900 \gdef^^ec{\`{\dotless i}}
9901 \gdef^^ed{\'{\dotless i}}
9902 \gdef^^ee{\^{\dotless i}}
9903 \gdef^^ef{\"{\dotless i}}
9905 \gdef^^f0{\dh}
9906 \gdef^^f1{\~n}
9907 \gdef^^f2{\`o}
9908 \gdef^^f3{\'o}
9909 \gdef^^f4{\^o}
9910 \gdef^^f5{\~o}
9911 \gdef^^f6{\"o}
9912 \gdef^^f7{$\div$}
9913 \gdef^^f8{\o}
9914 \gdef^^f9{\`u}
9915 \gdef^^fa{\'u}
9916 \gdef^^fb{\^u}
9917 \gdef^^fc{\"u}
9918 \gdef^^fd{\'y}
9919 \gdef^^fe{\th}
9920 \gdef^^ff{\"y}
9923 % Latin9 (ISO-8859-15) encoding character definitions.
9924 \def\latninechardefs{%
9925 % Encoding is almost identical to Latin1.
9926 \latonechardefs
9928 \gdef^^a4{\euro}
9929 \gdef^^a6{\v S}
9930 \gdef^^a8{\v s}
9931 \gdef^^b4{\v Z}
9932 \gdef^^b8{\v z}
9933 \gdef^^bc{\OE}
9934 \gdef^^bd{\oe}
9935 \gdef^^be{\"Y}
9938 % Latin2 (ISO-8859-2) character definitions.
9939 \def\lattwochardefs{%
9940 \gdef^^a0{\tie}
9941 \gdef^^a1{\ogonek{A}}
9942 \gdef^^a2{\u{}}
9943 \gdef^^a3{\L}
9944 \gdef^^a4{\missingcharmsg{CURRENCY SIGN}}
9945 \gdef^^a5{\v L}
9946 \gdef^^a6{\'S}
9947 \gdef^^a7{\S}
9948 \gdef^^a8{\"{}}
9949 \gdef^^a9{\v S}
9950 \gdef^^aa{\cedilla S}
9951 \gdef^^ab{\v T}
9952 \gdef^^ac{\'Z}
9953 \gdef^^ad{\-}
9954 \gdef^^ae{\v Z}
9955 \gdef^^af{\dotaccent Z}
9957 \gdef^^b0{\textdegree}
9958 \gdef^^b1{\ogonek{a}}
9959 \gdef^^b2{\ogonek{ }}
9960 \gdef^^b3{\l}
9961 \gdef^^b4{\'{}}
9962 \gdef^^b5{\v l}
9963 \gdef^^b6{\'s}
9964 \gdef^^b7{\v{}}
9965 \gdef^^b8{\cedilla\ }
9966 \gdef^^b9{\v s}
9967 \gdef^^ba{\cedilla s}
9968 \gdef^^bb{\v t}
9969 \gdef^^bc{\'z}
9970 \gdef^^bd{\H{}}
9971 \gdef^^be{\v z}
9972 \gdef^^bf{\dotaccent z}
9974 \gdef^^c0{\'R}
9975 \gdef^^c1{\'A}
9976 \gdef^^c2{\^A}
9977 \gdef^^c3{\u A}
9978 \gdef^^c4{\"A}
9979 \gdef^^c5{\'L}
9980 \gdef^^c6{\'C}
9981 \gdef^^c7{\cedilla C}
9982 \gdef^^c8{\v C}
9983 \gdef^^c9{\'E}
9984 \gdef^^ca{\ogonek{E}}
9985 \gdef^^cb{\"E}
9986 \gdef^^cc{\v E}
9987 \gdef^^cd{\'I}
9988 \gdef^^ce{\^I}
9989 \gdef^^cf{\v D}
9991 \gdef^^d0{\DH}
9992 \gdef^^d1{\'N}
9993 \gdef^^d2{\v N}
9994 \gdef^^d3{\'O}
9995 \gdef^^d4{\^O}
9996 \gdef^^d5{\H O}
9997 \gdef^^d6{\"O}
9998 \gdef^^d7{$\times$}
9999 \gdef^^d8{\v R}
10000 \gdef^^d9{\ringaccent U}
10001 \gdef^^da{\'U}
10002 \gdef^^db{\H U}
10003 \gdef^^dc{\"U}
10004 \gdef^^dd{\'Y}
10005 \gdef^^de{\cedilla T}
10006 \gdef^^df{\ss}
10008 \gdef^^e0{\'r}
10009 \gdef^^e1{\'a}
10010 \gdef^^e2{\^a}
10011 \gdef^^e3{\u a}
10012 \gdef^^e4{\"a}
10013 \gdef^^e5{\'l}
10014 \gdef^^e6{\'c}
10015 \gdef^^e7{\cedilla c}
10016 \gdef^^e8{\v c}
10017 \gdef^^e9{\'e}
10018 \gdef^^ea{\ogonek{e}}
10019 \gdef^^eb{\"e}
10020 \gdef^^ec{\v e}
10021 \gdef^^ed{\'{\dotless{i}}}
10022 \gdef^^ee{\^{\dotless{i}}}
10023 \gdef^^ef{\v d}
10025 \gdef^^f0{\dh}
10026 \gdef^^f1{\'n}
10027 \gdef^^f2{\v n}
10028 \gdef^^f3{\'o}
10029 \gdef^^f4{\^o}
10030 \gdef^^f5{\H o}
10031 \gdef^^f6{\"o}
10032 \gdef^^f7{$\div$}
10033 \gdef^^f8{\v r}
10034 \gdef^^f9{\ringaccent u}
10035 \gdef^^fa{\'u}
10036 \gdef^^fb{\H u}
10037 \gdef^^fc{\"u}
10038 \gdef^^fd{\'y}
10039 \gdef^^fe{\cedilla t}
10040 \gdef^^ff{\dotaccent{}}
10043 % UTF-8 character definitions.
10045 % This code to support UTF-8 is based on LaTeX's utf8.def, with some
10046 % changes for Texinfo conventions. It is included here under the GPL by
10047 % permission from Frank Mittelbach and the LaTeX team.
10049 \newcount\countUTFx
10050 \newcount\countUTFy
10051 \newcount\countUTFz
10053 \gdef\UTFviiiTwoOctets#1#2{\expandafter
10054 \UTFviiiDefined\csname u8:#1\string #2\endcsname}
10056 \gdef\UTFviiiThreeOctets#1#2#3{\expandafter
10057 \UTFviiiDefined\csname u8:#1\string #2\string #3\endcsname}
10059 \gdef\UTFviiiFourOctets#1#2#3#4{\expandafter
10060 \UTFviiiDefined\csname u8:#1\string #2\string #3\string #4\endcsname}
10062 \gdef\UTFviiiDefined#1{%
10063 \ifx #1\relax
10064 \message{\linenumber Unicode char \string #1 not defined for Texinfo}%
10065 \else
10066 \expandafter #1%
10070 \begingroup
10071 \catcode`\~13
10072 \catcode`\"12
10074 \def\UTFviiiLoop{%
10075 \global\catcode\countUTFx\active
10076 \uccode`\~\countUTFx
10077 \uppercase\expandafter{\UTFviiiTmp}%
10078 \advance\countUTFx by 1
10079 \ifnum\countUTFx < \countUTFy
10080 \expandafter\UTFviiiLoop
10081 \fi}
10083 \countUTFx = "C2
10084 \countUTFy = "E0
10085 \def\UTFviiiTmp{%
10086 \xdef~{\noexpand\UTFviiiTwoOctets\string~}}
10087 \UTFviiiLoop
10089 \countUTFx = "E0
10090 \countUTFy = "F0
10091 \def\UTFviiiTmp{%
10092 \xdef~{\noexpand\UTFviiiThreeOctets\string~}}
10093 \UTFviiiLoop
10095 \countUTFx = "F0
10096 \countUTFy = "F4
10097 \def\UTFviiiTmp{%
10098 \xdef~{\noexpand\UTFviiiFourOctets\string~}}
10099 \UTFviiiLoop
10100 \endgroup
10102 \def\globallet{\global\let} % save some \expandafter's below
10104 % @U{xxxx} to produce U+xxxx, if we support it.
10105 \def\U#1{%
10106 \expandafter\ifx\csname uni:#1\endcsname \relax
10107 \iftxinativeunicodecapable
10108 % Any Unicode characters can be used by native Unicode.
10109 % However, if the font does not have the glyph, the letter will miss.
10110 \begingroup
10111 \uccode`\.="#1\relax
10112 \uppercase{.}
10113 \endgroup
10114 \else
10115 \errhelp = \EMsimple
10116 \errmessage{Unicode character U+#1 not supported, sorry}%
10118 \else
10119 \csname uni:#1\endcsname
10123 % For UTF-8 byte sequence (TeX, e-TeX and pdfTeX)
10124 % Definition macro to replace the Unicode character
10125 % Definition macro that is used by @U command
10127 \begingroup
10128 \catcode`\"=12
10129 \catcode`\<=12
10130 \catcode`\.=12
10131 \catcode`\,=12
10132 \catcode`\;=12
10133 \catcode`\!=12
10134 \catcode`\~=13
10135 \gdef\DeclareUnicodeCharacterUTFviii#1#2{%
10136 \countUTFz = "#1\relax
10137 %\wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}%
10138 \begingroup
10139 \parseXMLCharref
10140 \def\UTFviiiTwoOctets##1##2{%
10141 \csname u8:##1\string ##2\endcsname}%
10142 \def\UTFviiiThreeOctets##1##2##3{%
10143 \csname u8:##1\string ##2\string ##3\endcsname}%
10144 \def\UTFviiiFourOctets##1##2##3##4{%
10145 \csname u8:##1\string ##2\string ##3\string ##4\endcsname}%
10146 \expandafter\expandafter\expandafter\expandafter
10147 \expandafter\expandafter\expandafter
10148 \gdef\UTFviiiTmp{#2}%
10150 \expandafter\ifx\csname uni:#1\endcsname \relax \else
10151 \message{Internal error, already defined: #1}%
10154 % define an additional control sequence for this code point.
10155 \expandafter\globallet\csname uni:#1\endcsname \UTFviiiTmp
10156 \endgroup}
10158 \gdef\parseXMLCharref{%
10159 \ifnum\countUTFz < "A0\relax
10160 \errhelp = \EMsimple
10161 \errmessage{Cannot define Unicode char value < 00A0}%
10162 \else\ifnum\countUTFz < "800\relax
10163 \parseUTFviiiA,%
10164 \parseUTFviiiB C\UTFviiiTwoOctets.,%
10165 \else\ifnum\countUTFz < "10000\relax
10166 \parseUTFviiiA;%
10167 \parseUTFviiiA,%
10168 \parseUTFviiiB E\UTFviiiThreeOctets.{,;}%
10169 \else
10170 \parseUTFviiiA;%
10171 \parseUTFviiiA,%
10172 \parseUTFviiiA!%
10173 \parseUTFviiiB F\UTFviiiFourOctets.{!,;}%
10174 \fi\fi\fi
10177 \gdef\parseUTFviiiA#1{%
10178 \countUTFx = \countUTFz
10179 \divide\countUTFz by 64
10180 \countUTFy = \countUTFz
10181 \multiply\countUTFz by 64
10182 \advance\countUTFx by -\countUTFz
10183 \advance\countUTFx by 128
10184 \uccode `#1\countUTFx
10185 \countUTFz = \countUTFy}
10187 \gdef\parseUTFviiiB#1#2#3#4{%
10188 \advance\countUTFz by "#10\relax
10189 \uccode `#3\countUTFz
10190 \uppercase{\gdef\UTFviiiTmp{#2#3#4}}}
10191 \endgroup
10193 % For native Unicode (XeTeX and LuaTeX)
10194 % Definition macro that is set catcode other non global
10196 \def\DeclareUnicodeCharacterNativeOther#1#2{%
10197 \catcode"#1=\other
10200 % https://en.wikipedia.org/wiki/Plane_(Unicode)#Basic_M
10201 % U+0000..U+007F = https://en.wikipedia.org/wiki/Basic_Latin_(Unicode_block)
10202 % U+0080..U+00FF = https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)
10203 % U+0100..U+017F = https://en.wikipedia.org/wiki/Latin_Extended-A
10204 % U+0180..U+024F = https://en.wikipedia.org/wiki/Latin_Extended-B
10206 % Many of our renditions are less than wonderful, and all the missing
10207 % characters are available somewhere. Loading the necessary fonts
10208 % awaits user request. We can't truly support Unicode without
10209 % reimplementing everything that's been done in LaTeX for many years,
10210 % plus probably using luatex or xetex, and who knows what else.
10211 % We won't be doing that here in this simple file. But we can try to at
10212 % least make most of the characters not bomb out.
10214 \def\unicodechardefs{%
10215 \DeclareUnicodeCharacter{00A0}{\tie}%
10216 \DeclareUnicodeCharacter{00A1}{\exclamdown}%
10217 \DeclareUnicodeCharacter{00A2}{{\tcfont \char162}}% 0242=cent
10218 \DeclareUnicodeCharacter{00A3}{\pounds}%
10219 \DeclareUnicodeCharacter{00A4}{{\tcfont \char164}}% 0244=currency
10220 \DeclareUnicodeCharacter{00A5}{{\tcfont \char165}}% 0245=yen
10221 \DeclareUnicodeCharacter{00A6}{{\tcfont \char166}}% 0246=brokenbar
10222 \DeclareUnicodeCharacter{00A7}{\S}%
10223 \DeclareUnicodeCharacter{00A8}{\"{ }}%
10224 \DeclareUnicodeCharacter{00A9}{\copyright}%
10225 \DeclareUnicodeCharacter{00AA}{\ordf}%
10226 \DeclareUnicodeCharacter{00AB}{\guillemetleft}%
10227 \DeclareUnicodeCharacter{00AC}{\ensuremath\lnot}%
10228 \DeclareUnicodeCharacter{00AD}{\-}%
10229 \DeclareUnicodeCharacter{00AE}{\registeredsymbol}%
10230 \DeclareUnicodeCharacter{00AF}{\={ }}%
10232 \DeclareUnicodeCharacter{00B0}{\ringaccent{ }}%
10233 \DeclareUnicodeCharacter{00B1}{\ensuremath\pm}%
10234 \DeclareUnicodeCharacter{00B2}{$^2$}%
10235 \DeclareUnicodeCharacter{00B3}{$^3$}%
10236 \DeclareUnicodeCharacter{00B4}{\'{ }}%
10237 \DeclareUnicodeCharacter{00B5}{$\mu$}%
10238 \DeclareUnicodeCharacter{00B6}{\P}%
10239 \DeclareUnicodeCharacter{00B7}{\ensuremath\cdot}%
10240 \DeclareUnicodeCharacter{00B8}{\cedilla{ }}%
10241 \DeclareUnicodeCharacter{00B9}{$^1$}%
10242 \DeclareUnicodeCharacter{00BA}{\ordm}%
10243 \DeclareUnicodeCharacter{00BB}{\guillemetright}%
10244 \DeclareUnicodeCharacter{00BC}{$1\over4$}%
10245 \DeclareUnicodeCharacter{00BD}{$1\over2$}%
10246 \DeclareUnicodeCharacter{00BE}{$3\over4$}%
10247 \DeclareUnicodeCharacter{00BF}{\questiondown}%
10249 \DeclareUnicodeCharacter{00C0}{\`A}%
10250 \DeclareUnicodeCharacter{00C1}{\'A}%
10251 \DeclareUnicodeCharacter{00C2}{\^A}%
10252 \DeclareUnicodeCharacter{00C3}{\~A}%
10253 \DeclareUnicodeCharacter{00C4}{\"A}%
10254 \DeclareUnicodeCharacter{00C5}{\AA}%
10255 \DeclareUnicodeCharacter{00C6}{\AE}%
10256 \DeclareUnicodeCharacter{00C7}{\cedilla{C}}%
10257 \DeclareUnicodeCharacter{00C8}{\`E}%
10258 \DeclareUnicodeCharacter{00C9}{\'E}%
10259 \DeclareUnicodeCharacter{00CA}{\^E}%
10260 \DeclareUnicodeCharacter{00CB}{\"E}%
10261 \DeclareUnicodeCharacter{00CC}{\`I}%
10262 \DeclareUnicodeCharacter{00CD}{\'I}%
10263 \DeclareUnicodeCharacter{00CE}{\^I}%
10264 \DeclareUnicodeCharacter{00CF}{\"I}%
10266 \DeclareUnicodeCharacter{00D0}{\DH}%
10267 \DeclareUnicodeCharacter{00D1}{\~N}%
10268 \DeclareUnicodeCharacter{00D2}{\`O}%
10269 \DeclareUnicodeCharacter{00D3}{\'O}%
10270 \DeclareUnicodeCharacter{00D4}{\^O}%
10271 \DeclareUnicodeCharacter{00D5}{\~O}%
10272 \DeclareUnicodeCharacter{00D6}{\"O}%
10273 \DeclareUnicodeCharacter{00D7}{\ensuremath\times}%
10274 \DeclareUnicodeCharacter{00D8}{\O}%
10275 \DeclareUnicodeCharacter{00D9}{\`U}%
10276 \DeclareUnicodeCharacter{00DA}{\'U}%
10277 \DeclareUnicodeCharacter{00DB}{\^U}%
10278 \DeclareUnicodeCharacter{00DC}{\"U}%
10279 \DeclareUnicodeCharacter{00DD}{\'Y}%
10280 \DeclareUnicodeCharacter{00DE}{\TH}%
10281 \DeclareUnicodeCharacter{00DF}{\ss}%
10283 \DeclareUnicodeCharacter{00E0}{\`a}%
10284 \DeclareUnicodeCharacter{00E1}{\'a}%
10285 \DeclareUnicodeCharacter{00E2}{\^a}%
10286 \DeclareUnicodeCharacter{00E3}{\~a}%
10287 \DeclareUnicodeCharacter{00E4}{\"a}%
10288 \DeclareUnicodeCharacter{00E5}{\aa}%
10289 \DeclareUnicodeCharacter{00E6}{\ae}%
10290 \DeclareUnicodeCharacter{00E7}{\cedilla{c}}%
10291 \DeclareUnicodeCharacter{00E8}{\`e}%
10292 \DeclareUnicodeCharacter{00E9}{\'e}%
10293 \DeclareUnicodeCharacter{00EA}{\^e}%
10294 \DeclareUnicodeCharacter{00EB}{\"e}%
10295 \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}}%
10296 \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}}%
10297 \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}}%
10298 \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}}%
10300 \DeclareUnicodeCharacter{00F0}{\dh}%
10301 \DeclareUnicodeCharacter{00F1}{\~n}%
10302 \DeclareUnicodeCharacter{00F2}{\`o}%
10303 \DeclareUnicodeCharacter{00F3}{\'o}%
10304 \DeclareUnicodeCharacter{00F4}{\^o}%
10305 \DeclareUnicodeCharacter{00F5}{\~o}%
10306 \DeclareUnicodeCharacter{00F6}{\"o}%
10307 \DeclareUnicodeCharacter{00F7}{\ensuremath\div}%
10308 \DeclareUnicodeCharacter{00F8}{\o}%
10309 \DeclareUnicodeCharacter{00F9}{\`u}%
10310 \DeclareUnicodeCharacter{00FA}{\'u}%
10311 \DeclareUnicodeCharacter{00FB}{\^u}%
10312 \DeclareUnicodeCharacter{00FC}{\"u}%
10313 \DeclareUnicodeCharacter{00FD}{\'y}%
10314 \DeclareUnicodeCharacter{00FE}{\th}%
10315 \DeclareUnicodeCharacter{00FF}{\"y}%
10317 \DeclareUnicodeCharacter{0100}{\=A}%
10318 \DeclareUnicodeCharacter{0101}{\=a}%
10319 \DeclareUnicodeCharacter{0102}{\u{A}}%
10320 \DeclareUnicodeCharacter{0103}{\u{a}}%
10321 \DeclareUnicodeCharacter{0104}{\ogonek{A}}%
10322 \DeclareUnicodeCharacter{0105}{\ogonek{a}}%
10323 \DeclareUnicodeCharacter{0106}{\'C}%
10324 \DeclareUnicodeCharacter{0107}{\'c}%
10325 \DeclareUnicodeCharacter{0108}{\^C}%
10326 \DeclareUnicodeCharacter{0109}{\^c}%
10327 \DeclareUnicodeCharacter{010A}{\dotaccent{C}}%
10328 \DeclareUnicodeCharacter{010B}{\dotaccent{c}}%
10329 \DeclareUnicodeCharacter{010C}{\v{C}}%
10330 \DeclareUnicodeCharacter{010D}{\v{c}}%
10331 \DeclareUnicodeCharacter{010E}{\v{D}}%
10332 \DeclareUnicodeCharacter{010F}{d'}%
10334 \DeclareUnicodeCharacter{0110}{\DH}%
10335 \DeclareUnicodeCharacter{0111}{\dh}%
10336 \DeclareUnicodeCharacter{0112}{\=E}%
10337 \DeclareUnicodeCharacter{0113}{\=e}%
10338 \DeclareUnicodeCharacter{0114}{\u{E}}%
10339 \DeclareUnicodeCharacter{0115}{\u{e}}%
10340 \DeclareUnicodeCharacter{0116}{\dotaccent{E}}%
10341 \DeclareUnicodeCharacter{0117}{\dotaccent{e}}%
10342 \DeclareUnicodeCharacter{0118}{\ogonek{E}}%
10343 \DeclareUnicodeCharacter{0119}{\ogonek{e}}%
10344 \DeclareUnicodeCharacter{011A}{\v{E}}%
10345 \DeclareUnicodeCharacter{011B}{\v{e}}%
10346 \DeclareUnicodeCharacter{011C}{\^G}%
10347 \DeclareUnicodeCharacter{011D}{\^g}%
10348 \DeclareUnicodeCharacter{011E}{\u{G}}%
10349 \DeclareUnicodeCharacter{011F}{\u{g}}%
10351 \DeclareUnicodeCharacter{0120}{\dotaccent{G}}%
10352 \DeclareUnicodeCharacter{0121}{\dotaccent{g}}%
10353 \DeclareUnicodeCharacter{0122}{\cedilla{G}}%
10354 \DeclareUnicodeCharacter{0123}{\cedilla{g}}%
10355 \DeclareUnicodeCharacter{0124}{\^H}%
10356 \DeclareUnicodeCharacter{0125}{\^h}%
10357 \DeclareUnicodeCharacter{0126}{\missingcharmsg{H WITH STROKE}}%
10358 \DeclareUnicodeCharacter{0127}{\missingcharmsg{h WITH STROKE}}%
10359 \DeclareUnicodeCharacter{0128}{\~I}%
10360 \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}}%
10361 \DeclareUnicodeCharacter{012A}{\=I}%
10362 \DeclareUnicodeCharacter{012B}{\={\dotless{i}}}%
10363 \DeclareUnicodeCharacter{012C}{\u{I}}%
10364 \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}}%
10365 \DeclareUnicodeCharacter{012E}{\ogonek{I}}%
10366 \DeclareUnicodeCharacter{012F}{\ogonek{i}}%
10368 \DeclareUnicodeCharacter{0130}{\dotaccent{I}}%
10369 \DeclareUnicodeCharacter{0131}{\dotless{i}}%
10370 \DeclareUnicodeCharacter{0132}{IJ}%
10371 \DeclareUnicodeCharacter{0133}{ij}%
10372 \DeclareUnicodeCharacter{0134}{\^J}%
10373 \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}}%
10374 \DeclareUnicodeCharacter{0136}{\cedilla{K}}%
10375 \DeclareUnicodeCharacter{0137}{\cedilla{k}}%
10376 \DeclareUnicodeCharacter{0138}{\ensuremath\kappa}%
10377 \DeclareUnicodeCharacter{0139}{\'L}%
10378 \DeclareUnicodeCharacter{013A}{\'l}%
10379 \DeclareUnicodeCharacter{013B}{\cedilla{L}}%
10380 \DeclareUnicodeCharacter{013C}{\cedilla{l}}%
10381 \DeclareUnicodeCharacter{013D}{L'}% should kern
10382 \DeclareUnicodeCharacter{013E}{l'}% should kern
10383 \DeclareUnicodeCharacter{013F}{L\U{00B7}}%
10385 \DeclareUnicodeCharacter{0140}{l\U{00B7}}%
10386 \DeclareUnicodeCharacter{0141}{\L}%
10387 \DeclareUnicodeCharacter{0142}{\l}%
10388 \DeclareUnicodeCharacter{0143}{\'N}%
10389 \DeclareUnicodeCharacter{0144}{\'n}%
10390 \DeclareUnicodeCharacter{0145}{\cedilla{N}}%
10391 \DeclareUnicodeCharacter{0146}{\cedilla{n}}%
10392 \DeclareUnicodeCharacter{0147}{\v{N}}%
10393 \DeclareUnicodeCharacter{0148}{\v{n}}%
10394 \DeclareUnicodeCharacter{0149}{'n}%
10395 \DeclareUnicodeCharacter{014A}{\missingcharmsg{ENG}}%
10396 \DeclareUnicodeCharacter{014B}{\missingcharmsg{eng}}%
10397 \DeclareUnicodeCharacter{014C}{\=O}%
10398 \DeclareUnicodeCharacter{014D}{\=o}%
10399 \DeclareUnicodeCharacter{014E}{\u{O}}%
10400 \DeclareUnicodeCharacter{014F}{\u{o}}%
10402 \DeclareUnicodeCharacter{0150}{\H{O}}%
10403 \DeclareUnicodeCharacter{0151}{\H{o}}%
10404 \DeclareUnicodeCharacter{0152}{\OE}%
10405 \DeclareUnicodeCharacter{0153}{\oe}%
10406 \DeclareUnicodeCharacter{0154}{\'R}%
10407 \DeclareUnicodeCharacter{0155}{\'r}%
10408 \DeclareUnicodeCharacter{0156}{\cedilla{R}}%
10409 \DeclareUnicodeCharacter{0157}{\cedilla{r}}%
10410 \DeclareUnicodeCharacter{0158}{\v{R}}%
10411 \DeclareUnicodeCharacter{0159}{\v{r}}%
10412 \DeclareUnicodeCharacter{015A}{\'S}%
10413 \DeclareUnicodeCharacter{015B}{\'s}%
10414 \DeclareUnicodeCharacter{015C}{\^S}%
10415 \DeclareUnicodeCharacter{015D}{\^s}%
10416 \DeclareUnicodeCharacter{015E}{\cedilla{S}}%
10417 \DeclareUnicodeCharacter{015F}{\cedilla{s}}%
10419 \DeclareUnicodeCharacter{0160}{\v{S}}%
10420 \DeclareUnicodeCharacter{0161}{\v{s}}%
10421 \DeclareUnicodeCharacter{0162}{\cedilla{T}}%
10422 \DeclareUnicodeCharacter{0163}{\cedilla{t}}%
10423 \DeclareUnicodeCharacter{0164}{\v{T}}%
10424 \DeclareUnicodeCharacter{0165}{\v{t}}%
10425 \DeclareUnicodeCharacter{0166}{\missingcharmsg{H WITH STROKE}}%
10426 \DeclareUnicodeCharacter{0167}{\missingcharmsg{h WITH STROKE}}%
10427 \DeclareUnicodeCharacter{0168}{\~U}%
10428 \DeclareUnicodeCharacter{0169}{\~u}%
10429 \DeclareUnicodeCharacter{016A}{\=U}%
10430 \DeclareUnicodeCharacter{016B}{\=u}%
10431 \DeclareUnicodeCharacter{016C}{\u{U}}%
10432 \DeclareUnicodeCharacter{016D}{\u{u}}%
10433 \DeclareUnicodeCharacter{016E}{\ringaccent{U}}%
10434 \DeclareUnicodeCharacter{016F}{\ringaccent{u}}%
10436 \DeclareUnicodeCharacter{0170}{\H{U}}%
10437 \DeclareUnicodeCharacter{0171}{\H{u}}%
10438 \DeclareUnicodeCharacter{0172}{\ogonek{U}}%
10439 \DeclareUnicodeCharacter{0173}{\ogonek{u}}%
10440 \DeclareUnicodeCharacter{0174}{\^W}%
10441 \DeclareUnicodeCharacter{0175}{\^w}%
10442 \DeclareUnicodeCharacter{0176}{\^Y}%
10443 \DeclareUnicodeCharacter{0177}{\^y}%
10444 \DeclareUnicodeCharacter{0178}{\"Y}%
10445 \DeclareUnicodeCharacter{0179}{\'Z}%
10446 \DeclareUnicodeCharacter{017A}{\'z}%
10447 \DeclareUnicodeCharacter{017B}{\dotaccent{Z}}%
10448 \DeclareUnicodeCharacter{017C}{\dotaccent{z}}%
10449 \DeclareUnicodeCharacter{017D}{\v{Z}}%
10450 \DeclareUnicodeCharacter{017E}{\v{z}}%
10451 \DeclareUnicodeCharacter{017F}{\missingcharmsg{LONG S}}%
10453 \DeclareUnicodeCharacter{01C4}{D\v{Z}}%
10454 \DeclareUnicodeCharacter{01C5}{D\v{z}}%
10455 \DeclareUnicodeCharacter{01C6}{d\v{z}}%
10456 \DeclareUnicodeCharacter{01C7}{LJ}%
10457 \DeclareUnicodeCharacter{01C8}{Lj}%
10458 \DeclareUnicodeCharacter{01C9}{lj}%
10459 \DeclareUnicodeCharacter{01CA}{NJ}%
10460 \DeclareUnicodeCharacter{01CB}{Nj}%
10461 \DeclareUnicodeCharacter{01CC}{nj}%
10462 \DeclareUnicodeCharacter{01CD}{\v{A}}%
10463 \DeclareUnicodeCharacter{01CE}{\v{a}}%
10464 \DeclareUnicodeCharacter{01CF}{\v{I}}%
10466 \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}}%
10467 \DeclareUnicodeCharacter{01D1}{\v{O}}%
10468 \DeclareUnicodeCharacter{01D2}{\v{o}}%
10469 \DeclareUnicodeCharacter{01D3}{\v{U}}%
10470 \DeclareUnicodeCharacter{01D4}{\v{u}}%
10472 \DeclareUnicodeCharacter{01E2}{\={\AE}}%
10473 \DeclareUnicodeCharacter{01E3}{\={\ae}}%
10474 \DeclareUnicodeCharacter{01E6}{\v{G}}%
10475 \DeclareUnicodeCharacter{01E7}{\v{g}}%
10476 \DeclareUnicodeCharacter{01E8}{\v{K}}%
10477 \DeclareUnicodeCharacter{01E9}{\v{k}}%
10479 \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}}%
10480 \DeclareUnicodeCharacter{01F1}{DZ}%
10481 \DeclareUnicodeCharacter{01F2}{Dz}%
10482 \DeclareUnicodeCharacter{01F3}{dz}%
10483 \DeclareUnicodeCharacter{01F4}{\'G}%
10484 \DeclareUnicodeCharacter{01F5}{\'g}%
10485 \DeclareUnicodeCharacter{01F8}{\`N}%
10486 \DeclareUnicodeCharacter{01F9}{\`n}%
10487 \DeclareUnicodeCharacter{01FC}{\'{\AE}}%
10488 \DeclareUnicodeCharacter{01FD}{\'{\ae}}%
10489 \DeclareUnicodeCharacter{01FE}{\'{\O}}%
10490 \DeclareUnicodeCharacter{01FF}{\'{\o}}%
10492 \DeclareUnicodeCharacter{021E}{\v{H}}%
10493 \DeclareUnicodeCharacter{021F}{\v{h}}%
10495 \DeclareUnicodeCharacter{0226}{\dotaccent{A}}%
10496 \DeclareUnicodeCharacter{0227}{\dotaccent{a}}%
10497 \DeclareUnicodeCharacter{0228}{\cedilla{E}}%
10498 \DeclareUnicodeCharacter{0229}{\cedilla{e}}%
10499 \DeclareUnicodeCharacter{022E}{\dotaccent{O}}%
10500 \DeclareUnicodeCharacter{022F}{\dotaccent{o}}%
10502 \DeclareUnicodeCharacter{0232}{\=Y}%
10503 \DeclareUnicodeCharacter{0233}{\=y}%
10504 \DeclareUnicodeCharacter{0237}{\dotless{j}}%
10506 \DeclareUnicodeCharacter{02DB}{\ogonek{ }}%
10508 % Greek letters upper case
10509 \DeclareUnicodeCharacter{0391}{{\it A}}%
10510 \DeclareUnicodeCharacter{0392}{{\it B}}%
10511 \DeclareUnicodeCharacter{0393}{\ensuremath{\mit\Gamma}}%
10512 \DeclareUnicodeCharacter{0394}{\ensuremath{\mit\Delta}}%
10513 \DeclareUnicodeCharacter{0395}{{\it E}}%
10514 \DeclareUnicodeCharacter{0396}{{\it Z}}%
10515 \DeclareUnicodeCharacter{0397}{{\it H}}%
10516 \DeclareUnicodeCharacter{0398}{\ensuremath{\mit\Theta}}%
10517 \DeclareUnicodeCharacter{0399}{{\it I}}%
10518 \DeclareUnicodeCharacter{039A}{{\it K}}%
10519 \DeclareUnicodeCharacter{039B}{\ensuremath{\mit\Lambda}}%
10520 \DeclareUnicodeCharacter{039C}{{\it M}}%
10521 \DeclareUnicodeCharacter{039D}{{\it N}}%
10522 \DeclareUnicodeCharacter{039E}{\ensuremath{\mit\Xi}}%
10523 \DeclareUnicodeCharacter{039F}{{\it O}}%
10524 \DeclareUnicodeCharacter{03A0}{\ensuremath{\mit\Pi}}%
10525 \DeclareUnicodeCharacter{03A1}{{\it P}}%
10526 %\DeclareUnicodeCharacter{03A2}{} % none - corresponds to final sigma
10527 \DeclareUnicodeCharacter{03A3}{\ensuremath{\mit\Sigma}}%
10528 \DeclareUnicodeCharacter{03A4}{{\it T}}%
10529 \DeclareUnicodeCharacter{03A5}{\ensuremath{\mit\Upsilon}}%
10530 \DeclareUnicodeCharacter{03A6}{\ensuremath{\mit\Phi}}%
10531 \DeclareUnicodeCharacter{03A7}{{\it X}}%
10532 \DeclareUnicodeCharacter{03A8}{\ensuremath{\mit\Psi}}%
10533 \DeclareUnicodeCharacter{03A9}{\ensuremath{\mit\Omega}}%
10535 % Vowels with accents
10536 \DeclareUnicodeCharacter{0390}{\ensuremath{\ddot{\acute\iota}}}%
10537 \DeclareUnicodeCharacter{03AC}{\ensuremath{\acute\alpha}}%
10538 \DeclareUnicodeCharacter{03AD}{\ensuremath{\acute\epsilon}}%
10539 \DeclareUnicodeCharacter{03AE}{\ensuremath{\acute\eta}}%
10540 \DeclareUnicodeCharacter{03AF}{\ensuremath{\acute\iota}}%
10541 \DeclareUnicodeCharacter{03B0}{\ensuremath{\acute{\ddot\upsilon}}}%
10543 % Standalone accent
10544 \DeclareUnicodeCharacter{0384}{\ensuremath{\acute{\ }}}%
10546 % Greek letters lower case
10547 \DeclareUnicodeCharacter{03B1}{\ensuremath\alpha}%
10548 \DeclareUnicodeCharacter{03B2}{\ensuremath\beta}%
10549 \DeclareUnicodeCharacter{03B3}{\ensuremath\gamma}%
10550 \DeclareUnicodeCharacter{03B4}{\ensuremath\delta}%
10551 \DeclareUnicodeCharacter{03B5}{\ensuremath\epsilon}%
10552 \DeclareUnicodeCharacter{03B6}{\ensuremath\zeta}%
10553 \DeclareUnicodeCharacter{03B7}{\ensuremath\eta}%
10554 \DeclareUnicodeCharacter{03B8}{\ensuremath\theta}%
10555 \DeclareUnicodeCharacter{03B9}{\ensuremath\iota}%
10556 \DeclareUnicodeCharacter{03BA}{\ensuremath\kappa}%
10557 \DeclareUnicodeCharacter{03BB}{\ensuremath\lambda}%
10558 \DeclareUnicodeCharacter{03BC}{\ensuremath\mu}%
10559 \DeclareUnicodeCharacter{03BD}{\ensuremath\nu}%
10560 \DeclareUnicodeCharacter{03BE}{\ensuremath\xi}%
10561 \DeclareUnicodeCharacter{03BF}{{\it o}}% omicron
10562 \DeclareUnicodeCharacter{03C0}{\ensuremath\pi}%
10563 \DeclareUnicodeCharacter{03C1}{\ensuremath\rho}%
10564 \DeclareUnicodeCharacter{03C2}{\ensuremath\varsigma}%
10565 \DeclareUnicodeCharacter{03C3}{\ensuremath\sigma}%
10566 \DeclareUnicodeCharacter{03C4}{\ensuremath\tau}%
10567 \DeclareUnicodeCharacter{03C5}{\ensuremath\upsilon}%
10568 \DeclareUnicodeCharacter{03C6}{\ensuremath\phi}%
10569 \DeclareUnicodeCharacter{03C7}{\ensuremath\chi}%
10570 \DeclareUnicodeCharacter{03C8}{\ensuremath\psi}%
10571 \DeclareUnicodeCharacter{03C9}{\ensuremath\omega}%
10573 % More Greek vowels with accents
10574 \DeclareUnicodeCharacter{03CA}{\ensuremath{\ddot\iota}}%
10575 \DeclareUnicodeCharacter{03CB}{\ensuremath{\ddot\upsilon}}%
10576 \DeclareUnicodeCharacter{03CC}{\ensuremath{\acute o}}%
10577 \DeclareUnicodeCharacter{03CD}{\ensuremath{\acute\upsilon}}%
10578 \DeclareUnicodeCharacter{03CE}{\ensuremath{\acute\omega}}%
10580 % Variant Greek letters
10581 \DeclareUnicodeCharacter{03D1}{\ensuremath\vartheta}%
10582 \DeclareUnicodeCharacter{03D6}{\ensuremath\varpi}%
10583 \DeclareUnicodeCharacter{03F1}{\ensuremath\varrho}%
10585 \DeclareUnicodeCharacter{1E02}{\dotaccent{B}}%
10586 \DeclareUnicodeCharacter{1E03}{\dotaccent{b}}%
10587 \DeclareUnicodeCharacter{1E04}{\udotaccent{B}}%
10588 \DeclareUnicodeCharacter{1E05}{\udotaccent{b}}%
10589 \DeclareUnicodeCharacter{1E06}{\ubaraccent{B}}%
10590 \DeclareUnicodeCharacter{1E07}{\ubaraccent{b}}%
10591 \DeclareUnicodeCharacter{1E0A}{\dotaccent{D}}%
10592 \DeclareUnicodeCharacter{1E0B}{\dotaccent{d}}%
10593 \DeclareUnicodeCharacter{1E0C}{\udotaccent{D}}%
10594 \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}}%
10595 \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}}%
10596 \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}}%
10598 \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}}%
10599 \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}}%
10601 \DeclareUnicodeCharacter{1E20}{\=G}%
10602 \DeclareUnicodeCharacter{1E21}{\=g}%
10603 \DeclareUnicodeCharacter{1E22}{\dotaccent{H}}%
10604 \DeclareUnicodeCharacter{1E23}{\dotaccent{h}}%
10605 \DeclareUnicodeCharacter{1E24}{\udotaccent{H}}%
10606 \DeclareUnicodeCharacter{1E25}{\udotaccent{h}}%
10607 \DeclareUnicodeCharacter{1E26}{\"H}%
10608 \DeclareUnicodeCharacter{1E27}{\"h}%
10610 \DeclareUnicodeCharacter{1E30}{\'K}%
10611 \DeclareUnicodeCharacter{1E31}{\'k}%
10612 \DeclareUnicodeCharacter{1E32}{\udotaccent{K}}%
10613 \DeclareUnicodeCharacter{1E33}{\udotaccent{k}}%
10614 \DeclareUnicodeCharacter{1E34}{\ubaraccent{K}}%
10615 \DeclareUnicodeCharacter{1E35}{\ubaraccent{k}}%
10616 \DeclareUnicodeCharacter{1E36}{\udotaccent{L}}%
10617 \DeclareUnicodeCharacter{1E37}{\udotaccent{l}}%
10618 \DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}}%
10619 \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}}%
10620 \DeclareUnicodeCharacter{1E3E}{\'M}%
10621 \DeclareUnicodeCharacter{1E3F}{\'m}%
10623 \DeclareUnicodeCharacter{1E40}{\dotaccent{M}}%
10624 \DeclareUnicodeCharacter{1E41}{\dotaccent{m}}%
10625 \DeclareUnicodeCharacter{1E42}{\udotaccent{M}}%
10626 \DeclareUnicodeCharacter{1E43}{\udotaccent{m}}%
10627 \DeclareUnicodeCharacter{1E44}{\dotaccent{N}}%
10628 \DeclareUnicodeCharacter{1E45}{\dotaccent{n}}%
10629 \DeclareUnicodeCharacter{1E46}{\udotaccent{N}}%
10630 \DeclareUnicodeCharacter{1E47}{\udotaccent{n}}%
10631 \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}}%
10632 \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}}%
10634 \DeclareUnicodeCharacter{1E54}{\'P}%
10635 \DeclareUnicodeCharacter{1E55}{\'p}%
10636 \DeclareUnicodeCharacter{1E56}{\dotaccent{P}}%
10637 \DeclareUnicodeCharacter{1E57}{\dotaccent{p}}%
10638 \DeclareUnicodeCharacter{1E58}{\dotaccent{R}}%
10639 \DeclareUnicodeCharacter{1E59}{\dotaccent{r}}%
10640 \DeclareUnicodeCharacter{1E5A}{\udotaccent{R}}%
10641 \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}}%
10642 \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}}%
10643 \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}}%
10645 \DeclareUnicodeCharacter{1E60}{\dotaccent{S}}%
10646 \DeclareUnicodeCharacter{1E61}{\dotaccent{s}}%
10647 \DeclareUnicodeCharacter{1E62}{\udotaccent{S}}%
10648 \DeclareUnicodeCharacter{1E63}{\udotaccent{s}}%
10649 \DeclareUnicodeCharacter{1E6A}{\dotaccent{T}}%
10650 \DeclareUnicodeCharacter{1E6B}{\dotaccent{t}}%
10651 \DeclareUnicodeCharacter{1E6C}{\udotaccent{T}}%
10652 \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}}%
10653 \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}}%
10654 \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}}%
10656 \DeclareUnicodeCharacter{1E7C}{\~V}%
10657 \DeclareUnicodeCharacter{1E7D}{\~v}%
10658 \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}}%
10659 \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}}%
10661 \DeclareUnicodeCharacter{1E80}{\`W}%
10662 \DeclareUnicodeCharacter{1E81}{\`w}%
10663 \DeclareUnicodeCharacter{1E82}{\'W}%
10664 \DeclareUnicodeCharacter{1E83}{\'w}%
10665 \DeclareUnicodeCharacter{1E84}{\"W}%
10666 \DeclareUnicodeCharacter{1E85}{\"w}%
10667 \DeclareUnicodeCharacter{1E86}{\dotaccent{W}}%
10668 \DeclareUnicodeCharacter{1E87}{\dotaccent{w}}%
10669 \DeclareUnicodeCharacter{1E88}{\udotaccent{W}}%
10670 \DeclareUnicodeCharacter{1E89}{\udotaccent{w}}%
10671 \DeclareUnicodeCharacter{1E8A}{\dotaccent{X}}%
10672 \DeclareUnicodeCharacter{1E8B}{\dotaccent{x}}%
10673 \DeclareUnicodeCharacter{1E8C}{\"X}%
10674 \DeclareUnicodeCharacter{1E8D}{\"x}%
10675 \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}}%
10676 \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}}%
10678 \DeclareUnicodeCharacter{1E90}{\^Z}%
10679 \DeclareUnicodeCharacter{1E91}{\^z}%
10680 \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}}%
10681 \DeclareUnicodeCharacter{1E93}{\udotaccent{z}}%
10682 \DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}}%
10683 \DeclareUnicodeCharacter{1E95}{\ubaraccent{z}}%
10684 \DeclareUnicodeCharacter{1E96}{\ubaraccent{h}}%
10685 \DeclareUnicodeCharacter{1E97}{\"t}%
10686 \DeclareUnicodeCharacter{1E98}{\ringaccent{w}}%
10687 \DeclareUnicodeCharacter{1E99}{\ringaccent{y}}%
10689 \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}}%
10690 \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}}%
10692 \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}}%
10693 \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}}%
10694 \DeclareUnicodeCharacter{1EBC}{\~E}%
10695 \DeclareUnicodeCharacter{1EBD}{\~e}%
10697 \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}}%
10698 \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}}%
10699 \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}}%
10700 \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}}%
10702 \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}}%
10703 \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}}%
10705 \DeclareUnicodeCharacter{1EF2}{\`Y}%
10706 \DeclareUnicodeCharacter{1EF3}{\`y}%
10707 \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}}%
10709 \DeclareUnicodeCharacter{1EF8}{\~Y}%
10710 \DeclareUnicodeCharacter{1EF9}{\~y}%
10712 % Punctuation
10713 \DeclareUnicodeCharacter{2013}{--}%
10714 \DeclareUnicodeCharacter{2014}{---}%
10715 \DeclareUnicodeCharacter{2018}{\quoteleft}%
10716 \DeclareUnicodeCharacter{2019}{\quoteright}%
10717 \DeclareUnicodeCharacter{201A}{\quotesinglbase}%
10718 \DeclareUnicodeCharacter{201C}{\quotedblleft}%
10719 \DeclareUnicodeCharacter{201D}{\quotedblright}%
10720 \DeclareUnicodeCharacter{201E}{\quotedblbase}%
10721 \DeclareUnicodeCharacter{2020}{\ensuremath\dagger}%
10722 \DeclareUnicodeCharacter{2021}{\ensuremath\ddagger}%
10723 \DeclareUnicodeCharacter{2022}{\bullet}%
10724 \DeclareUnicodeCharacter{202F}{\thinspace}%
10725 \DeclareUnicodeCharacter{2026}{\dots}%
10726 \DeclareUnicodeCharacter{2039}{\guilsinglleft}%
10727 \DeclareUnicodeCharacter{203A}{\guilsinglright}%
10729 \DeclareUnicodeCharacter{20AC}{\euro}%
10731 \DeclareUnicodeCharacter{2192}{\expansion}%
10732 \DeclareUnicodeCharacter{21D2}{\result}%
10734 % Mathematical symbols
10735 \DeclareUnicodeCharacter{2200}{\ensuremath\forall}%
10736 \DeclareUnicodeCharacter{2203}{\ensuremath\exists}%
10737 \DeclareUnicodeCharacter{2208}{\ensuremath\in}%
10738 \DeclareUnicodeCharacter{2212}{\minus}%
10739 \DeclareUnicodeCharacter{2217}{\ast}%
10740 \DeclareUnicodeCharacter{221E}{\ensuremath\infty}%
10741 \DeclareUnicodeCharacter{2225}{\ensuremath\parallel}%
10742 \DeclareUnicodeCharacter{2227}{\ensuremath\wedge}%
10743 \DeclareUnicodeCharacter{2229}{\ensuremath\cap}%
10744 \DeclareUnicodeCharacter{2261}{\equiv}%
10745 \DeclareUnicodeCharacter{2264}{\ensuremath\leq}%
10746 \DeclareUnicodeCharacter{2265}{\ensuremath\geq}%
10747 \DeclareUnicodeCharacter{2282}{\ensuremath\subset}%
10748 \DeclareUnicodeCharacter{2287}{\ensuremath\supseteq}%
10750 \DeclareUnicodeCharacter{2016}{\ensuremath\Vert}%
10751 \DeclareUnicodeCharacter{2032}{\ensuremath\prime}%
10752 \DeclareUnicodeCharacter{210F}{\ensuremath\hbar}%
10753 \DeclareUnicodeCharacter{2111}{\ensuremath\Im}%
10754 \DeclareUnicodeCharacter{2113}{\ensuremath\ell}%
10755 \DeclareUnicodeCharacter{2118}{\ensuremath\wp}%
10756 \DeclareUnicodeCharacter{211C}{\ensuremath\Re}%
10757 \DeclareUnicodeCharacter{2127}{\ensuremath\mho}%
10758 \DeclareUnicodeCharacter{2135}{\ensuremath\aleph}%
10759 \DeclareUnicodeCharacter{2190}{\ensuremath\leftarrow}%
10760 \DeclareUnicodeCharacter{2191}{\ensuremath\uparrow}%
10761 \DeclareUnicodeCharacter{2193}{\ensuremath\downarrow}%
10762 \DeclareUnicodeCharacter{2194}{\ensuremath\leftrightarrow}%
10763 \DeclareUnicodeCharacter{2195}{\ensuremath\updownarrow}%
10764 \DeclareUnicodeCharacter{2196}{\ensuremath\nwarrow}%
10765 \DeclareUnicodeCharacter{2197}{\ensuremath\nearrow}%
10766 \DeclareUnicodeCharacter{2198}{\ensuremath\searrow}%
10767 \DeclareUnicodeCharacter{2199}{\ensuremath\swarrow}%
10768 \DeclareUnicodeCharacter{21A6}{\ensuremath\mapsto}%
10769 \DeclareUnicodeCharacter{21A9}{\ensuremath\hookleftarrow}%
10770 \DeclareUnicodeCharacter{21AA}{\ensuremath\hookrightarrow}%
10771 \DeclareUnicodeCharacter{21BC}{\ensuremath\leftharpoonup}%
10772 \DeclareUnicodeCharacter{21BD}{\ensuremath\leftharpoondown}%
10773 \DeclareUnicodeCharacter{21BE}{\ensuremath\upharpoonright}%
10774 \DeclareUnicodeCharacter{21C0}{\ensuremath\rightharpoonup}%
10775 \DeclareUnicodeCharacter{21C1}{\ensuremath\rightharpoondown}%
10776 \DeclareUnicodeCharacter{21CC}{\ensuremath\rightleftharpoons}%
10777 \DeclareUnicodeCharacter{21D0}{\ensuremath\Leftarrow}%
10778 \DeclareUnicodeCharacter{21D1}{\ensuremath\Uparrow}%
10779 \DeclareUnicodeCharacter{21D3}{\ensuremath\Downarrow}%
10780 \DeclareUnicodeCharacter{21D4}{\ensuremath\Leftrightarrow}%
10781 \DeclareUnicodeCharacter{21D5}{\ensuremath\Updownarrow}%
10782 \DeclareUnicodeCharacter{21DD}{\ensuremath\leadsto}%
10783 \DeclareUnicodeCharacter{2201}{\ensuremath\complement}%
10784 \DeclareUnicodeCharacter{2202}{\ensuremath\partial}%
10785 \DeclareUnicodeCharacter{2205}{\ensuremath\emptyset}%
10786 \DeclareUnicodeCharacter{2207}{\ensuremath\nabla}%
10787 \DeclareUnicodeCharacter{2209}{\ensuremath\notin}%
10788 \DeclareUnicodeCharacter{220B}{\ensuremath\owns}%
10789 \DeclareUnicodeCharacter{220F}{\ensuremath\prod}%
10790 \DeclareUnicodeCharacter{2210}{\ensuremath\coprod}%
10791 \DeclareUnicodeCharacter{2211}{\ensuremath\sum}%
10792 \DeclareUnicodeCharacter{2213}{\ensuremath\mp}%
10793 \DeclareUnicodeCharacter{2218}{\ensuremath\circ}%
10794 \DeclareUnicodeCharacter{221A}{\ensuremath\surd}%
10795 \DeclareUnicodeCharacter{221D}{\ensuremath\propto}%
10796 \DeclareUnicodeCharacter{2220}{\ensuremath\angle}%
10797 \DeclareUnicodeCharacter{2223}{\ensuremath\mid}%
10798 \DeclareUnicodeCharacter{2228}{\ensuremath\vee}%
10799 \DeclareUnicodeCharacter{222A}{\ensuremath\cup}%
10800 \DeclareUnicodeCharacter{222B}{\ensuremath\smallint}%
10801 \DeclareUnicodeCharacter{222E}{\ensuremath\oint}%
10802 \DeclareUnicodeCharacter{223C}{\ensuremath\sim}%
10803 \DeclareUnicodeCharacter{2240}{\ensuremath\wr}%
10804 \DeclareUnicodeCharacter{2243}{\ensuremath\simeq}%
10805 \DeclareUnicodeCharacter{2245}{\ensuremath\cong}%
10806 \DeclareUnicodeCharacter{2248}{\ensuremath\approx}%
10807 \DeclareUnicodeCharacter{224D}{\ensuremath\asymp}%
10808 \DeclareUnicodeCharacter{2250}{\ensuremath\doteq}%
10809 \DeclareUnicodeCharacter{2260}{\ensuremath\neq}%
10810 \DeclareUnicodeCharacter{226A}{\ensuremath\ll}%
10811 \DeclareUnicodeCharacter{226B}{\ensuremath\gg}%
10812 \DeclareUnicodeCharacter{227A}{\ensuremath\prec}%
10813 \DeclareUnicodeCharacter{227B}{\ensuremath\succ}%
10814 \DeclareUnicodeCharacter{2283}{\ensuremath\supset}%
10815 \DeclareUnicodeCharacter{2286}{\ensuremath\subseteq}%
10816 \DeclareUnicodeCharacter{228E}{\ensuremath\uplus}%
10817 \DeclareUnicodeCharacter{228F}{\ensuremath\sqsubset}%
10818 \DeclareUnicodeCharacter{2290}{\ensuremath\sqsupset}%
10819 \DeclareUnicodeCharacter{2291}{\ensuremath\sqsubseteq}%
10820 \DeclareUnicodeCharacter{2292}{\ensuremath\sqsupseteq}%
10821 \DeclareUnicodeCharacter{2293}{\ensuremath\sqcap}%
10822 \DeclareUnicodeCharacter{2294}{\ensuremath\sqcup}%
10823 \DeclareUnicodeCharacter{2295}{\ensuremath\oplus}%
10824 \DeclareUnicodeCharacter{2296}{\ensuremath\ominus}%
10825 \DeclareUnicodeCharacter{2297}{\ensuremath\otimes}%
10826 \DeclareUnicodeCharacter{2298}{\ensuremath\oslash}%
10827 \DeclareUnicodeCharacter{2299}{\ensuremath\odot}%
10828 \DeclareUnicodeCharacter{22A2}{\ensuremath\vdash}%
10829 \DeclareUnicodeCharacter{22A3}{\ensuremath\dashv}%
10830 \DeclareUnicodeCharacter{22A4}{\ensuremath\ptextop}%
10831 \DeclareUnicodeCharacter{22A5}{\ensuremath\bot}%
10832 \DeclareUnicodeCharacter{22A8}{\ensuremath\models}%
10833 \DeclareUnicodeCharacter{22B4}{\ensuremath\unlhd}%
10834 \DeclareUnicodeCharacter{22B5}{\ensuremath\unrhd}%
10835 \DeclareUnicodeCharacter{22C0}{\ensuremath\bigwedge}%
10836 \DeclareUnicodeCharacter{22C1}{\ensuremath\bigvee}%
10837 \DeclareUnicodeCharacter{22C2}{\ensuremath\bigcap}%
10838 \DeclareUnicodeCharacter{22C3}{\ensuremath\bigcup}%
10839 \DeclareUnicodeCharacter{22C4}{\ensuremath\diamond}%
10840 \DeclareUnicodeCharacter{22C5}{\ensuremath\cdot}%
10841 \DeclareUnicodeCharacter{22C6}{\ensuremath\star}%
10842 \DeclareUnicodeCharacter{22C8}{\ensuremath\bowtie}%
10843 \DeclareUnicodeCharacter{2308}{\ensuremath\lceil}%
10844 \DeclareUnicodeCharacter{2309}{\ensuremath\rceil}%
10845 \DeclareUnicodeCharacter{230A}{\ensuremath\lfloor}%
10846 \DeclareUnicodeCharacter{230B}{\ensuremath\rfloor}%
10847 \DeclareUnicodeCharacter{2322}{\ensuremath\frown}%
10848 \DeclareUnicodeCharacter{2323}{\ensuremath\smile}%
10850 \DeclareUnicodeCharacter{25A1}{\ensuremath\Box}%
10851 \DeclareUnicodeCharacter{25B3}{\ensuremath\triangle}%
10852 \DeclareUnicodeCharacter{25B7}{\ensuremath\triangleright}%
10853 \DeclareUnicodeCharacter{25BD}{\ensuremath\bigtriangledown}%
10854 \DeclareUnicodeCharacter{25C1}{\ensuremath\triangleleft}%
10855 \DeclareUnicodeCharacter{25C7}{\ensuremath\Diamond}%
10856 \DeclareUnicodeCharacter{2660}{\ensuremath\spadesuit}%
10857 \DeclareUnicodeCharacter{2661}{\ensuremath\heartsuit}%
10858 \DeclareUnicodeCharacter{2662}{\ensuremath\diamondsuit}%
10859 \DeclareUnicodeCharacter{2663}{\ensuremath\clubsuit}%
10860 \DeclareUnicodeCharacter{266D}{\ensuremath\flat}%
10861 \DeclareUnicodeCharacter{266E}{\ensuremath\natural}%
10862 \DeclareUnicodeCharacter{266F}{\ensuremath\sharp}%
10863 \DeclareUnicodeCharacter{26AA}{\ensuremath\bigcirc}%
10864 \DeclareUnicodeCharacter{27B9}{\ensuremath\rangle}%
10865 \DeclareUnicodeCharacter{27C2}{\ensuremath\perp}%
10866 \DeclareUnicodeCharacter{27E8}{\ensuremath\langle}%
10867 \DeclareUnicodeCharacter{27F5}{\ensuremath\longleftarrow}%
10868 \DeclareUnicodeCharacter{27F6}{\ensuremath\longrightarrow}%
10869 \DeclareUnicodeCharacter{27F7}{\ensuremath\longleftrightarrow}%
10870 \DeclareUnicodeCharacter{27FC}{\ensuremath\longmapsto}%
10871 \DeclareUnicodeCharacter{29F5}{\ensuremath\setminus}%
10872 \DeclareUnicodeCharacter{2A00}{\ensuremath\bigodot}%
10873 \DeclareUnicodeCharacter{2A01}{\ensuremath\bigoplus}%
10874 \DeclareUnicodeCharacter{2A02}{\ensuremath\bigotimes}%
10875 \DeclareUnicodeCharacter{2A04}{\ensuremath\biguplus}%
10876 \DeclareUnicodeCharacter{2A06}{\ensuremath\bigsqcup}%
10877 \DeclareUnicodeCharacter{2A1D}{\ensuremath\Join}%
10878 \DeclareUnicodeCharacter{2A3F}{\ensuremath\amalg}%
10879 \DeclareUnicodeCharacter{2AAF}{\ensuremath\preceq}%
10880 \DeclareUnicodeCharacter{2AB0}{\ensuremath\succeq}%
10882 \global\mathchardef\checkmark="1370% actually the square root sign
10883 \DeclareUnicodeCharacter{2713}{\ensuremath\checkmark}%
10884 }% end of \unicodechardefs
10886 % UTF-8 byte sequence (pdfTeX) definitions (replacing and @U command)
10887 % It makes the setting that replace UTF-8 byte sequence.
10888 \def\utfeightchardefs{%
10889 \let\DeclareUnicodeCharacter\DeclareUnicodeCharacterUTFviii
10890 \unicodechardefs
10893 \newif\ifpassthroughchars
10894 \passthroughcharsfalse
10896 % For native Unicode (XeTeX and LuaTeX)
10897 % Definition macro to replace / pass-through the Unicode character
10899 \def\DeclareUnicodeCharacterNative#1#2{%
10900 \catcode"#1=\active
10901 \def\dodeclareunicodecharacternative##1##2##3{%
10902 \begingroup
10903 \uccode`\~="##2\relax
10904 \uppercase{\gdef~}{%
10905 \ifpassthroughchars
10906 ##1%
10907 \else
10908 ##3%
10911 \endgroup
10913 \begingroup
10914 \uccode`\.="#1\relax
10915 \uppercase{\def\UTFNativeTmp{.}}%
10916 \expandafter\dodeclareunicodecharacternative\UTFNativeTmp{#1}{#2}%
10917 \endgroup
10920 % Native Unicode (XeTeX and LuaTeX) character replacing definitions
10921 % It makes the setting that replace the Unicode characters.
10922 \def\nativeunicodechardefs{%
10923 \let\DeclareUnicodeCharacter\DeclareUnicodeCharacterNative
10924 \unicodechardefs
10927 % For native Unicode (XeTeX and LuaTeX). Make the character token expand
10928 % to the sequences given in \unicodechardefs for printing.
10929 \def\DeclareUnicodeCharacterNativeAtU#1#2{%
10930 \def\UTFAtUTmp{#2}
10931 \expandafter\globallet\csname uni:#1\endcsname \UTFAtUTmp
10934 % Native Unicode (XeTeX and LuaTeX) @U command definitions
10935 \def\nativeunicodechardefsatu{%
10936 \let\DeclareUnicodeCharacter\DeclareUnicodeCharacterNativeAtU
10937 \unicodechardefs
10940 % Native Unicode (XeTeX and LuaTeX) catcode other non global definitions
10941 \def\nativeunicodecharscatcodeothernonglobal{%
10942 \let\DeclareUnicodeCharacter\DeclareUnicodeCharacterNativeOther
10943 \unicodechardefs
10946 % Catcode (non-ASCII or native Unicode) are set to \other (non-global
10947 % assignments).
10948 \def\setcharscatcodeothernonglobal{%
10949 \iftxiusebytewiseio
10950 \setnonasciicharscatcodenonglobal\other
10951 \else
10952 \nativeunicodecharscatcodeothernonglobal
10956 % US-ASCII character definitions.
10957 \def\asciichardefs{% nothing need be done
10958 \relax
10961 % Redefine the active definitions of non-ASCII characters to expand to
10962 % non-active tokens with the same character code.
10963 \def\nonasciistringdefs{%
10964 \setnonasciicharscatcode\active
10965 \def\defstringchar##1{\def##1{\string##1}}%
10967 \defstringchar^^80\defstringchar^^81\defstringchar^^82\defstringchar^^83%
10968 \defstringchar^^84\defstringchar^^85\defstringchar^^86\defstringchar^^87%
10969 \defstringchar^^88\defstringchar^^89\defstringchar^^8a\defstringchar^^8b%
10970 \defstringchar^^8c\defstringchar^^8d\defstringchar^^8e\defstringchar^^8f%
10972 \defstringchar^^90\defstringchar^^91\defstringchar^^92\defstringchar^^93%
10973 \defstringchar^^94\defstringchar^^95\defstringchar^^96\defstringchar^^97%
10974 \defstringchar^^98\defstringchar^^99\defstringchar^^9a\defstringchar^^9b%
10975 \defstringchar^^9c\defstringchar^^9d\defstringchar^^9e\defstringchar^^9f%
10977 \defstringchar^^a0\defstringchar^^a1\defstringchar^^a2\defstringchar^^a3%
10978 \defstringchar^^a4\defstringchar^^a5\defstringchar^^a6\defstringchar^^a7%
10979 \defstringchar^^a8\defstringchar^^a9\defstringchar^^aa\defstringchar^^ab%
10980 \defstringchar^^ac\defstringchar^^ad\defstringchar^^ae\defstringchar^^af%
10982 \defstringchar^^b0\defstringchar^^b1\defstringchar^^b2\defstringchar^^b3%
10983 \defstringchar^^b4\defstringchar^^b5\defstringchar^^b6\defstringchar^^b7%
10984 \defstringchar^^b8\defstringchar^^b9\defstringchar^^ba\defstringchar^^bb%
10985 \defstringchar^^bc\defstringchar^^bd\defstringchar^^be\defstringchar^^bf%
10987 \defstringchar^^c0\defstringchar^^c1\defstringchar^^c2\defstringchar^^c3%
10988 \defstringchar^^c4\defstringchar^^c5\defstringchar^^c6\defstringchar^^c7%
10989 \defstringchar^^c8\defstringchar^^c9\defstringchar^^ca\defstringchar^^cb%
10990 \defstringchar^^cc\defstringchar^^cd\defstringchar^^ce\defstringchar^^cf%
10992 \defstringchar^^d0\defstringchar^^d1\defstringchar^^d2\defstringchar^^d3%
10993 \defstringchar^^d4\defstringchar^^d5\defstringchar^^d6\defstringchar^^d7%
10994 \defstringchar^^d8\defstringchar^^d9\defstringchar^^da\defstringchar^^db%
10995 \defstringchar^^dc\defstringchar^^dd\defstringchar^^de\defstringchar^^df%
10997 \defstringchar^^e0\defstringchar^^e1\defstringchar^^e2\defstringchar^^e3%
10998 \defstringchar^^e4\defstringchar^^e5\defstringchar^^e6\defstringchar^^e7%
10999 \defstringchar^^e8\defstringchar^^e9\defstringchar^^ea\defstringchar^^eb%
11000 \defstringchar^^ec\defstringchar^^ed\defstringchar^^ee\defstringchar^^ef%
11002 \defstringchar^^f0\defstringchar^^f1\defstringchar^^f2\defstringchar^^f3%
11003 \defstringchar^^f4\defstringchar^^f5\defstringchar^^f6\defstringchar^^f7%
11004 \defstringchar^^f8\defstringchar^^f9\defstringchar^^fa\defstringchar^^fb%
11005 \defstringchar^^fc\defstringchar^^fd\defstringchar^^fe\defstringchar^^ff%
11008 % Write characters literally, instead of using active definitions for
11009 % printing the correct glyphs.
11010 \def\passthroughcharacters{%
11011 \iftxiusebytewiseio
11012 \nonasciistringdefs
11013 \else
11014 \passthroughcharstrue
11019 % define all the unicode characters we know about, for the sake of @U.
11020 \iftxinativeunicodecapable
11021 \nativeunicodechardefsatu
11022 \else
11023 \utfeightchardefs
11027 % Make non-ASCII characters printable again for compatibility with
11028 % existing Texinfo documents that may use them, even without declaring a
11029 % document encoding.
11031 \setnonasciicharscatcode \other
11034 \message{formatting,}
11036 \newdimen\defaultparindent \defaultparindent = 15pt
11038 \chapheadingskip = 15pt plus 4pt minus 2pt
11039 \secheadingskip = 12pt plus 3pt minus 2pt
11040 \subsecheadingskip = 9pt plus 2pt minus 2pt
11042 % Prevent underfull vbox error messages.
11043 \vbadness = 10000
11045 % Don't be very finicky about underfull hboxes, either.
11046 \hbadness = 6666
11048 % Following George Bush, get rid of widows and orphans.
11049 \widowpenalty=10000
11050 \clubpenalty=10000
11052 % Use TeX 3.0's \emergencystretch to help line breaking, but if we're
11053 % using an old version of TeX, don't do anything. We want the amount of
11054 % stretch added to depend on the line length, hence the dependence on
11055 % \hsize. We call this whenever the paper size is set.
11057 \def\setemergencystretch{%
11058 \ifx\emergencystretch\thisisundefined
11059 % Allow us to assign to \emergencystretch anyway.
11060 \def\emergencystretch{\dimen0}%
11061 \else
11062 \emergencystretch = .15\hsize
11066 % Parameters in order: 1) textheight; 2) textwidth;
11067 % 3) voffset; 4) hoffset; 5) binding offset; 6) topskip;
11068 % 7) physical page height; 8) physical page width.
11070 % We also call \setleading{\textleading}, so the caller should define
11071 % \textleading. The caller should also set \parskip.
11073 \def\internalpagesizes#1#2#3#4#5#6#7#8{%
11074 \voffset = #3\relax
11075 \topskip = #6\relax
11076 \splittopskip = \topskip
11078 \vsize = #1\relax
11079 \advance\vsize by \topskip
11080 \outervsize = \vsize
11081 \advance\outervsize by 2\topandbottommargin
11082 \txipageheight = \vsize
11084 \hsize = #2\relax
11085 \outerhsize = \hsize
11086 \advance\outerhsize by 0.5in
11087 \txipagewidth = \hsize
11089 \normaloffset = #4\relax
11090 \bindingoffset = #5\relax
11092 \ifpdf
11093 \pdfpageheight #7\relax
11094 \pdfpagewidth #8\relax
11095 % if we don't reset these, they will remain at "1 true in" of
11096 % whatever layout pdftex was dumped with.
11097 \pdfhorigin = 1 true in
11098 \pdfvorigin = 1 true in
11101 \setleading{\textleading}
11103 \parindent = \defaultparindent
11104 \setemergencystretch
11107 % @letterpaper (the default).
11108 \def\letterpaper{{\globaldefs = 1
11109 \parskip = 3pt plus 2pt minus 1pt
11110 \textleading = 13.2pt
11112 % If page is nothing but text, make it come out even.
11113 \internalpagesizes{607.2pt}{6in}% that's 46 lines
11114 {\voffset}{.25in}%
11115 {\bindingoffset}{36pt}%
11116 {11in}{8.5in}%
11119 % Use @smallbook to reset parameters for 7x9.25 trim size.
11120 \def\smallbook{{\globaldefs = 1
11121 \parskip = 2pt plus 1pt
11122 \textleading = 12pt
11124 \internalpagesizes{7.5in}{5in}%
11125 {-.2in}{0in}%
11126 {\bindingoffset}{16pt}%
11127 {9.25in}{7in}%
11129 \lispnarrowing = 0.3in
11130 \tolerance = 700
11131 \hfuzz = 1pt
11132 \contentsrightmargin = 0pt
11133 \defbodyindent = .5cm
11136 % Use @smallerbook to reset parameters for 6x9 trim size.
11137 % (Just testing, parameters still in flux.)
11138 \def\smallerbook{{\globaldefs = 1
11139 \parskip = 1.5pt plus 1pt
11140 \textleading = 12pt
11142 \internalpagesizes{7.4in}{4.8in}%
11143 {-.2in}{-.4in}%
11144 {0pt}{14pt}%
11145 {9in}{6in}%
11147 \lispnarrowing = 0.25in
11148 \tolerance = 700
11149 \hfuzz = 1pt
11150 \contentsrightmargin = 0pt
11151 \defbodyindent = .4cm
11154 % Use @afourpaper to print on European A4 paper.
11155 \def\afourpaper{{\globaldefs = 1
11156 \parskip = 3pt plus 2pt minus 1pt
11157 \textleading = 13.2pt
11159 % Double-side printing via postscript on Laserjet 4050
11160 % prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm.
11161 % To change the settings for a different printer or situation, adjust
11162 % \normaloffset until the front-side and back-side texts align. Then
11163 % do the same for \bindingoffset. You can set these for testing in
11164 % your texinfo source file like this:
11165 % @tex
11166 % \global\normaloffset = -6mm
11167 % \global\bindingoffset = 10mm
11168 % @end tex
11169 \internalpagesizes{673.2pt}{160mm}% that's 51 lines
11170 {\voffset}{\hoffset}%
11171 {\bindingoffset}{44pt}%
11172 {297mm}{210mm}%
11174 \tolerance = 700
11175 \hfuzz = 1pt
11176 \contentsrightmargin = 0pt
11177 \defbodyindent = 5mm
11180 % Use @afivepaper to print on European A5 paper.
11181 % From romildo@urano.iceb.ufop.br, 2 July 2000.
11182 % He also recommends making @example and @lisp be small.
11183 \def\afivepaper{{\globaldefs = 1
11184 \parskip = 2pt plus 1pt minus 0.1pt
11185 \textleading = 12.5pt
11187 \internalpagesizes{160mm}{120mm}%
11188 {\voffset}{\hoffset}%
11189 {\bindingoffset}{8pt}%
11190 {210mm}{148mm}%
11192 \lispnarrowing = 0.2in
11193 \tolerance = 800
11194 \hfuzz = 1.2pt
11195 \contentsrightmargin = 0pt
11196 \defbodyindent = 2mm
11197 \tableindent = 12mm
11200 % A specific text layout, 24x15cm overall, intended for A4 paper.
11201 \def\afourlatex{{\globaldefs = 1
11202 \afourpaper
11203 \internalpagesizes{237mm}{150mm}%
11204 {\voffset}{4.6mm}%
11205 {\bindingoffset}{7mm}%
11206 {297mm}{210mm}%
11208 % Must explicitly reset to 0 because we call \afourpaper.
11209 \globaldefs = 0
11212 % Use @afourwide to print on A4 paper in landscape format.
11213 \def\afourwide{{\globaldefs = 1
11214 \afourpaper
11215 \internalpagesizes{241mm}{165mm}%
11216 {\voffset}{-2.95mm}%
11217 {\bindingoffset}{7mm}%
11218 {297mm}{210mm}%
11219 \globaldefs = 0
11222 % @pagesizes TEXTHEIGHT[,TEXTWIDTH]
11223 % Perhaps we should allow setting the margins, \topskip, \parskip,
11224 % and/or leading, also. Or perhaps we should compute them somehow.
11226 \parseargdef\pagesizes{\pagesizesyyy #1,,\finish}
11227 \def\pagesizesyyy#1,#2,#3\finish{{%
11228 \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi
11229 \globaldefs = 1
11231 \parskip = 3pt plus 2pt minus 1pt
11232 \setleading{\textleading}%
11234 \dimen0 = #1\relax
11235 \advance\dimen0 by \voffset
11237 \dimen2 = \hsize
11238 \advance\dimen2 by \normaloffset
11240 \internalpagesizes{#1}{\hsize}%
11241 {\voffset}{\normaloffset}%
11242 {\bindingoffset}{44pt}%
11243 {\dimen0}{\dimen2}%
11246 % Set default to letter.
11248 \letterpaper
11251 \message{and turning on texinfo input format.}
11253 \def^^L{\par} % remove \outer, so ^L can appear in an @comment
11255 % DEL is a comment character, in case @c does not suffice.
11256 \catcode`\^^? = 14
11258 % Define macros to output various characters with catcode for normal text.
11259 \catcode`\"=\other \def\normaldoublequote{"}
11260 \catcode`\$=\other \def\normaldollar{$}%$ font-lock fix
11261 \catcode`\+=\other \def\normalplus{+}
11262 \catcode`\<=\other \def\normalless{<}
11263 \catcode`\>=\other \def\normalgreater{>}
11264 \catcode`\^=\other \def\normalcaret{^}
11265 \catcode`\_=\other \def\normalunderscore{_}
11266 \catcode`\|=\other \def\normalverticalbar{|}
11267 \catcode`\~=\other \def\normaltilde{~}
11269 % This macro is used to make a character print one way in \tt
11270 % (where it can probably be output as-is), and another way in other fonts,
11271 % where something hairier probably needs to be done.
11273 % #1 is what to print if we are indeed using \tt; #2 is what to print
11274 % otherwise. Since all the Computer Modern typewriter fonts have zero
11275 % interword stretch (and shrink), and it is reasonable to expect all
11276 % typewriter fonts to have this, we can check that font parameter.
11278 \def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi}
11280 % Same as above, but check for italic font. Actually this also catches
11281 % non-italic slanted fonts since it is impossible to distinguish them from
11282 % italic fonts. But since this is only used by $ and it uses \sl anyway
11283 % this is not a problem.
11284 \def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi}
11286 % Set catcodes for Texinfo file
11288 % Active characters for printing the wanted glyph.
11289 % Most of these we simply print from the \tt font, but for some, we can
11290 % use math or other variants that look better in normal text.
11292 \catcode`\"=\active
11293 \def\activedoublequote{{\tt\char34}}
11294 \let"=\activedoublequote
11295 \catcode`\~=\active \def\activetilde{{\tt\char126}} \let~ = \activetilde
11296 \chardef\hatchar=`\^
11297 \catcode`\^=\active \def\activehat{{\tt \hatchar}} \let^ = \activehat
11299 \catcode`\_=\active
11300 \def_{\ifusingtt\normalunderscore\_}
11301 \def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em }
11302 \let\realunder=_
11304 \catcode`\|=\active \def|{{\tt\char124}}
11306 \chardef \less=`\<
11307 \catcode`\<=\active \def\activeless{{\tt \less}}\let< = \activeless
11308 \chardef \gtr=`\>
11309 \catcode`\>=\active \def\activegtr{{\tt \gtr}}\let> = \activegtr
11310 \catcode`\+=\active \def+{{\tt \char 43}}
11311 \catcode`\$=\active \def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix
11312 \catcode`\-=\active \let-=\normaldash
11315 % used for headline/footline in the output routine, in case the page
11316 % breaks in the middle of an @tex block.
11317 \def\texinfochars{%
11318 \let< = \activeless
11319 \let> = \activegtr
11320 \let~ = \activetilde
11321 \let^ = \activehat
11322 \markupsetuplqdefault \markupsetuprqdefault
11323 \let\b = \strong
11324 \let\i = \smartitalic
11325 % in principle, all other definitions in \tex have to be undone too.
11328 % Used sometimes to turn off (effectively) the active characters even after
11329 % parsing them.
11330 \def\turnoffactive{%
11331 \normalturnoffactive
11332 \otherbackslash
11335 \catcode`\@=0
11337 % \backslashcurfont outputs one backslash character in current font,
11338 % as in \char`\\.
11339 \global\chardef\backslashcurfont=`\\
11340 \global\let\rawbackslashxx=\backslashcurfont % let existing .??s files work
11342 % \realbackslash is an actual character `\' with catcode other, and
11343 % \doublebackslash is two of them (for the pdf outlines).
11344 {\catcode`\\=\other @gdef@realbackslash{\} @gdef@doublebackslash{\\}}
11346 % In Texinfo, backslash is an active character; it prints the backslash
11347 % in fixed width font.
11348 \catcode`\\=\active % @ for escape char from now on.
11350 % Print a typewriter backslash. For math mode, we can't simply use
11351 % \backslashcurfont: the story here is that in math mode, the \char
11352 % of \backslashcurfont ends up printing the roman \ from the math symbol
11353 % font (because \char in math mode uses the \mathcode, and plain.tex
11354 % sets \mathcode`\\="026E). Hence we use an explicit \mathchar,
11355 % which is the decimal equivalent of "715c (class 7, e.g., use \fam;
11356 % ignored family value; char position "5C). We can't use " for the
11357 % usual hex value because it has already been made active.
11359 @def@ttbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi}}
11360 @let@backslashchar = @ttbackslash % @backslashchar{} is for user documents.
11362 % \rawbackslash defines an active \ to do \backslashcurfont.
11363 % \otherbackslash defines an active \ to be a literal `\' character with
11364 % catcode other. We switch back and forth between these.
11365 @gdef@rawbackslash{@let\=@backslashcurfont}
11366 @gdef@otherbackslash{@let\=@realbackslash}
11368 % Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
11369 % the literal character `\'.
11371 {@catcode`- = @active
11372 @gdef@normalturnoffactive{%
11373 @passthroughcharacters
11374 @let-=@normaldash
11375 @let"=@normaldoublequote
11376 @let$=@normaldollar %$ font-lock fix
11377 @let+=@normalplus
11378 @let<=@normalless
11379 @let>=@normalgreater
11380 @let^=@normalcaret
11381 @let_=@normalunderscore
11382 @let|=@normalverticalbar
11383 @let~=@normaltilde
11384 @let\=@ttbackslash
11385 @markupsetuplqdefault
11386 @markupsetuprqdefault
11387 @unsepspaces
11391 % If a .fmt file is being used, characters that might appear in a file
11392 % name cannot be active until we have parsed the command line.
11393 % So turn them off again, and have @fixbackslash turn them back on.
11394 @catcode`+=@other @catcode`@_=@other
11396 % \enablebackslashhack - allow file to begin `\input texinfo'
11398 % If a .fmt file is being used, we don't want the `\input texinfo' to show up.
11399 % That is what \eatinput is for; after that, the `\' should revert to printing
11400 % a backslash.
11401 % If the file did not have a `\input texinfo', then it is turned off after
11402 % the first line; otherwise the first `\' in the file would cause an error.
11403 % This is used on the very last line of this file, texinfo.tex.
11404 % We also use @c to call @fixbackslash, in case ends of lines are hidden.
11406 @catcode`@^=7
11407 @catcode`@^^M=13@gdef@enablebackslashhack{%
11408 @global@let\ = @eatinput%
11409 @catcode`@^^M=13%
11410 @def@c{@fixbackslash@c}%
11411 % Definition for the newline at the end of this file.
11412 @def ^^M{@let^^M@secondlinenl}%
11413 % Definition for a newline in the main Texinfo file.
11414 @gdef @secondlinenl{@fixbackslash}%
11417 {@catcode`@^=7 @catcode`@^^M=13%
11418 @gdef@eatinput input texinfo#1^^M{@fixbackslash}}
11420 % Emergency active definition of newline, in case an active newline token
11421 % appears by mistake.
11422 {@catcode`@^=7 @catcode13=13%
11423 @gdef@enableemergencynewline{%
11424 @gdef^^M{%
11425 @par%
11426 %<warning: active newline>@par%
11430 @gdef@fixbackslash{%
11431 @ifx\@eatinput @let\ = @ttbackslash @fi
11432 @catcode13=5 % regular end of line
11433 @enableemergencynewline
11434 @let@c=@texinfoc
11435 % Also turn back on active characters that might appear in the input
11436 % file name, in case not using a pre-dumped format.
11437 @catcode`+=@active
11438 @catcode`@_=@active
11440 % If texinfo.cnf is present on the system, read it.
11441 % Useful for site-wide @afourpaper, etc. This macro, @fixbackslash, gets
11442 % called at the beginning of every Texinfo file. Not opening texinfo.cnf
11443 % directly in this file, texinfo.tex, makes it possible to make a format
11444 % file for Texinfo.
11446 @openin 1 texinfo.cnf
11447 @ifeof 1 @else @input texinfo.cnf @fi
11448 @closein 1
11452 % Say @foo, not \foo, in error messages.
11453 @escapechar = `@@
11455 % These (along with & and #) are made active for url-breaking, so need
11456 % active definitions as the normal characters.
11457 @def@normaldot{.}
11458 @def@normalquest{?}
11459 @def@normalslash{/}
11461 % These look ok in all fonts, so just make them not special.
11462 % @hashchar{} gets its own user-level command, because of #line.
11463 @catcode`@& = @other @def@normalamp{&}
11464 @catcode`@# = @other @def@normalhash{#}
11465 @catcode`@% = @other @def@normalpercent{%}
11467 @let @hashchar = @normalhash
11469 @c Finally, make ` and ' active, so that txicodequoteundirected and
11470 @c txicodequotebacktick work right in, e.g., @w{@code{`foo'}}. If we
11471 @c don't make ` and ' active, @code will not get them as active chars.
11472 @c Do this last of all since we use ` in the previous @catcode assignments.
11473 @catcode`@'=@active
11474 @catcode`@`=@active
11475 @markupsetuplqdefault
11476 @markupsetuprqdefault
11478 @c Local variables:
11479 @c eval: (add-hook 'write-file-hooks 'time-stamp)
11480 @c page-delimiter: "^\\\\message\\|emacs-page"
11481 @c time-stamp-start: "def\\\\texinfoversion{"
11482 @c time-stamp-format: "%:y-%02m-%02d.%02H"
11483 @c time-stamp-end: "}"
11484 @c End:
11486 @c vim:sw=2:
11488 @ignore
11489 arch-tag: e1b36e32-c96e-4135-a41a-0b2efa2ea115
11490 @end ignore
11491 @enablebackslashhack