3 |
% Load plain if necessary, i.e., if running under initex. |
% Load plain if necessary, i.e., if running under initex. |
4 |
\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi |
\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi |
5 |
% |
% |
6 |
\def\texinfoversion{1999-01-05}% |
\def\texinfoversion{1999-09-25.10} |
7 |
% |
% |
8 |
% Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98 |
% Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99 |
9 |
% Free Software Foundation, Inc. |
% Free Software Foundation, Inc. |
10 |
% |
% |
11 |
% This texinfo.tex file is free software; you can redistribute it and/or |
% This texinfo.tex file is free software; you can redistribute it and/or |
29 |
% |
% |
30 |
% Please try the latest version of texinfo.tex before submitting bug |
% Please try the latest version of texinfo.tex before submitting bug |
31 |
% reports; you can get the latest version from: |
% reports; you can get the latest version from: |
32 |
% ftp://ftp.gnu.org/pub/gnu/texinfo.tex |
% ftp://ftp.gnu.org/gnu/texinfo.tex |
|
% /home/gd/gnu/doc/texinfo.tex on the GNU machines. |
|
33 |
% (and all GNU mirrors, see http://www.gnu.org/order/ftp.html) |
% (and all GNU mirrors, see http://www.gnu.org/order/ftp.html) |
34 |
% ftp://tug.org/tex/texinfo.tex |
% ftp://texinfo.org/tex/texinfo.tex |
35 |
% ftp://ctan.org/macros/texinfo/texinfo.tex |
% ftp://us.ctan.org/macros/texinfo/texinfo.tex |
36 |
% (and all CTAN mirrors, finger ctan@ctan.org for a list). |
% (and all CTAN mirrors, finger ctan@us.ctan.org for a list). |
37 |
% The texinfo.tex in the texinfo distribution itself could well be out |
% /home/gd/gnu/doc/texinfo.tex on the GNU machines. |
38 |
|
% The texinfo.tex in any given Texinfo distribution could well be out |
39 |
% of date, so if that's what you're using, please check. |
% of date, so if that's what you're using, please check. |
40 |
% |
% Texinfo has a small home page at http://texinfo.org/. |
41 |
% Send bug reports to bug-texinfo@gnu.org. |
% |
42 |
% Please include a precise test case in each bug report, |
% Send bug reports to bug-texinfo@gnu.org. Please include including a |
43 |
% including a complete document with which we can reproduce the problem. |
% complete document in each bug report with which we can reproduce the |
44 |
% |
% problem. Patches are, of course, greatly appreciated. |
45 |
|
% |
46 |
% To process a Texinfo manual with TeX, it's most reliable to use the |
% To process a Texinfo manual with TeX, it's most reliable to use the |
47 |
% texi2dvi shell script that comes with the distribution. For simple |
% texi2dvi shell script that comes with the distribution. For a simple |
48 |
% manuals, however, you can get away with: |
% manual foo.texi, however, you can get away with this: |
49 |
% tex foo.texi |
% tex foo.texi |
50 |
% texindex foo.?? |
% texindex foo.?? |
51 |
% tex foo.texi |
% tex foo.texi |
52 |
% tex foo.texi |
% tex foo.texi |
53 |
% dvips foo.dvi -o # or whatever, to process the dvi file. |
% dvips foo.dvi -o # or whatever, to process the dvi file; this makes foo.ps. |
54 |
% The extra runs of TeX get the cross-reference information correct. |
% The extra runs of TeX get the cross-reference information correct. |
55 |
% Sometimes one run after texindex suffices, and sometimes you need more |
% Sometimes one run after texindex suffices, and sometimes you need more |
56 |
% than two; texi2dvi does it as many times as necessary. |
% than two; texi2dvi does it as many times as necessary. |
57 |
|
% |
58 |
|
% It is possible to adapt texinfo.tex for other languages. You can get |
59 |
|
% the existing language-specific files from ftp://ftp.gnu.org/gnu/texinfo/. |
60 |
|
|
61 |
\message{Loading texinfo [version \texinfoversion]:} |
\message{Loading texinfo [version \texinfoversion]:} |
62 |
|
|
67 |
\catcode`+=\active \catcode`\_=\active} |
\catcode`+=\active \catcode`\_=\active} |
68 |
|
|
69 |
% Save some parts of plain tex whose names we will redefine. |
% Save some parts of plain tex whose names we will redefine. |
|
|
|
70 |
\let\ptexb=\b |
\let\ptexb=\b |
71 |
\let\ptexbullet=\bullet |
\let\ptexbullet=\bullet |
72 |
\let\ptexc=\c |
\let\ptexc=\c |
86 |
% For @tex, we can use \tabalign. |
% For @tex, we can use \tabalign. |
87 |
\let\+ = \relax |
\let\+ = \relax |
88 |
|
|
|
|
|
89 |
\message{Basics,} |
\message{Basics,} |
90 |
\chardef\other=12 |
\chardef\other=12 |
91 |
|
|
94 |
\newlinechar = `^^J |
\newlinechar = `^^J |
95 |
|
|
96 |
% Set up fixed words for English if not already set. |
% Set up fixed words for English if not already set. |
97 |
\ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi |
\ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi |
98 |
\ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi |
\ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi |
99 |
\ifx\putwordfile\undefined \gdef\putwordfile{file}\fi |
\ifx\putwordfile\undefined \gdef\putwordfile{file}\fi |
100 |
\ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi |
\ifx\putwordin\undefined \gdef\putwordin{in}\fi |
101 |
\ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi |
\ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi |
102 |
\ifx\putwordon\undefined \gdef\putwordon{on}\fi |
\ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi |
103 |
\ifx\putwordpage\undefined \gdef\putwordpage{page}\fi |
\ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi |
104 |
\ifx\putwordsection\undefined \gdef\putwordsection{section}\fi |
\ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi |
105 |
\ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi |
\ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi |
106 |
\ifx\putwordsee\undefined \gdef\putwordsee{see}\fi |
\ifx\putwordNoTitle\undefined \gdef\putwordNoTitle{No Title}\fi |
107 |
\ifx\putwordSee\undefined \gdef\putwordSee{See}\fi |
\ifx\putwordof\undefined \gdef\putwordof{of}\fi |
108 |
\ifx\putwordShortContents\undefined \gdef\putwordShortContents{Short Contents}\fi |
\ifx\putwordon\undefined \gdef\putwordon{on}\fi |
109 |
\ifx\putwordTableofContents\undefined\gdef\putwordTableofContents{Table of Contents}\fi |
\ifx\putwordpage\undefined \gdef\putwordpage{page}\fi |
110 |
|
\ifx\putwordsection\undefined \gdef\putwordsection{section}\fi |
111 |
|
\ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi |
112 |
|
\ifx\putwordsee\undefined \gdef\putwordsee{see}\fi |
113 |
|
\ifx\putwordSee\undefined \gdef\putwordSee{See}\fi |
114 |
|
\ifx\putwordShortTOC\undefined \gdef\putwordShortTOC{Short Contents}\fi |
115 |
|
\ifx\putwordTOC\undefined \gdef\putwordTOC{Table of Contents}\fi |
116 |
|
% |
117 |
|
\ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi |
118 |
|
\ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi |
119 |
|
\ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi |
120 |
|
\ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi |
121 |
|
\ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi |
122 |
|
\ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi |
123 |
|
\ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi |
124 |
|
\ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi |
125 |
|
\ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi |
126 |
|
\ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi |
127 |
|
\ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi |
128 |
|
\ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi |
129 |
|
% |
130 |
|
\ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro}\fi |
131 |
|
\ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi |
132 |
|
\ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi |
133 |
|
\ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi |
134 |
|
\ifx\putwordDeftypevar\undefined\gdef\putwordDeftypevar{Variable}\fi |
135 |
|
\ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi |
136 |
|
\ifx\putwordDeftypefun\undefined\gdef\putwordDeftypefun{Function}\fi |
137 |
|
|
138 |
% Ignore a token. |
% Ignore a token. |
139 |
% |
% |
172 |
|
|
173 |
% For @cropmarks command. |
% For @cropmarks command. |
174 |
% Do @cropmarks to get crop marks. |
% Do @cropmarks to get crop marks. |
175 |
% |
% |
176 |
\newif\ifcropmarks |
\newif\ifcropmarks |
177 |
\let\cropmarks = \cropmarkstrue |
\let\cropmarks = \cropmarkstrue |
178 |
% |
% |
243 |
\unvbox\footlinebox |
\unvbox\footlinebox |
244 |
\fi |
\fi |
245 |
% |
% |
246 |
|
\ifpdfmakepagedest \pdfmkdest{\the\pageno} \fi |
247 |
|
% |
248 |
\ifcropmarks |
\ifcropmarks |
249 |
\egroup % end of \vbox\bgroup |
\egroup % end of \vbox\bgroup |
250 |
\hfil\egroup % end of (centering) \line\bgroup |
\hfil\egroup % end of (centering) \line\bgroup |
599 |
%}} |
%}} |
600 |
|
|
601 |
\def\needx#1{% |
\def\needx#1{% |
602 |
% Go into vertical mode, so we don't make a big box in the middle of a |
% Ensure vertical mode, so we don't make a big box in the middle of a |
603 |
% paragraph. |
% paragraph. |
604 |
\par |
\par |
605 |
% |
% |
606 |
% Don't add any leading before our big empty box, but allow a page |
% If the @need value is less than one line space, it's useless. |
607 |
% break, since the best break might be right here. |
\dimen0 = #1\mil |
608 |
\allowbreak |
\dimen2 = \ht\strutbox |
609 |
\nointerlineskip |
\advance\dimen2 by \dp\strutbox |
610 |
\vtop to #1\mil{\vfil}% |
\ifdim\dimen0 > \dimen2 |
611 |
% |
% |
612 |
% TeX does not even consider page breaks if a penalty added to the |
% Do a \strut just to make the height of this box be normal, so the |
613 |
% main vertical list is 10000 or more. But in order to see if the |
% normal leading is inserted relative to the preceding line. |
614 |
% empty box we just added fits on the page, we must make it consider |
% And a page break here is fine. |
615 |
% page breaks. On the other hand, we don't want to actually break the |
\vtop to #1\mil{\strut\vfil}% |
616 |
% page after the empty box. So we use a penalty of 9999. |
% |
617 |
% |
% TeX does not even consider page breaks if a penalty added to the |
618 |
% There is an extremely small chance that TeX will actually break the |
% main vertical list is 10000 or more. But in order to see if the |
619 |
% page at this \penalty, if there are no other feasible breakpoints in |
% empty box we just added fits on the page, we must make it consider |
620 |
% sight. (If the user is using lots of big @group commands, which |
% page breaks. On the other hand, we don't want to actually break the |
621 |
% almost-but-not-quite fill up a page, TeX will have a hard time doing |
% page after the empty box. So we use a penalty of 9999. |
622 |
% good page breaking, for example.) However, I could not construct an |
% |
623 |
% example where a page broke at this \penalty; if it happens in a real |
% There is an extremely small chance that TeX will actually break the |
624 |
% document, then we can reconsider our strategy. |
% page at this \penalty, if there are no other feasible breakpoints in |
625 |
\penalty9999 |
% sight. (If the user is using lots of big @group commands, which |
626 |
% |
% almost-but-not-quite fill up a page, TeX will have a hard time doing |
627 |
% Back up by the size of the box, whether we did a page break or not. |
% good page breaking, for example.) However, I could not construct an |
628 |
\kern -#1\mil |
% example where a page broke at this \penalty; if it happens in a real |
629 |
% |
% document, then we can reconsider our strategy. |
630 |
% Do not allow a page break right after this kern. |
\penalty9999 |
631 |
\nobreak |
% |
632 |
|
% Back up by the size of the box, whether we did a page break or not. |
633 |
|
\kern -#1\mil |
634 |
|
% |
635 |
|
% Do not allow a page break right after this kern. |
636 |
|
\nobreak |
637 |
|
\fi |
638 |
} |
} |
639 |
|
|
640 |
% @br forces paragraph break |
% @br forces paragraph break |
655 |
} |
} |
656 |
|
|
657 |
% @enddots{} is an end-of-sentence ellipsis. |
% @enddots{} is an end-of-sentence ellipsis. |
658 |
% |
% |
659 |
\def\enddots{% |
\def\enddots{% |
660 |
\leavevmode |
\leavevmode |
661 |
\hbox to 2em{% |
\hbox to 2em{% |
742 |
|
|
743 |
\let\c=\comment |
\let\c=\comment |
744 |
|
|
745 |
% @paragraphindent is defined for the Info formatting commands only. |
% @paragraphindent NCHARS |
746 |
\let\paragraphindent=\comment |
% We'll use ems for NCHARS, close enough. |
747 |
|
% We cannot implement @paragraphindent asis, though. |
|
% Prevent errors for section commands. |
|
|
% Used in @ignore and in failing conditionals. |
|
|
\def\ignoresections{% |
|
|
\let\chapter=\relax |
|
|
\let\unnumbered=\relax |
|
|
\let\top=\relax |
|
|
\let\unnumberedsec=\relax |
|
|
\let\unnumberedsection=\relax |
|
|
\let\unnumberedsubsec=\relax |
|
|
\let\unnumberedsubsection=\relax |
|
|
\let\unnumberedsubsubsec=\relax |
|
|
\let\unnumberedsubsubsection=\relax |
|
|
\let\section=\relax |
|
|
\let\subsec=\relax |
|
|
\let\subsubsec=\relax |
|
|
\let\subsection=\relax |
|
|
\let\subsubsection=\relax |
|
|
\let\appendix=\relax |
|
|
\let\appendixsec=\relax |
|
|
\let\appendixsection=\relax |
|
|
\let\appendixsubsec=\relax |
|
|
\let\appendixsubsection=\relax |
|
|
\let\appendixsubsubsec=\relax |
|
|
\let\appendixsubsubsection=\relax |
|
|
\let\contents=\relax |
|
|
\let\smallbook=\relax |
|
|
\let\titlepage=\relax |
|
|
} |
|
|
|
|
|
% Used in nested conditionals, where we have to parse the Texinfo source |
|
|
% and so want to turn off most commands, in case they are used |
|
|
% incorrectly. |
|
|
% |
|
|
\def\ignoremorecommands{% |
|
|
\let\defcodeindex = \relax |
|
|
\let\defcv = \relax |
|
|
\let\deffn = \relax |
|
|
\let\deffnx = \relax |
|
|
\let\defindex = \relax |
|
|
\let\defivar = \relax |
|
|
\let\defmac = \relax |
|
|
\let\defmethod = \relax |
|
|
\let\defop = \relax |
|
|
\let\defopt = \relax |
|
|
\let\defspec = \relax |
|
|
\let\deftp = \relax |
|
|
\let\deftypefn = \relax |
|
|
\let\deftypefun = \relax |
|
|
\let\deftypevar = \relax |
|
|
\let\deftypevr = \relax |
|
|
\let\defun = \relax |
|
|
\let\defvar = \relax |
|
|
\let\defvr = \relax |
|
|
\let\ref = \relax |
|
|
\let\xref = \relax |
|
|
\let\printindex = \relax |
|
|
\let\pxref = \relax |
|
|
\let\settitle = \relax |
|
|
\let\setchapternewpage = \relax |
|
|
\let\setchapterstyle = \relax |
|
|
\let\everyheading = \relax |
|
|
\let\evenheading = \relax |
|
|
\let\oddheading = \relax |
|
|
\let\everyfooting = \relax |
|
|
\let\evenfooting = \relax |
|
|
\let\oddfooting = \relax |
|
|
\let\headings = \relax |
|
|
\let\include = \relax |
|
|
\let\lowersections = \relax |
|
|
\let\down = \relax |
|
|
\let\raisesections = \relax |
|
|
\let\up = \relax |
|
|
\let\set = \relax |
|
|
\let\clear = \relax |
|
|
\let\item = \relax |
|
|
} |
|
|
|
|
|
% Ignore @ignore ... @end ignore. |
|
|
% |
|
|
\def\ignore{\doignore{ignore}} |
|
|
|
|
|
% Ignore @ifinfo, @ifhtml, @ifnottex, @html, @menu, and @direntry text. |
|
|
% |
|
|
\def\ifinfo{\doignore{ifinfo}} |
|
|
\def\ifhtml{\doignore{ifhtml}} |
|
|
\def\ifnottex{\doignore{ifnottex}} |
|
|
\def\html{\doignore{html}} |
|
|
\def\menu{\doignore{menu}} |
|
|
\def\direntry{\doignore{direntry}} |
|
|
|
|
|
% @dircategory CATEGORY -- specify a category of the dir file |
|
|
% which this file should belong to. Ignore this in TeX. |
|
|
\let\dircategory = \comment |
|
|
|
|
|
% Ignore text until a line `@end #1'. |
|
|
% |
|
|
\def\doignore#1{\begingroup |
|
|
% Don't complain about control sequences we have declared \outer. |
|
|
\ignoresections |
|
|
% |
|
|
% Define a command to swallow text until we reach `@end #1'. |
|
|
% This @ is a catcode 12 token (that is the normal catcode of @ in |
|
|
% this texinfo.tex file). We change the catcode of @ below to match. |
|
|
\long\def\doignoretext##1@end #1{\enddoignore}% |
|
|
% |
|
|
% Make sure that spaces turn into tokens that match what \doignoretext wants. |
|
|
\catcode32 = 10 |
|
|
% |
|
|
% Ignore braces, too, so mismatched braces don't cause trouble. |
|
|
\catcode`\{ = 9 |
|
|
\catcode`\} = 9 |
|
|
% |
|
|
% We must not have @c interpreted as a control sequence. |
|
|
\catcode`\@ = 12 |
|
|
% |
|
|
% Make the letter c a comment character so that the rest of the line |
|
|
% will be ignored. This way, the document can have (for example) |
|
|
% @c @end ifinfo |
|
|
% and the @end ifinfo will be properly ignored. |
|
|
% (We've just changed @ to catcode 12.) |
|
|
\catcode`\c = 14 |
|
|
% |
|
|
% And now expand that command. |
|
|
\doignoretext |
|
|
} |
|
|
|
|
|
% What we do to finish off ignored text. |
|
|
% |
|
|
\def\enddoignore{\endgroup\ignorespaces}% |
|
|
|
|
|
\newif\ifwarnedobs\warnedobsfalse |
|
|
\def\obstexwarn{% |
|
|
\ifwarnedobs\relax\else |
|
|
% We need to warn folks that they may have trouble with TeX 3.0. |
|
|
% This uses \immediate\write16 rather than \message to get newlines. |
|
|
\immediate\write16{} |
|
|
\immediate\write16{***WARNING*** for users of Unix TeX 3.0!} |
|
|
\immediate\write16{This manual trips a bug in TeX version 3.0 (tex hangs).} |
|
|
\immediate\write16{If you are running another version of TeX, relax.} |
|
|
\immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.} |
|
|
\immediate\write16{ Then upgrade your TeX installation if you can.} |
|
|
\immediate\write16{ (See ftp://ftp.gnu.org/pub/gnu/TeX.README.)} |
|
|
\immediate\write16{If you are stuck with version 3.0, run the} |
|
|
\immediate\write16{ script ``tex3patch'' from the Texinfo distribution} |
|
|
\immediate\write16{ to use a workaround.} |
|
|
\immediate\write16{} |
|
|
\global\warnedobstrue |
|
|
\fi |
|
|
} |
|
|
|
|
|
% **In TeX 3.0, setting text in \nullfont hangs tex. For a |
|
|
% workaround (which requires the file ``dummy.tfm'' to be installed), |
|
|
% uncomment the following line: |
|
|
%%%%%\font\nullfont=dummy\let\obstexwarn=\relax |
|
|
|
|
|
% Ignore text, except that we keep track of conditional commands for |
|
|
% purposes of nesting, up to an `@end #1' command. |
|
|
% |
|
|
\def\nestedignore#1{% |
|
|
\obstexwarn |
|
|
% We must actually expand the ignored text to look for the @end |
|
|
% command, so that nested ignore constructs work. Thus, we put the |
|
|
% text into a \vbox and then do nothing with the result. To minimize |
|
|
% the change of memory overflow, we follow the approach outlined on |
|
|
% page 401 of the TeXbook: make the current font be a dummy font. |
|
|
% |
|
|
\setbox0 = \vbox\bgroup |
|
|
% Don't complain about control sequences we have declared \outer. |
|
|
\ignoresections |
|
|
% |
|
|
% Define `@end #1' to end the box, which will in turn undefine the |
|
|
% @end command again. |
|
|
\expandafter\def\csname E#1\endcsname{\egroup\ignorespaces}% |
|
|
% |
|
|
% We are going to be parsing Texinfo commands. Most cause no |
|
|
% trouble when they are used incorrectly, but some commands do |
|
|
% complicated argument parsing or otherwise get confused, so we |
|
|
% undefine them. |
|
|
% |
|
|
% We can't do anything about stray @-signs, unfortunately; |
|
|
% they'll produce `undefined control sequence' errors. |
|
|
\ignoremorecommands |
|
|
% |
|
|
% Set the current font to be \nullfont, a TeX primitive, and define |
|
|
% all the font commands to also use \nullfont. We don't use |
|
|
% dummy.tfm, as suggested in the TeXbook, because not all sites |
|
|
% might have that installed. Therefore, math mode will still |
|
|
% produce output, but that should be an extremely small amount of |
|
|
% stuff compared to the main input. |
|
|
% |
|
|
\nullfont |
|
|
\let\tenrm = \nullfont \let\tenit = \nullfont \let\tensl = \nullfont |
|
|
\let\tenbf = \nullfont \let\tentt = \nullfont \let\smallcaps = \nullfont |
|
|
\let\tensf = \nullfont |
|
|
% Similarly for index fonts (mostly for their use in |
|
|
% smallexample) |
|
|
\let\indrm = \nullfont \let\indit = \nullfont \let\indsl = \nullfont |
|
|
\let\indbf = \nullfont \let\indtt = \nullfont \let\indsc = \nullfont |
|
|
\let\indsf = \nullfont |
|
|
% |
|
|
% Don't complain when characters are missing from the fonts. |
|
|
\tracinglostchars = 0 |
|
|
% |
|
|
% Don't bother to do space factor calculations. |
|
|
\frenchspacing |
|
|
% |
|
|
% Don't report underfull hboxes. |
|
|
\hbadness = 10000 |
|
|
% |
|
|
% Do minimal line-breaking. |
|
|
\pretolerance = 10000 |
|
|
% |
|
|
% Do not execute instructions in @tex |
|
|
\def\tex{\doignore{tex}}% |
|
|
% Do not execute macro definitions. |
|
|
% `c' is a comment character, so the word `macro' will get cut off. |
|
|
\def\macro{\doignore{ma}}% |
|
|
} |
|
|
|
|
|
% @set VAR sets the variable VAR to an empty value. |
|
|
% @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE. |
|
|
% |
|
|
% Since we want to separate VAR from REST-OF-LINE (which might be |
|
|
% empty), we can't just use \parsearg; we have to insert a space of our |
|
|
% own to delimit the rest of the line, and then take it out again if we |
|
|
% didn't need it. Make sure the catcode of space is correct to avoid |
|
|
% losing inside @example, for instance. |
|
|
% |
|
|
\def\set{\begingroup\catcode` =10 |
|
|
\catcode`\-=12 \catcode`\_=12 % Allow - and _ in VAR. |
|
|
\parsearg\setxxx} |
|
|
\def\setxxx#1{\setyyy#1 \endsetyyy} |
|
|
\def\setyyy#1 #2\endsetyyy{% |
|
|
\def\temp{#2}% |
|
|
\ifx\temp\empty \global\expandafter\let\csname SET#1\endcsname = \empty |
|
|
\else \setzzz{#1}#2\endsetzzz % Remove the trailing space \setxxx inserted. |
|
|
\fi |
|
|
\endgroup |
|
|
} |
|
|
% Can't use \xdef to pre-expand #2 and save some time, since \temp or |
|
|
% \next or other control sequences that we've defined might get us into |
|
|
% an infinite loop. Consider `@set foo @cite{bar}'. |
|
|
\def\setzzz#1#2 \endsetzzz{\expandafter\gdef\csname SET#1\endcsname{#2}} |
|
|
|
|
|
% @clear VAR clears (i.e., unsets) the variable VAR. |
|
|
% |
|
|
\def\clear{\parsearg\clearxxx} |
|
|
\def\clearxxx#1{\global\expandafter\let\csname SET#1\endcsname=\relax} |
|
|
|
|
|
% @value{foo} gets the text saved in variable foo. |
|
|
% |
|
|
{ |
|
|
\catcode`\_ = \active |
|
|
% |
|
|
% We might end up with active _ or - characters in the argument if |
|
|
% we're called from @code, as @code{@value{foo-bar_}}. So \let any |
|
|
% such active characters to their normal equivalents. |
|
|
\gdef\value{\begingroup |
|
|
\catcode`\-=12 \catcode`\_=12 |
|
|
\indexbreaks \let_\normalunderscore |
|
|
\valuexxx} |
|
|
} |
|
|
\def\valuexxx#1{\expandablevalue{#1}\endgroup} |
|
|
|
|
|
% We have this subroutine so that we can handle at least some @value's |
|
|
% properly in indexes (we \let\value to this in \indexdummies). Ones |
|
|
% whose names contain - or _ still won't work, but we can't do anything |
|
|
% about that. The command has to be fully expandable, since the result |
|
|
% winds up in the index file. This means that if the variable's value |
|
|
% contains other Texinfo commands, it's almost certain it will fail |
|
|
% (although perhaps we could fix that with sufficient work to do a |
|
|
% one-level expansion on the result, instead of complete). |
|
748 |
% |
% |
749 |
\def\expandablevalue#1{% |
\def\asisword{asis} % no translation, these are keywords |
750 |
\expandafter\ifx\csname SET#1\endcsname\relax |
\def\noneword{none} |
|
{[No value for ``#1'']}% |
|
|
\else |
|
|
\csname SET#1\endcsname |
|
|
\fi |
|
|
} |
|
|
|
|
|
% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined |
|
|
% with @set. |
|
751 |
% |
% |
752 |
\def\ifset{\parsearg\ifsetxxx} |
\def\paragraphindent{\parsearg\doparagraphindent} |
753 |
\def\ifsetxxx #1{% |
\def\doparagraphindent#1{% |
754 |
\expandafter\ifx\csname SET#1\endcsname\relax |
\def\temp{#1}% |
755 |
\expandafter\ifsetfail |
\ifx\temp\asisword |
756 |
\else |
\else |
757 |
\expandafter\ifsetsucceed |
\ifx\temp\noneword |
758 |
|
\defaultparindent = 0pt |
759 |
|
\else |
760 |
|
\defaultparindent = #1em |
761 |
|
\fi |
762 |
\fi |
\fi |
763 |
|
\parindent = \defaultparindent |
764 |
} |
} |
|
\def\ifsetsucceed{\conditionalsucceed{ifset}} |
|
|
\def\ifsetfail{\nestedignore{ifset}} |
|
|
\defineunmatchedend{ifset} |
|
765 |
|
|
766 |
% @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been |
% @exampleindent NCHARS |
767 |
% defined with @set, or has been undefined with @clear. |
% We'll use ems for NCHARS like @paragraphindent. |
768 |
% |
% It seems @exampleindent asis isn't necessary, but |
769 |
\def\ifclear{\parsearg\ifclearxxx} |
% I preserve it to make it similar to @paragraphindent. |
770 |
\def\ifclearxxx #1{% |
\def\exampleindent{\parsearg\doexampleindent} |
771 |
\expandafter\ifx\csname SET#1\endcsname\relax |
\def\doexampleindent#1{% |
772 |
\expandafter\ifclearsucceed |
\def\temp{#1}% |
773 |
|
\ifx\temp\asisword |
774 |
\else |
\else |
775 |
\expandafter\ifclearfail |
\ifx\temp\noneword |
776 |
|
\lispnarrowing = 0pt |
777 |
|
\else |
778 |
|
\lispnarrowing = #1em |
779 |
|
\fi |
780 |
\fi |
\fi |
781 |
} |
} |
|
\def\ifclearsucceed{\conditionalsucceed{ifclear}} |
|
|
\def\ifclearfail{\nestedignore{ifclear}} |
|
|
\defineunmatchedend{ifclear} |
|
|
|
|
|
% @iftex, @ifnothtml, @ifnotinfo always succeed; we read the text |
|
|
% following, through the first @end iftex (etc.). Make `@end iftex' |
|
|
% (etc.) valid only after an @iftex. |
|
|
% |
|
|
\def\iftex{\conditionalsucceed{iftex}} |
|
|
\def\ifnothtml{\conditionalsucceed{ifnothtml}} |
|
|
\def\ifnotinfo{\conditionalsucceed{ifnotinfo}} |
|
|
\defineunmatchedend{iftex} |
|
|
\defineunmatchedend{ifnothtml} |
|
|
\defineunmatchedend{ifnotinfo} |
|
|
|
|
|
% We can't just want to start a group at @iftex (for example) and end it |
|
|
% at @end iftex, since then @set commands inside the conditional have no |
|
|
% effect (they'd get reverted at the end of the group). So we must |
|
|
% define \Eiftex to redefine itself to be its previous value. (We can't |
|
|
% just define it to fail again with an ``unmatched end'' error, since |
|
|
% the @ifset might be nested.) |
|
|
% |
|
|
\def\conditionalsucceed#1{% |
|
|
\edef\temp{% |
|
|
% Remember the current value of \E#1. |
|
|
\let\nece{prevE#1} = \nece{E#1}% |
|
|
% |
|
|
% At the `@end #1', redefine \E#1 to be its previous value. |
|
|
\def\nece{E#1}{\let\nece{E#1} = \nece{prevE#1}}% |
|
|
}% |
|
|
\temp |
|
|
} |
|
|
|
|
|
% We need to expand lots of \csname's, but we don't want to expand the |
|
|
% control sequences after we've constructed them. |
|
|
% |
|
|
\def\nece#1{\expandafter\noexpand\csname#1\endcsname} |
|
782 |
|
|
783 |
% @asis just yields its argument. Used with @table, for example. |
% @asis just yields its argument. Used with @table, for example. |
784 |
% |
% |
815 |
% So open here the files we need to have open while reading the input. |
% So open here the files we need to have open while reading the input. |
816 |
% This makes it possible to make a .fmt file for texinfo. |
% This makes it possible to make a .fmt file for texinfo. |
817 |
\def\setfilename{% |
\def\setfilename{% |
818 |
\iflinks |
\iflinks |
819 |
\readauxfile |
\readauxfile |
820 |
\fi % \openindices needs to do some work in any case. |
\fi % \openindices needs to do some work in any case. |
821 |
\openindices |
\openindices |
834 |
} |
} |
835 |
|
|
836 |
% Called from \setfilename. |
% Called from \setfilename. |
837 |
% |
% |
838 |
\def\openindices{% |
\def\openindices{% |
839 |
\newindex{cp}% |
\newindex{cp}% |
840 |
\newcodeindex{fn}% |
\newcodeindex{fn}% |
848 |
\outer\def\bye{\pagealignmacro\tracingstats=1\ptexend} |
\outer\def\bye{\pagealignmacro\tracingstats=1\ptexend} |
849 |
|
|
850 |
|
|
851 |
|
\message{pdf,} |
852 |
|
% adobe `portable' document format |
853 |
|
\newcount\tempnum |
854 |
|
\newcount\lnkcount |
855 |
|
\newtoks\filename |
856 |
|
\newcount\filenamelength |
857 |
|
\newcount\pgn |
858 |
|
\newtoks\toksA |
859 |
|
\newtoks\toksB |
860 |
|
\newtoks\toksC |
861 |
|
\newtoks\toksD |
862 |
|
\newbox\boxA |
863 |
|
\newcount\countA |
864 |
|
\newif\ifpdf |
865 |
|
\newif\ifpdfmakepagedest |
866 |
|
|
867 |
|
\ifx\pdfoutput\undefined |
868 |
|
\pdffalse |
869 |
|
\let\pdfmkdest = \gobble |
870 |
|
\let\pdfurl = \gobble |
871 |
|
\let\endlink = \relax |
872 |
|
\let\linkcolor = \relax |
873 |
|
\let\pdfmakeoutlines = \relax |
874 |
|
\else |
875 |
|
\pdftrue |
876 |
|
\pdfoutput = 1 |
877 |
|
\input pdfcolor |
878 |
|
\def\dopdfimage#1#2#3{% |
879 |
|
\def\imagewidth{#2}% |
880 |
|
\def\imageheight{#3}% |
881 |
|
\ifnum\pdftexversion < 14 |
882 |
|
\pdfimage |
883 |
|
\else |
884 |
|
\pdfximage |
885 |
|
\fi |
886 |
|
\ifx\empty\imagewidth\else width \imagewidth \fi |
887 |
|
\ifx\empty\imageheight\else height \imageheight \fi |
888 |
|
{#1.pdf}% |
889 |
|
\ifnum\pdftexversion < 14 \else |
890 |
|
\pdfrefximage \pdflastximage |
891 |
|
\fi} |
892 |
|
\def\pdfmkdest#1{\pdfdest name{#1@} xyz} |
893 |
|
\def\pdfmkpgn#1{#1@} |
894 |
|
\let\linkcolor = \Cyan |
895 |
|
\def\endlink{\Black\pdfendlink} |
896 |
|
% Adding outlines to PDF; macros for calculating structure of outlines |
897 |
|
% come from Petr Olsak |
898 |
|
\def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0% |
899 |
|
\else \csname#1\endcsname \fi} |
900 |
|
\def\advancenumber#1{\tempnum=\expnumber{#1}\relax |
901 |
|
\advance\tempnum by1 |
902 |
|
\expandafter\xdef\csname#1\endcsname{\the\tempnum}} |
903 |
|
\def\pdfmakeoutlines{{% |
904 |
|
\openin 1 \jobname.toc |
905 |
|
\ifeof 1\else\bgroup |
906 |
|
\closein 1 |
907 |
|
\indexnofonts |
908 |
|
\def\tt{} |
909 |
|
% thanh's hack / proper braces in bookmarks |
910 |
|
\edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace |
911 |
|
\edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace |
912 |
|
% |
913 |
|
\def\chapentry ##1##2##3{} |
914 |
|
\def\unnumbchapentry ##1##2{} |
915 |
|
\def\secentry ##1##2##3##4{\advancenumber{chap##2}} |
916 |
|
\def\unnumbsecentry ##1##2{} |
917 |
|
\def\subsecentry ##1##2##3##4##5{\advancenumber{sec##2.##3}} |
918 |
|
\def\unnumbsubsecentry ##1##2{} |
919 |
|
\def\subsubsecentry ##1##2##3##4##5##6{\advancenumber{subsec##2.##3.##4}} |
920 |
|
\def\unnumbsubsubsecentry ##1##2{} |
921 |
|
\input \jobname.toc |
922 |
|
\def\chapentry ##1##2##3{% |
923 |
|
\pdfoutline goto name{\pdfmkpgn{##3}}count-\expnumber{chap##2}{##1}} |
924 |
|
\def\unnumbchapentry ##1##2{% |
925 |
|
\pdfoutline goto name{\pdfmkpgn{##2}}{##1}} |
926 |
|
\def\secentry ##1##2##3##4{% |
927 |
|
\pdfoutline goto name{\pdfmkpgn{##4}}count-\expnumber{sec##2.##3}{##1}} |
928 |
|
\def\unnumbsecentry ##1##2{% |
929 |
|
\pdfoutline goto name{\pdfmkpgn{##2}}{##1}} |
930 |
|
\def\subsecentry ##1##2##3##4##5{% |
931 |
|
\pdfoutline goto name{\pdfmkpgn{##5}}count-\expnumber{subsec##2.##3.##4}{##1}} |
932 |
|
\def\unnumbsubsecentry ##1##2{% |
933 |
|
\pdfoutline goto name{\pdfmkpgn{##2}}{##1}} |
934 |
|
\def\subsubsecentry ##1##2##3##4##5##6{% |
935 |
|
\pdfoutline goto name{\pdfmkpgn{##6}}{##1}} |
936 |
|
\def\unnumbsubsubsecentry ##1##2{% |
937 |
|
\pdfoutline goto name{\pdfmkpgn{##2}}{##1}} |
938 |
|
\input \jobname.toc |
939 |
|
\egroup\fi |
940 |
|
}} |
941 |
|
\def\makelinks #1,{% |
942 |
|
\def\params{#1}\def\E{END}% |
943 |
|
\ifx\params\E |
944 |
|
\let\nextmakelinks=\relax |
945 |
|
\else |
946 |
|
\let\nextmakelinks=\makelinks |
947 |
|
\ifnum\lnkcount>0,\fi |
948 |
|
\picknum{#1}% |
949 |
|
\startlink attr{/Border [0 0 0]} |
950 |
|
goto name{\pdfmkpgn{\the\pgn}}% |
951 |
|
\linkcolor #1% |
952 |
|
\advance\lnkcount by 1% |
953 |
|
\endlink |
954 |
|
\fi |
955 |
|
\nextmakelinks |
956 |
|
} |
957 |
|
\def\picknum#1{\expandafter\pn#1} |
958 |
|
\def\pn#1{% |
959 |
|
\def\p{#1}% |
960 |
|
\ifx\p\lbrace |
961 |
|
\let\nextpn=\ppn |
962 |
|
\else |
963 |
|
\let\nextpn=\ppnn |
964 |
|
\def\first{#1} |
965 |
|
\fi |
966 |
|
\nextpn |
967 |
|
} |
968 |
|
\def\ppn#1{\pgn=#1\gobble} |
969 |
|
\def\ppnn{\pgn=\first} |
970 |
|
\def\pdfmklnk#1{\lnkcount=0\makelinks #1,END,} |
971 |
|
\def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} |
972 |
|
\def\skipspaces#1{\def\PP{#1}\def\D{|}% |
973 |
|
\ifx\PP\D\let\nextsp\relax |
974 |
|
\else\let\nextsp\skipspaces |
975 |
|
\ifx\p\space\else\addtokens{\filename}{\PP}% |
976 |
|
\advance\filenamelength by 1 |
977 |
|
\fi |
978 |
|
\fi |
979 |
|
\nextsp} |
980 |
|
\def\getfilename#1{\filenamelength=0\expandafter\skipspaces#1|\relax} |
981 |
|
\ifnum\pdftexversion < 14 |
982 |
|
\let \startlink \pdfannotlink |
983 |
|
\else |
984 |
|
\let \startlink \pdfstartlink |
985 |
|
\fi |
986 |
|
\def\pdfurl#1{% |
987 |
|
\begingroup |
988 |
|
\normalturnoffactive\def\@{@}% |
989 |
|
\leavevmode\Red |
990 |
|
\startlink attr{/Border [0 0 0]}% |
991 |
|
user{/Subtype /Link /A << /S /URI /URI (#1) >>}% |
992 |
|
% #1 |
993 |
|
\endgroup} |
994 |
|
\def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}} |
995 |
|
\def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} |
996 |
|
\def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks} |
997 |
|
\def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}} |
998 |
|
\def\maketoks{% |
999 |
|
\expandafter\poptoks\the\toksA|ENDTOKS| |
1000 |
|
\ifx\first0\adn0 |
1001 |
|
\else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3 |
1002 |
|
\else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6 |
1003 |
|
\else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9 |
1004 |
|
\else |
1005 |
|
\ifnum0=\countA\else\makelink\fi |
1006 |
|
\ifx\first.\let\next=\done\else |
1007 |
|
\let\next=\maketoks |
1008 |
|
\addtokens{\toksB}{\the\toksD} |
1009 |
|
\ifx\first,\addtokens{\toksB}{\space}\fi |
1010 |
|
\fi |
1011 |
|
\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi |
1012 |
|
\next} |
1013 |
|
\def\makelink{\addtokens{\toksB}% |
1014 |
|
{\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0} |
1015 |
|
\def\pdflink#1{% |
1016 |
|
\startlink attr{/Border [0 0 0]} goto name{\mkpgn{#1}} |
1017 |
|
\linkcolor #1\endlink} |
1018 |
|
\def\mkpgn#1{#1@} |
1019 |
|
\def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} |
1020 |
|
\fi % \ifx\pdfoutput |
1021 |
|
|
1022 |
|
|
1023 |
\message{fonts,} |
\message{fonts,} |
1024 |
% Font-change commands. |
% Font-change commands. |
1025 |
|
|
1089 |
\setfont\deftt\ttshape{10}{\magstep1} |
\setfont\deftt\ttshape{10}{\magstep1} |
1090 |
\def\df{\let\tentt=\deftt \let\tenbf = \defbf \bf} |
\def\df{\let\tentt=\deftt \let\tenbf = \defbf \bf} |
1091 |
|
|
1092 |
% Fonts for indices and small examples (9pt). |
% Fonts for indices, footnotes, small examples (9pt). |
1093 |
% We actually use the slanted font rather than the italic, |
\setfont\smallrm\rmshape{9}{1000} |
1094 |
% because texinfo normally uses the slanted fonts for that. |
\setfont\smalltt\ttshape{9}{1000} |
1095 |
% Do not make many font distinctions in general in the index, since they |
\setfont\smallbf\bfshape{10}{900} |
1096 |
% aren't very useful. |
\setfont\smallit\itshape{9}{1000} |
1097 |
\setfont\ninett\ttshape{9}{1000} |
\setfont\smallsl\slshape{9}{1000} |
1098 |
\setfont\ninettsl\ttslshape{10}{900} |
\setfont\smallsf\sfshape{9}{1000} |
1099 |
\setfont\indrm\rmshape{9}{1000} |
\setfont\smallsc\scshape{10}{900} |
1100 |
\setfont\indit\itshape{9}{1000} |
\setfont\smallttsl\ttslshape{10}{900} |
1101 |
\setfont\indsl\slshape{9}{1000} |
\font\smalli=cmmi9 |
1102 |
\let\indtt=\ninett |
\font\smallsy=cmsy9 |
|
\let\indttsl=\ninettsl |
|
|
\let\indsf=\indrm |
|
|
\let\indbf=\indrm |
|
|
\setfont\indsc\scshape{10}{900} |
|
|
\font\indi=cmmi9 |
|
|
\font\indsy=cmsy9 |
|
1103 |
|
|
1104 |
% Fonts for title page: |
% Fonts for title page: |
1105 |
\setfont\titlerm\rmbshape{12}{\magstep3} |
\setfont\titlerm\rmbshape{12}{\magstep3} |
1213 |
\let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy \let\tenttsl=\ssecttsl |
\let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy \let\tenttsl=\ssecttsl |
1214 |
\resetmathfonts \setleading{15pt}} |
\resetmathfonts \setleading{15pt}} |
1215 |
\let\subsubsecfonts = \subsecfonts % Maybe make sssec fonts scaled magstephalf? |
\let\subsubsecfonts = \subsecfonts % Maybe make sssec fonts scaled magstephalf? |
1216 |
\def\indexfonts{% |
\def\smallfonts{% |
1217 |
\let\tenrm=\indrm \let\tenit=\indit \let\tensl=\indsl |
\let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl |
1218 |
\let\tenbf=\indbf \let\tentt=\indtt \let\smallcaps=\indsc |
\let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc |
1219 |
\let\tensf=\indsf \let\teni=\indi \let\tensy=\indsy \let\tenttsl=\indttsl |
\let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy |
1220 |
\resetmathfonts \setleading{12pt}} |
\let\tenttsl=\smallttsl |
1221 |
|
\resetmathfonts \setleading{11pt}} |
1222 |
|
|
1223 |
% Set up the default fonts, so we can use them for creating boxes. |
% Set up the default fonts, so we can use them for creating boxes. |
1224 |
% |
% |
1267 |
} |
} |
1268 |
\let\ttfont=\t |
\let\ttfont=\t |
1269 |
\def\samp#1{`\tclose{#1}'\null} |
\def\samp#1{`\tclose{#1}'\null} |
1270 |
\setfont\smallrm\rmshape{8}{1000} |
\setfont\keyrm\rmshape{8}{1000} |
1271 |
\font\smallsy=cmsy9 |
\font\keysy=cmsy9 |
1272 |
\def\key#1{{\smallrm\textfont2=\smallsy \leavevmode\hbox{% |
\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{% |
1273 |
\raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{% |
\raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{% |
1274 |
\vbox{\hrule\kern-0.4pt |
\vbox{\hrule\kern-0.4pt |
1275 |
\hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}% |
\hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}% |
1373 |
\let\env=\code |
\let\env=\code |
1374 |
\let\command=\code |
\let\command=\code |
1375 |
|
|
1376 |
% @uref (abbreviation for `urlref') takes an optional second argument |
% @uref (abbreviation for `urlref') takes an optional (comma-separated) |
1377 |
% specifying the text to display. First (mandatory) arg is the url. |
% second argument specifying the text to display and an optional third |
1378 |
% Perhaps eventually put in a hypertex \special here. |
% arg as text to display instead of (rather than in addition to) the url |
1379 |
% |
% itself. First (mandatory) arg is the url. Perhaps eventually put in |
1380 |
\def\uref#1{\urefxxx #1,,\finish} |
% a hypertex \special here. |
1381 |
\def\urefxxx#1,#2,#3\finish{% |
% |
1382 |
\setbox0 = \hbox{\ignorespaces #2}% |
\def\uref#1{\douref #1,,,\finish} |
1383 |
|
\def\douref#1,#2,#3,#4\finish{\begingroup |
1384 |
|
\unsepspaces |
1385 |
|
\pdfurl{#1}% |
1386 |
|
\setbox0 = \hbox{\ignorespaces #3}% |
1387 |
\ifdim\wd0 > 0pt |
\ifdim\wd0 > 0pt |
1388 |
\unhbox0\ (\code{#1})% |
\unhbox0 % third arg given, show only that |
1389 |
\else |
\else |
1390 |
\code{#1}% |
\setbox0 = \hbox{\ignorespaces #2}% |
1391 |
|
\ifdim\wd0 > 0pt |
1392 |
|
\ifpdf |
1393 |
|
\unhbox0 % PDF: 2nd arg given, show only it |
1394 |
|
\else |
1395 |
|
\unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url |
1396 |
|
\fi |
1397 |
|
\else |
1398 |
|
\code{#1}% only url given, so show it |
1399 |
|
\fi |
1400 |
\fi |
\fi |
1401 |
} |
\endlink |
1402 |
|
\endgroup} |
1403 |
|
|
1404 |
% rms does not like the angle brackets --karl, 17may97. |
% rms does not like angle brackets --karl, 17may97. |
1405 |
% So now @email is just like @uref. |
% So now @email is just like @uref, unless we are pdf. |
1406 |
|
% |
1407 |
%\def\email#1{\angleleft{\tt #1}\angleright} |
%\def\email#1{\angleleft{\tt #1}\angleright} |
1408 |
\let\email=\uref |
\ifpdf |
1409 |
|
\def\email#1{\doemail#1,,\finish} |
1410 |
|
\def\doemail#1,#2,#3\finish{\begingroup |
1411 |
|
\unsepspaces |
1412 |
|
\pdfurl{mailto:#1}% |
1413 |
|
\setbox0 = \hbox{\ignorespaces #2}% |
1414 |
|
\ifdim\wd0>0pt\unhbox0\else\code{#1}\fi |
1415 |
|
\endlink |
1416 |
|
\endgroup} |
1417 |
|
\else |
1418 |
|
\let\email=\uref |
1419 |
|
\fi |
1420 |
|
|
1421 |
% Check if we are currently using a typewriter font. Since all the |
% Check if we are currently using a typewriter font. Since all the |
1422 |
% Computer Modern typewriter fonts have zero interword stretch (and |
% Computer Modern typewriter fonts have zero interword stretch (and |
1460 |
|
|
1461 |
% Do an implicit @contents or @shortcontents after @end titlepage if the |
% Do an implicit @contents or @shortcontents after @end titlepage if the |
1462 |
% user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage. |
% user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage. |
1463 |
% |
% |
1464 |
\newif\ifsetcontentsaftertitlepage |
\newif\ifsetcontentsaftertitlepage |
1465 |
\let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue |
\let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue |
1466 |
\newif\ifsetshortcontentsaftertitlepage |
\newif\ifsetshortcontentsaftertitlepage |
1535 |
\global\let\shortcontents = \relax |
\global\let\shortcontents = \relax |
1536 |
\fi |
\fi |
1537 |
% |
% |
1538 |
|
\ifpdf \pdfmakepagedesttrue \fi |
1539 |
|
% |
1540 |
\HEADINGSon |
\HEADINGSon |
1541 |
} |
} |
1542 |
|
|
1671 |
|
|
1672 |
% Subroutines used in generating headings |
% Subroutines used in generating headings |
1673 |
% Produces Day Month Year style of output. |
% Produces Day Month Year style of output. |
1674 |
\def\today{\number\day\space |
\def\today{% |
1675 |
\ifcase\month\or |
\number\day\space |
1676 |
January\or February\or March\or April\or May\or June\or |
\ifcase\month |
1677 |
July\or August\or September\or October\or November\or December\fi |
\or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr |
1678 |
\space\number\year} |
\or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug |
1679 |
|
\or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec |
1680 |
% Use this if you want the Month Day, Year style of output. |
\fi |
1681 |
%\def\today{\ifcase\month\or |
\space\number\year} |
|
%January\or February\or March\or April\or May\or June\or |
|
|
%July\or August\or September\or October\or November\or December\fi |
|
|
%\space\number\day, \number\year} |
|
|
|
|
|
% @settitle line... specifies the title of the document, for headings |
|
|
% It generates no output of its own |
|
1682 |
|
|
1683 |
\def\thistitle{No Title} |
% @settitle line... specifies the title of the document, for headings. |
1684 |
|
% It generates no output of its own. |
1685 |
|
\def\thistitle{\putwordNoTitle} |
1686 |
\def\settitle{\parsearg\settitlezzz} |
\def\settitle{\parsearg\settitlezzz} |
1687 |
\def\settitlezzz #1{\gdef\thistitle{#1}} |
\def\settitlezzz #1{\gdef\thistitle{#1}} |
1688 |
|
|
1759 |
\itemxneedsnegativevskipfalse |
\itemxneedsnegativevskipfalse |
1760 |
\else |
\else |
1761 |
% The item text fits into the space. Start a paragraph, so that the |
% The item text fits into the space. Start a paragraph, so that the |
1762 |
% following text (if any) will end up on the same line. |
% following text (if any) will end up on the same line. |
1763 |
\noindent |
\noindent |
1764 |
% Do this with kerns and \unhbox so that if there is a footnote in |
% Do this with kerns and \unhbox so that if there is a footnote in |
1765 |
% the item text, it can migrate to the main vertical list and |
% the item text, it can migrate to the main vertical list and |
2056 |
\multitablelinespace=0pt |
\multitablelinespace=0pt |
2057 |
|
|
2058 |
% Macros used to set up halign preamble: |
% Macros used to set up halign preamble: |
2059 |
% |
% |
2060 |
\let\endsetuptable\relax |
\let\endsetuptable\relax |
2061 |
\def\xendsetuptable{\endsetuptable} |
\def\xendsetuptable{\endsetuptable} |
2062 |
\let\columnfractions\relax |
\let\columnfractions\relax |
2102 |
\go |
\go |
2103 |
} |
} |
2104 |
|
|
2105 |
% multitable syntax |
% This used to have \hskip1sp. But then the space in a template line is |
2106 |
\def\tab{&\hskip1sp\relax} % 2/2/96 |
% not enough. That is bad. So let's go back to just & until we |
2107 |
% tiny skip here makes sure this column space is |
% encounter the problem it was intended to solve again. |
2108 |
% maintained, even if it is never used. |
% --karl, nathan@acm.org, 20apr99. |
2109 |
|
\def\tab{&} |
2110 |
|
|
2111 |
% @multitable ... @end multitable definitions: |
% @multitable ... @end multitable definitions: |
2112 |
% |
% |
2148 |
% In order to keep entries from bumping into each other |
% In order to keep entries from bumping into each other |
2149 |
% we will add a \leftskip of \multitablecolspace to all columns after |
% we will add a \leftskip of \multitablecolspace to all columns after |
2150 |
% the first one. |
% the first one. |
2151 |
% |
% |
2152 |
% If a template has been used, we will add \multitablecolspace |
% If a template has been used, we will add \multitablecolspace |
2153 |
% to the width of each template entry. |
% to the width of each template entry. |
2154 |
% |
% |
2155 |
% If the user has set preamble in terms of percent of \hsize we will |
% If the user has set preamble in terms of percent of \hsize we will |
2156 |
% use that dimension as the width of the column, and the \leftskip |
% use that dimension as the width of the column, and the \leftskip |
2157 |
% will keep entries from bumping into each other. Table will start at |
% will keep entries from bumping into each other. Table will start at |
2158 |
% left margin and final column will justify at right margin. |
% left margin and final column will justify at right margin. |
2159 |
% |
% |
2160 |
% Make sure we don't inherit \rightskip from the outer environment. |
% Make sure we don't inherit \rightskip from the outer environment. |
2161 |
\rightskip=0pt |
\rightskip=0pt |
2162 |
\ifnum\colcount=1 |
\ifnum\colcount=1 |
2187 |
% If so, do nothing. If not, give it an appropriate dimension based on |
% If so, do nothing. If not, give it an appropriate dimension based on |
2188 |
% current baselineskip. |
% current baselineskip. |
2189 |
\ifdim\multitablelinespace=0pt |
\ifdim\multitablelinespace=0pt |
2190 |
|
\setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip |
2191 |
|
\global\advance\multitablelinespace by-\ht0 |
2192 |
%% strut to put in table in case some entry doesn't have descenders, |
%% strut to put in table in case some entry doesn't have descenders, |
2193 |
%% to keep lines equally spaced |
%% to keep lines equally spaced |
2194 |
\let\multistrut = \strut |
\let\multistrut = \strut |
|
%% Test to see if parskip is larger than space between lines of |
|
|
%% table. If not, do nothing. |
|
|
%% If so, set to same dimension as multitablelinespace. |
|
2195 |
\else |
\else |
2196 |
|
%% FIXME: what is \box0 supposed to be? |
2197 |
\gdef\multistrut{\vrule height\multitablelinespace depth\dp0 |
\gdef\multistrut{\vrule height\multitablelinespace depth\dp0 |
2198 |
width0pt\relax} \fi |
width0pt\relax} \fi |
2199 |
|
%% Test to see if parskip is larger than space between lines of |
2200 |
|
%% table. If not, do nothing. |
2201 |
|
%% If so, set to same dimension as multitablelinespace. |
2202 |
\ifdim\multitableparskip>\multitablelinespace |
\ifdim\multitableparskip>\multitablelinespace |
2203 |
\global\multitableparskip=\multitablelinespace |
\global\multitableparskip=\multitablelinespace |
2204 |
\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller |
\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller |
2211 |
\fi} |
\fi} |
2212 |
|
|
2213 |
|
|
2214 |
|
\message{conditionals,} |
2215 |
|
% Prevent errors for section commands. |
2216 |
|
% Used in @ignore and in failing conditionals. |
2217 |
|
\def\ignoresections{% |
2218 |
|
\let\chapter=\relax |
2219 |
|
\let\unnumbered=\relax |
2220 |
|
\let\top=\relax |
2221 |
|
\let\unnumberedsec=\relax |
2222 |
|
\let\unnumberedsection=\relax |
2223 |
|
\let\unnumberedsubsec=\relax |
2224 |
|
\let\unnumberedsubsection=\relax |
2225 |
|
\let\unnumberedsubsubsec=\relax |
2226 |
|
\let\unnumberedsubsubsection=\relax |
2227 |
|
\let\section=\relax |
2228 |
|
\let\subsec=\relax |
2229 |
|
\let\subsubsec=\relax |
2230 |
|
\let\subsection=\relax |
2231 |
|
\let\subsubsection=\relax |
2232 |
|
\let\appendix=\relax |
2233 |
|
\let\appendixsec=\relax |
2234 |
|
\let\appendixsection=\relax |
2235 |
|
\let\appendixsubsec=\relax |
2236 |
|
\let\appendixsubsection=\relax |
2237 |
|
\let\appendixsubsubsec=\relax |
2238 |
|
\let\appendixsubsubsection=\relax |
2239 |
|
\let\contents=\relax |
2240 |
|
\let\smallbook=\relax |
2241 |
|
\let\titlepage=\relax |
2242 |
|
} |
2243 |
|
|
2244 |
|
% Used in nested conditionals, where we have to parse the Texinfo source |
2245 |
|
% and so want to turn off most commands, in case they are used |
2246 |
|
% incorrectly. |
2247 |
|
% |
2248 |
|
\def\ignoremorecommands{% |
2249 |
|
\let\defcodeindex = \relax |
2250 |
|
\let\defcv = \relax |
2251 |
|
\let\deffn = \relax |
2252 |
|
\let\deffnx = \relax |
2253 |
|
\let\defindex = \relax |
2254 |
|
\let\defivar = \relax |
2255 |
|
\let\defmac = \relax |
2256 |
|
\let\defmethod = \relax |
2257 |
|
\let\defop = \relax |
2258 |
|
\let\defopt = \relax |
2259 |
|
\let\defspec = \relax |
2260 |
|
\let\deftp = \relax |
2261 |
|
\let\deftypefn = \relax |
2262 |
|
\let\deftypefun = \relax |
2263 |
|
\let\deftypeivar = \relax |
2264 |
|
\let\deftypeop = \relax |
2265 |
|
\let\deftypevar = \relax |
2266 |
|
\let\deftypevr = \relax |
2267 |
|
\let\defun = \relax |
2268 |
|
\let\defvar = \relax |
2269 |
|
\let\defvr = \relax |
2270 |
|
\let\ref = \relax |
2271 |
|
\let\xref = \relax |
2272 |
|
\let\printindex = \relax |
2273 |
|
\let\pxref = \relax |
2274 |
|
\let\settitle = \relax |
2275 |
|
\let\setchapternewpage = \relax |
2276 |
|
\let\setchapterstyle = \relax |
2277 |
|
\let\everyheading = \relax |
2278 |
|
\let\evenheading = \relax |
2279 |
|
\let\oddheading = \relax |
2280 |
|
\let\everyfooting = \relax |
2281 |
|
\let\evenfooting = \relax |
2282 |
|
\let\oddfooting = \relax |
2283 |
|
\let\headings = \relax |
2284 |
|
\let\include = \relax |
2285 |
|
\let\lowersections = \relax |
2286 |
|
\let\down = \relax |
2287 |
|
\let\raisesections = \relax |
2288 |
|
\let\up = \relax |
2289 |
|
\let\set = \relax |
2290 |
|
\let\clear = \relax |
2291 |
|
\let\item = \relax |
2292 |
|
} |
2293 |
|
|
2294 |
|
% Ignore @ignore ... @end ignore. |
2295 |
|
% |
2296 |
|
\def\ignore{\doignore{ignore}} |
2297 |
|
|
2298 |
|
% Ignore @ifinfo, @ifhtml, @ifnottex, @html, @menu, and @direntry text. |
2299 |
|
% |
2300 |
|
\def\ifinfo{\doignore{ifinfo}} |
2301 |
|
\def\ifhtml{\doignore{ifhtml}} |
2302 |
|
\def\ifnottex{\doignore{ifnottex}} |
2303 |
|
\def\html{\doignore{html}} |
2304 |
|
\def\menu{\doignore{menu}} |
2305 |
|
\def\direntry{\doignore{direntry}} |
2306 |
|
|
2307 |
|
% @dircategory CATEGORY -- specify a category of the dir file |
2308 |
|
% which this file should belong to. Ignore this in TeX. |
2309 |
|
\let\dircategory = \comment |
2310 |
|
|
2311 |
|
% Ignore text until a line `@end #1'. |
2312 |
|
% |
2313 |
|
\def\doignore#1{\begingroup |
2314 |
|
% Don't complain about control sequences we have declared \outer. |
2315 |
|
\ignoresections |
2316 |
|
% |
2317 |
|
% Define a command to swallow text until we reach `@end #1'. |
2318 |
|
% This @ is a catcode 12 token (that is the normal catcode of @ in |
2319 |
|
% this texinfo.tex file). We change the catcode of @ below to match. |
2320 |
|
\long\def\doignoretext##1@end #1{\enddoignore}% |
2321 |
|
% |
2322 |
|
% Make sure that spaces turn into tokens that match what \doignoretext wants. |
2323 |
|
\catcode32 = 10 |
2324 |
|
% |
2325 |
|
% Ignore braces, too, so mismatched braces don't cause trouble. |
2326 |
|
\catcode`\{ = 9 |
2327 |
|
\catcode`\} = 9 |
2328 |
|
% |
2329 |
|
% We must not have @c interpreted as a control sequence. |
2330 |
|
\catcode`\@ = 12 |
2331 |
|
% |
2332 |
|
% Make the letter c a comment character so that the rest of the line |
2333 |
|
% will be ignored. This way, the document can have (for example) |
2334 |
|
% @c @end ifinfo |
2335 |
|
% and the @end ifinfo will be properly ignored. |
2336 |
|
% (We've just changed @ to catcode 12.) |
2337 |
|
\catcode`\c = 14 |
2338 |
|
% |
2339 |
|
% And now expand that command. |
2340 |
|
\doignoretext |
2341 |
|
} |
2342 |
|
|
2343 |
|
% What we do to finish off ignored text. |
2344 |
|
% |
2345 |
|
\def\enddoignore{\endgroup\ignorespaces}% |
2346 |
|
|
2347 |
|
\newif\ifwarnedobs\warnedobsfalse |
2348 |
|
\def\obstexwarn{% |
2349 |
|
\ifwarnedobs\relax\else |
2350 |
|
% We need to warn folks that they may have trouble with TeX 3.0. |
2351 |
|
% This uses \immediate\write16 rather than \message to get newlines. |
2352 |
|
\immediate\write16{} |
2353 |
|
\immediate\write16{WARNING: for users of Unix TeX 3.0!} |
2354 |
|
\immediate\write16{This manual trips a bug in TeX version 3.0 (tex hangs).} |
2355 |
|
\immediate\write16{If you are running another version of TeX, relax.} |
2356 |
|
\immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.} |
2357 |
|
\immediate\write16{ Then upgrade your TeX installation if you can.} |
2358 |
|
\immediate\write16{ (See ftp://ftp.gnu.org/pub/gnu/TeX.README.)} |
2359 |
|
\immediate\write16{If you are stuck with version 3.0, run the} |
2360 |
|
\immediate\write16{ script ``tex3patch'' from the Texinfo distribution} |
2361 |
|
\immediate\write16{ to use a workaround.} |
2362 |
|
\immediate\write16{} |
2363 |
|
\global\warnedobstrue |
2364 |
|
\fi |
2365 |
|
} |
2366 |
|
|
2367 |
|
% **In TeX 3.0, setting text in \nullfont hangs tex. For a |
2368 |
|
% workaround (which requires the file ``dummy.tfm'' to be installed), |
2369 |
|
% uncomment the following line: |
2370 |
|
%%%%%\font\nullfont=dummy\let\obstexwarn=\relax |
2371 |
|
|
2372 |
|
% Ignore text, except that we keep track of conditional commands for |
2373 |
|
% purposes of nesting, up to an `@end #1' command. |
2374 |
|
% |
2375 |
|
\def\nestedignore#1{% |
2376 |
|
\obstexwarn |
2377 |
|
% We must actually expand the ignored text to look for the @end |
2378 |
|
% command, so that nested ignore constructs work. Thus, we put the |
2379 |
|
% text into a \vbox and then do nothing with the result. To minimize |
2380 |
|
% the change of memory overflow, we follow the approach outlined on |
2381 |
|
% page 401 of the TeXbook: make the current font be a dummy font. |
2382 |
|
% |
2383 |
|
\setbox0 = \vbox\bgroup |
2384 |
|
% Don't complain about control sequences we have declared \outer. |
2385 |
|
\ignoresections |
2386 |
|
% |
2387 |
|
% Define `@end #1' to end the box, which will in turn undefine the |
2388 |
|
% @end command again. |
2389 |
|
\expandafter\def\csname E#1\endcsname{\egroup\ignorespaces}% |
2390 |
|
% |
2391 |
|
% We are going to be parsing Texinfo commands. Most cause no |
2392 |
|
% trouble when they are used incorrectly, but some commands do |
2393 |
|
% complicated argument parsing or otherwise get confused, so we |
2394 |
|
% undefine them. |
2395 |
|
% |
2396 |
|
% We can't do anything about stray @-signs, unfortunately; |
2397 |
|
% they'll produce `undefined control sequence' errors. |
2398 |
|
\ignoremorecommands |
2399 |
|
% |
2400 |
|
% Set the current font to be \nullfont, a TeX primitive, and define |
2401 |
|
% all the font commands to also use \nullfont. We don't use |
2402 |
|
% dummy.tfm, as suggested in the TeXbook, because not all sites |
2403 |
|
% might have that installed. Therefore, math mode will still |
2404 |
|
% produce output, but that should be an extremely small amount of |
2405 |
|
% stuff compared to the main input. |
2406 |
|
% |
2407 |
|
\nullfont |
2408 |
|
\let\tenrm=\nullfont \let\tenit=\nullfont \let\tensl=\nullfont |
2409 |
|
\let\tenbf=\nullfont \let\tentt=\nullfont \let\smallcaps=\nullfont |
2410 |
|
\let\tensf=\nullfont |
2411 |
|
% Similarly for index fonts (mostly for their use in smallexample). |
2412 |
|
\let\smallrm=\nullfont \let\smallit=\nullfont \let\smallsl=\nullfont |
2413 |
|
\let\smallbf=\nullfont \let\smalltt=\nullfont \let\smallsc=\nullfont |
2414 |
|
\let\smallsf=\nullfont |
2415 |
|
% |
2416 |
|
% Don't complain when characters are missing from the fonts. |
2417 |
|
\tracinglostchars = 0 |
2418 |
|
% |
2419 |
|
% Don't bother to do space factor calculations. |
2420 |
|
\frenchspacing |
2421 |
|
% |
2422 |
|
% Don't report underfull hboxes. |
2423 |
|
\hbadness = 10000 |
2424 |
|
% |
2425 |
|
% Do minimal line-breaking. |
2426 |
|
\pretolerance = 10000 |
2427 |
|
% |
2428 |
|
% Do not execute instructions in @tex |
2429 |
|
\def\tex{\doignore{tex}}% |
2430 |
|
% Do not execute macro definitions. |
2431 |
|
% `c' is a comment character, so the word `macro' will get cut off. |
2432 |
|
\def\macro{\doignore{ma}}% |
2433 |
|
} |
2434 |
|
|
2435 |
|
% @set VAR sets the variable VAR to an empty value. |
2436 |
|
% @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE. |
2437 |
|
% |
2438 |
|
% Since we want to separate VAR from REST-OF-LINE (which might be |
2439 |
|
% empty), we can't just use \parsearg; we have to insert a space of our |
2440 |
|
% own to delimit the rest of the line, and then take it out again if we |
2441 |
|
% didn't need it. Make sure the catcode of space is correct to avoid |
2442 |
|
% losing inside @example, for instance. |
2443 |
|
% |
2444 |
|
\def\set{\begingroup\catcode` =10 |
2445 |
|
\catcode`\-=12 \catcode`\_=12 % Allow - and _ in VAR. |
2446 |
|
\parsearg\setxxx} |
2447 |
|
\def\setxxx#1{\setyyy#1 \endsetyyy} |
2448 |
|
\def\setyyy#1 #2\endsetyyy{% |
2449 |
|
\def\temp{#2}% |
2450 |
|
\ifx\temp\empty \global\expandafter\let\csname SET#1\endcsname = \empty |
2451 |
|
\else \setzzz{#1}#2\endsetzzz % Remove the trailing space \setxxx inserted. |
2452 |
|
\fi |
2453 |
|
\endgroup |
2454 |
|
} |
2455 |
|
% Can't use \xdef to pre-expand #2 and save some time, since \temp or |
2456 |
|
% \next or other control sequences that we've defined might get us into |
2457 |
|
% an infinite loop. Consider `@set foo @cite{bar}'. |
2458 |
|
\def\setzzz#1#2 \endsetzzz{\expandafter\gdef\csname SET#1\endcsname{#2}} |
2459 |
|
|
2460 |
|
% @clear VAR clears (i.e., unsets) the variable VAR. |
2461 |
|
% |
2462 |
|
\def\clear{\parsearg\clearxxx} |
2463 |
|
\def\clearxxx#1{\global\expandafter\let\csname SET#1\endcsname=\relax} |
2464 |
|
|
2465 |
|
% @value{foo} gets the text saved in variable foo. |
2466 |
|
{ |
2467 |
|
\catcode`\_ = \active |
2468 |
|
% |
2469 |
|
% We might end up with active _ or - characters in the argument if |
2470 |
|
% we're called from @code, as @code{@value{foo-bar_}}. So \let any |
2471 |
|
% such active characters to their normal equivalents. |
2472 |
|
\gdef\value{\begingroup |
2473 |
|
\catcode`\-=12 \catcode`\_=12 |
2474 |
|
\indexbreaks \let_\normalunderscore |
2475 |
|
\valuexxx} |
2476 |
|
} |
2477 |
|
\def\valuexxx#1{\expandablevalue{#1}\endgroup} |
2478 |
|
|
2479 |
|
% We have this subroutine so that we can handle at least some @value's |
2480 |
|
% properly in indexes (we \let\value to this in \indexdummies). Ones |
2481 |
|
% whose names contain - or _ still won't work, but we can't do anything |
2482 |
|
% about that. The command has to be fully expandable, since the result |
2483 |
|
% winds up in the index file. This means that if the variable's value |
2484 |
|
% contains other Texinfo commands, it's almost certain it will fail |
2485 |
|
% (although perhaps we could fix that with sufficient work to do a |
2486 |
|
% one-level expansion on the result, instead of complete). |
2487 |
|
% |
2488 |
|
\def\expandablevalue#1{% |
2489 |
|
\expandafter\ifx\csname SET#1\endcsname\relax |
2490 |
|
{[No value for ``#1'']}% |
2491 |
|
\else |
2492 |
|
\csname SET#1\endcsname |
2493 |
|
\fi |
2494 |
|
} |
2495 |
|
|
2496 |
|
% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined |
2497 |
|
% with @set. |
2498 |
|
% |
2499 |
|
\def\ifset{\parsearg\ifsetxxx} |
2500 |
|
\def\ifsetxxx #1{% |
2501 |
|
\expandafter\ifx\csname SET#1\endcsname\relax |
2502 |
|
\expandafter\ifsetfail |
2503 |
|
\else |
2504 |
|
\expandafter\ifsetsucceed |
2505 |
|
\fi |
2506 |
|
} |
2507 |
|
\def\ifsetsucceed{\conditionalsucceed{ifset}} |
2508 |
|
\def\ifsetfail{\nestedignore{ifset}} |
2509 |
|
\defineunmatchedend{ifset} |
2510 |
|
|
2511 |
|
% @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been |
2512 |
|
% defined with @set, or has been undefined with @clear. |
2513 |
|
% |
2514 |
|
\def\ifclear{\parsearg\ifclearxxx} |
2515 |
|
\def\ifclearxxx #1{% |
2516 |
|
\expandafter\ifx\csname SET#1\endcsname\relax |
2517 |
|
\expandafter\ifclearsucceed |
2518 |
|
\else |
2519 |
|
\expandafter\ifclearfail |
2520 |
|
\fi |
2521 |
|
} |
2522 |
|
\def\ifclearsucceed{\conditionalsucceed{ifclear}} |
2523 |
|
\def\ifclearfail{\nestedignore{ifclear}} |
2524 |
|
\defineunmatchedend{ifclear} |
2525 |
|
|
2526 |
|
% @iftex, @ifnothtml, @ifnotinfo always succeed; we read the text |
2527 |
|
% following, through the first @end iftex (etc.). Make `@end iftex' |
2528 |
|
% (etc.) valid only after an @iftex. |
2529 |
|
% |
2530 |
|
\def\iftex{\conditionalsucceed{iftex}} |
2531 |
|
\def\ifnothtml{\conditionalsucceed{ifnothtml}} |
2532 |
|
\def\ifnotinfo{\conditionalsucceed{ifnotinfo}} |
2533 |
|
\defineunmatchedend{iftex} |
2534 |
|
\defineunmatchedend{ifnothtml} |
2535 |
|
\defineunmatchedend{ifnotinfo} |
2536 |
|
|
2537 |
|
% We can't just want to start a group at @iftex (for example) and end it |
2538 |
|
% at @end iftex, since then @set commands inside the conditional have no |
2539 |
|
% effect (they'd get reverted at the end of the group). So we must |
2540 |
|
% define \Eiftex to redefine itself to be its previous value. (We can't |
2541 |
|
% just define it to fail again with an ``unmatched end'' error, since |
2542 |
|
% the @ifset might be nested.) |
2543 |
|
% |
2544 |
|
\def\conditionalsucceed#1{% |
2545 |
|
\edef\temp{% |
2546 |
|
% Remember the current value of \E#1. |
2547 |
|
\let\nece{prevE#1} = \nece{E#1}% |
2548 |
|
% |
2549 |
|
% At the `@end #1', redefine \E#1 to be its previous value. |
2550 |
|
\def\nece{E#1}{\let\nece{E#1} = \nece{prevE#1}}% |
2551 |
|
}% |
2552 |
|
\temp |
2553 |
|
} |
2554 |
|
|
2555 |
|
% We need to expand lots of \csname's, but we don't want to expand the |
2556 |
|
% control sequences after we've constructed them. |
2557 |
|
% |
2558 |
|
\def\nece#1{\expandafter\noexpand\csname#1\endcsname} |
2559 |
|
|
2560 |
|
% @defininfoenclose. |
2561 |
|
\let\definfoenclose=\comment |
2562 |
|
|
2563 |
|
|
2564 |
\message{indexing,} |
\message{indexing,} |
2565 |
% Index generation facilities |
% Index generation facilities |
2566 |
|
|
2675 |
\def\@{@}% will be @@ when we switch to @ as escape char. |
\def\@{@}% will be @@ when we switch to @ as escape char. |
2676 |
% Need these in case \tex is in effect and \{ is a \delimiter again. |
% Need these in case \tex is in effect and \{ is a \delimiter again. |
2677 |
% But can't use \lbracecmd and \rbracecmd because texindex assumes |
% But can't use \lbracecmd and \rbracecmd because texindex assumes |
2678 |
% braces and backslashes are used only as delimiters. |
% braces and backslashes are used only as delimiters. |
2679 |
\let\{ = \mylbrace |
\let\{ = \mylbrace |
2680 |
\let\} = \myrbrace |
\let\} = \myrbrace |
2681 |
\def\_{{\realbackslash _}}% |
\def\_{{\realbackslash _}}% |
2727 |
\let\value = \expandablevalue |
\let\value = \expandablevalue |
2728 |
% |
% |
2729 |
\unsepspaces |
\unsepspaces |
2730 |
|
% Turn off macro expansion |
2731 |
|
\turnoffmacros |
2732 |
} |
} |
2733 |
|
|
2734 |
% If an index command is used in an @example environment, any spaces |
% If an index command is used in an @example environment, any spaces |
2788 |
\let\url=\indexdummyfont |
\let\url=\indexdummyfont |
2789 |
\let\uref=\indexdummyfont |
\let\uref=\indexdummyfont |
2790 |
\let\env=\indexdummyfont |
\let\env=\indexdummyfont |
2791 |
|
\let\acronym=\indexdummyfont |
2792 |
\let\command=\indexdummyfont |
\let\command=\indexdummyfont |
2793 |
\let\option=\indexdummyfont |
\let\option=\indexdummyfont |
2794 |
\let\file=\indexdummyfont |
\let\file=\indexdummyfont |
2815 |
\def\emptymacro{\empty} |
\def\emptymacro{\empty} |
2816 |
|
|
2817 |
% Most index entries go through here, but \dosubind is the general case. |
% Most index entries go through here, but \dosubind is the general case. |
2818 |
% |
% |
2819 |
\def\doind#1#2{\dosubind{#1}{#2}\empty} |
\def\doind#1#2{\dosubind{#1}{#2}\empty} |
2820 |
|
|
2821 |
% Workhorse for all \fooindexes. |
% Workhorse for all \fooindexes. |
2822 |
% #1 is name of index, #2 is stuff to put there, #3 is subentry -- |
% #1 is name of index, #2 is stuff to put there, #3 is subentry -- |
2823 |
% \empty if called from \doind, as we usually are. The main exception |
% \empty if called from \doind, as we usually are. The main exception |
2824 |
% is with defuns, which call us directly. |
% is with defuns, which call us directly. |
2825 |
% |
% |
2826 |
\def\dosubind#1#2#3{% |
\def\dosubind#1#2#3{% |
2827 |
% Put the index entry in the margin if desired. |
% Put the index entry in the margin if desired. |
2828 |
\ifx\SETmarginindex\relax\else |
\ifx\SETmarginindex\relax\else |
2847 |
\def\subentry{ #3}% |
\def\subentry{ #3}% |
2848 |
\fi |
\fi |
2849 |
% |
% |
2850 |
% First process the index-string with all font commands turned off |
% First process the index entry with all font commands turned |
2851 |
% to get the string to sort by. |
% off to get the string to sort by. |
2852 |
{\indexnofonts \xdef\indexsorttmp{#2\subentry}}% |
{\indexnofonts \xdef\indexsorttmp{#2\subentry}}% |
2853 |
% |
% |
2854 |
% Now produce the complete index entry, with both the sort key and the |
% Now the real index entry with the fonts. |
|
% original text, including any font commands. |
|
2855 |
\toks0 = {#2}% |
\toks0 = {#2}% |
2856 |
|
% |
2857 |
|
% If third (subentry) arg is present, add it to the index |
2858 |
|
% string. And include a space. |
2859 |
|
\ifx\thirdarg\emptymacro \else |
2860 |
|
\toks0 = \expandafter{\the\toks0 \space #3}% |
2861 |
|
\fi |
2862 |
|
% |
2863 |
|
% Set up the complete index entry, with both the sort key |
2864 |
|
% and the original text, including any font commands. We write |
2865 |
|
% three arguments to \entry to the .?? file, texindex reduces to |
2866 |
|
% two when writing the .??s sorted result. |
2867 |
\edef\temp{% |
\edef\temp{% |
2868 |
\write\csname#1indfile\endcsname{% |
\write\csname#1indfile\endcsname{% |
2869 |
\realbackslash entry{\indexsorttmp}{\folio}{\the\toks0}}% |
\realbackslash entry{\indexsorttmp}{\folio}{\the\toks0}}% |
2870 |
}% |
}% |
2871 |
% |
% |
|
% If third (subentry) arg is present, add it to the index string. |
|
|
\ifx\thirdarg\emptymacro \else |
|
|
\toks0 = {#3}% |
|
|
\edef\temp{\temp{\the\toks0}}% |
|
|
\fi |
|
|
% |
|
2872 |
% If a skip is the last thing on the list now, preserve it |
% If a skip is the last thing on the list now, preserve it |
2873 |
% by backing up by \lastskip, doing the \write, then inserting |
% by backing up by \lastskip, doing the \write, then inserting |
2874 |
% the skip again. Otherwise, the whatsit generated by the |
% the skip again. Otherwise, the whatsit generated by the |
2880 |
% will have extra space inserted, because the \medbreak in the |
% will have extra space inserted, because the \medbreak in the |
2881 |
% start of the @defun won't see the skip inserted by the @end of |
% start of the @defun won't see the skip inserted by the @end of |
2882 |
% the previous defun. |
% the previous defun. |
2883 |
% |
% |
2884 |
% But don't do any of this if we're not in vertical mode. We |
% But don't do any of this if we're not in vertical mode. We |
2885 |
% don't want to do a \vskip and prematurely end a paragraph. |
% don't want to do a \vskip and prematurely end a paragraph. |
2886 |
% |
% |
2887 |
% Avoid page breaks due to these extra skips, too. |
% Avoid page breaks due to these extra skips, too. |
2888 |
% |
% |
2889 |
\iflinks |
\iflinks |
2890 |
\ifvmode |
\ifvmode |
2891 |
\skip0 = \lastskip |
\skip0 = \lastskip |
2894 |
% |
% |
2895 |
\temp % do the write |
\temp % do the write |
2896 |
% |
% |
2897 |
% |
% |
2898 |
\ifvmode \ifdim\skip0 = 0pt \else \nobreak\vskip\skip0 \fi \fi |
\ifvmode \ifdim\skip0 = 0pt \else \nobreak\vskip\skip0 \fi \fi |
2899 |
\fi |
\fi |
2900 |
}% |
}% |
2942 |
\def\doprintindex#1{\begingroup |
\def\doprintindex#1{\begingroup |
2943 |
\dobreak \chapheadingskip{10000}% |
\dobreak \chapheadingskip{10000}% |
2944 |
% |
% |
2945 |
\indexfonts \rm |
\smallfonts \rm |
2946 |
\tolerance = 9500 |
\tolerance = 9500 |
2947 |
\indexbreaks |
\indexbreaks |
2948 |
% |
% |
2958 |
% and it loses the chapter title and the aux file entries for the |
% and it loses the chapter title and the aux file entries for the |
2959 |
% index. The easiest way to prevent this problem is to make sure |
% index. The easiest way to prevent this problem is to make sure |
2960 |
% there is some text. |
% there is some text. |
2961 |
(Index is nonexistent) |
\putwordIndexNonexistent |
2962 |
\else |
\else |
2963 |
% |
% |
2964 |
% If the index file exists but is empty, then \openin leaves \ifeof |
% If the index file exists but is empty, then \openin leaves \ifeof |
2966 |
% it can discover if there is anything in it. |
% it can discover if there is anything in it. |
2967 |
\read 1 to \temp |
\read 1 to \temp |
2968 |
\ifeof 1 |
\ifeof 1 |
2969 |
(Index is empty) |
\putwordIndexIsEmpty |
2970 |
\else |
\else |
2971 |
% Index files are almost Texinfo source, but we use \ as the escape |
% Index files are almost Texinfo source, but we use \ as the escape |
2972 |
% character. It would be better to use @, but that's too big a change |
% character. It would be better to use @, but that's too big a change |
2991 |
% |
% |
2992 |
% Remove any glue we may have, we'll be inserting our own. |
% Remove any glue we may have, we'll be inserting our own. |
2993 |
\removelastskip |
\removelastskip |
2994 |
% |
% |
2995 |
% We like breaks before the index initials, so insert a bonus. |
% We like breaks before the index initials, so insert a bonus. |
2996 |
\penalty -300 |
\penalty -300 |
2997 |
% |
% |
2999 |
% baselineskips increases the chance of the dots lining up from column |
% baselineskips increases the chance of the dots lining up from column |
3000 |
% to column. It still won't often be perfect, because of the stretch |
% to column. It still won't often be perfect, because of the stretch |
3001 |
% we need before each entry, but it's better. |
% we need before each entry, but it's better. |
3002 |
% |
% |
3003 |
% No shrink because it confuses \balancecolumns. |
% No shrink because it confuses \balancecolumns. |
3004 |
\vskip 1.67\baselineskip plus .5\baselineskip |
\vskip 1.67\baselineskip plus .5\baselineskip |
3005 |
\leftline{\secbf #1}% |
\leftline{\secbf #1}% |
3069 |
% The `\ ' here is removed by the implicit \unskip that TeX does as |
% The `\ ' here is removed by the implicit \unskip that TeX does as |
3070 |
% part of (the primitive) \par. Without it, a spurious underfull |
% part of (the primitive) \par. Without it, a spurious underfull |
3071 |
% \hbox ensues. |
% \hbox ensues. |
3072 |
\ #2% The page number ends the paragraph. |
\ifpdf |
3073 |
|
\pdfgettoks#2.\ \the\toksA % The page number ends the paragraph. |
3074 |
|
\else |
3075 |
|
\ #2% The page number ends the paragraph. |
3076 |
|
\fi |
3077 |
\fi% |
\fi% |
3078 |
\par |
\par |
3079 |
\endgroup} |
\endgroup} |
3102 |
|
|
3103 |
\def\begindoublecolumns{\begingroup % ended by \enddoublecolumns |
\def\begindoublecolumns{\begingroup % ended by \enddoublecolumns |
3104 |
% Grab any single-column material above us. |
% Grab any single-column material above us. |
3105 |
\output = {\global\setbox\partialpage = \vbox{% |
\output = {% |
3106 |
% |
% |
3107 |
% Here is a possibility not foreseen in manmac: if we accumulate a |
% Here is a possibility not foreseen in manmac: if we accumulate a |
3108 |
% whole lot of material, we might end up calling this \output |
% whole lot of material, we might end up calling this \output |
3109 |
% routine twice in a row (see the doublecol-lose test, which is |
% routine twice in a row (see the doublecol-lose test, which is |
3110 |
% essentially a couple of indexes with @setchapternewpage off). In |
% essentially a couple of indexes with @setchapternewpage off). In |
3111 |
% that case, we must prevent the second \partialpage from |
% that case we just ship out what is in \partialpage with the normal |
3112 |
% simply overwriting the first, causing us to lose the page. |
% output routine. Generally, \partialpage will be empty when this |
3113 |
% This will preserve it until a real output routine can ship it |
% runs and this will be a no-op. See the indexspread.tex test case. |
3114 |
% out. Generally, \partialpage will be empty when this runs and |
\ifvoid\partialpage \else |
3115 |
% this will be a no-op. |
\onepageout{\pagecontents\partialpage}% |
3116 |
\unvbox\partialpage |
\fi |
3117 |
% |
% |
3118 |
% Unvbox the main output page. |
\global\setbox\partialpage = \vbox{% |
3119 |
\unvbox255 |
% Unvbox the main output page. |
3120 |
\kern-\topskip \kern\baselineskip |
\unvbox\PAGE |
3121 |
}}% |
\kern-\topskip \kern\baselineskip |
3122 |
|
}% |
3123 |
|
}% |
3124 |
\eject % run that output routine to set \partialpage |
\eject % run that output routine to set \partialpage |
3125 |
% |
% |
3126 |
% Use the double-column output routine for subsequent pages. |
% Use the double-column output routine for subsequent pages. |
3155 |
|
|
3156 |
% The double-column output routine for all double-column pages except |
% The double-column output routine for all double-column pages except |
3157 |
% the last. |
% the last. |
3158 |
% |
% |
3159 |
\def\doublecolumnout{% |
\def\doublecolumnout{% |
3160 |
\splittopskip=\topskip \splitmaxdepth=\maxdepth |
\splittopskip=\topskip \splitmaxdepth=\maxdepth |
3161 |
% Get the available space for the double columns -- the normal |
% Get the available space for the double columns -- the normal |
3173 |
\def\pagesofar{% |
\def\pagesofar{% |
3174 |
% Re-output the contents of the output page -- any previous material, |
% Re-output the contents of the output page -- any previous material, |
3175 |
% followed by the two boxes we just split, in box0 and box2. |
% followed by the two boxes we just split, in box0 and box2. |
|
\advance\vsize by \ht\partialpage |
|
3176 |
\unvbox\partialpage |
\unvbox\partialpage |
3177 |
% |
% |
3178 |
\hsize = \doublecolumnhsize |
\hsize = \doublecolumnhsize |
3232 |
|
|
3233 |
|
|
3234 |
\message{sectioning,} |
\message{sectioning,} |
3235 |
% Define chapters, sections, etc. |
% Chapters, sections, etc. |
3236 |
|
|
3237 |
\newcount\chapno |
\newcount\chapno |
3238 |
\newcount\secno \secno=0 |
\newcount\secno \secno=0 |
3241 |
|
|
3242 |
% This counter is funny since it counts through charcodes of letters A, B, ... |
% This counter is funny since it counts through charcodes of letters A, B, ... |
3243 |
\newcount\appendixno \appendixno = `\@ |
\newcount\appendixno \appendixno = `\@ |
3244 |
\def\appendixletter{\char\the\appendixno} |
% \def\appendixletter{\char\the\appendixno} |
3245 |
|
% We do the following for the sake of pdftex, which needs the actual |
3246 |
|
% letter in the expansion, not just typeset. |
3247 |
|
\def\appendixletter{% |
3248 |
|
\ifnum\appendixno=`A A% |
3249 |
|
\else\ifnum\appendixno=`B B% |
3250 |
|
\else\ifnum\appendixno=`C C% |
3251 |
|
\else\ifnum\appendixno=`D D% |
3252 |
|
\else\ifnum\appendixno=`E E% |
3253 |
|
\else\ifnum\appendixno=`F F% |
3254 |
|
\else\ifnum\appendixno=`G G% |
3255 |
|
\else\ifnum\appendixno=`H H% |
3256 |
|
\else\ifnum\appendixno=`I I% |
3257 |
|
\else\ifnum\appendixno=`J J% |
3258 |
|
\else\ifnum\appendixno=`K K% |
3259 |
|
\else\ifnum\appendixno=`L L% |
3260 |
|
\else\ifnum\appendixno=`M M% |
3261 |
|
\else\ifnum\appendixno=`N N% |
3262 |
|
\else\ifnum\appendixno=`O O% |
3263 |
|
\else\ifnum\appendixno=`P P% |
3264 |
|
\else\ifnum\appendixno=`Q Q% |
3265 |
|
\else\ifnum\appendixno=`R R% |
3266 |
|
\else\ifnum\appendixno=`S S% |
3267 |
|
\else\ifnum\appendixno=`T T% |
3268 |
|
\else\ifnum\appendixno=`U U% |
3269 |
|
\else\ifnum\appendixno=`V V% |
3270 |
|
\else\ifnum\appendixno=`W W% |
3271 |
|
\else\ifnum\appendixno=`X X% |
3272 |
|
\else\ifnum\appendixno=`Y Y% |
3273 |
|
\else\ifnum\appendixno=`Z Z% |
3274 |
|
% The \the is necessary, despite appearances, because \appendixletter is |
3275 |
|
% expanded while writing the .toc file. \char\appendixno is not |
3276 |
|
% expandable, thus it is written literally, thus all appendixes come out |
3277 |
|
% with the same letter (or @) in the toc without it. |
3278 |
|
\else\char\the\appendixno |
3279 |
|
\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi |
3280 |
|
\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi} |
3281 |
|
|
3282 |
% Each @chapter defines this as the name of the chapter. |
% Each @chapter defines this as the name of the chapter. |
3283 |
% page headings and footings can use it. @section does likewise. |
% page headings and footings can use it. @section does likewise. |
3750 |
|
|
3751 |
|
|
3752 |
\message{toc,} |
\message{toc,} |
3753 |
|
% Table of contents. |
3754 |
\newwrite\tocfile |
\newwrite\tocfile |
3755 |
|
|
3756 |
% Write an entry to the toc file, opening it if necessary. |
% Write an entry to the toc file, opening it if necessary. |
3757 |
% Called from @chapter, etc. We supply {\folio} at the end of the |
% Called from @chapter, etc. We supply {\folio} at the end of the |
3758 |
% argument, which will end up as the last argument to the \...entry macro. |
% argument, which will end up as the last argument to the \...entry macro. |
3759 |
% |
% |
3760 |
% We open the .toc file here instead of at @setfilename or any other |
% We open the .toc file here instead of at @setfilename or any other |
3761 |
% given time so that @contents can be put in the document anywhere. |
% given time so that @contents can be put in the document anywhere. |
3762 |
% |
% |
3763 |
\newif\iftocfileopened |
\newif\iftocfileopened |
3764 |
\def\writetocentry#1{% |
\def\writetocentry#1{% |
3765 |
\iftocfileopened\else |
\iftocfileopened\else |
3775 |
|
|
3776 |
% Finish up the main text and prepare to read what we've written |
% Finish up the main text and prepare to read what we've written |
3777 |
% to \tocfile. |
% to \tocfile. |
3778 |
% |
% |
3779 |
\def\startcontents#1{% |
\def\startcontents#1{% |
3780 |
% If @setchapternewpage on, and @headings double, the contents should |
% If @setchapternewpage on, and @headings double, the contents should |
3781 |
% start on an odd page, unlike chapters. Thus, we maintain |
% start on an odd page, unlike chapters. Thus, we maintain |
3803 |
|
|
3804 |
% Normal (long) toc. |
% Normal (long) toc. |
3805 |
\def\contents{% |
\def\contents{% |
3806 |
\startcontents{\putwordTableofContents}% |
\startcontents{\putwordTOC}% |
3807 |
\openin 1 \jobname.toc |
\openin 1 \jobname.toc |
3808 |
\ifeof 1 \else |
\ifeof 1 \else |
3809 |
\closein 1 |
\closein 1 |
3810 |
\input \jobname.toc |
\input \jobname.toc |
3811 |
\fi |
\fi |
3812 |
\vfill \eject |
\vfill \eject |
3813 |
|
\contentsalignmacro % in case @setchapternewpage odd is in effect |
3814 |
|
\pdfmakeoutlines |
3815 |
\endgroup |
\endgroup |
3816 |
\lastnegativepageno = \pageno |
\lastnegativepageno = \pageno |
3817 |
\pageno = \savepageno |
\pageno = \savepageno |
3819 |
|
|
3820 |
% And just the chapters. |
% And just the chapters. |
3821 |
\def\summarycontents{% |
\def\summarycontents{% |
3822 |
\startcontents{\putwordShortContents}% |
\startcontents{\putwordShortTOC}% |
3823 |
% |
% |
3824 |
\let\chapentry = \shortchapentry |
\let\chapentry = \shortchapentry |
3825 |
\let\unnumbchapentry = \shortunnumberedentry |
\let\unnumbchapentry = \shortunnumberedentry |
3841 |
\input \jobname.toc |
\input \jobname.toc |
3842 |
\fi |
\fi |
3843 |
\vfill \eject |
\vfill \eject |
3844 |
|
\contentsalignmacro % in case @setchapternewpage odd is in effect |
3845 |
\endgroup |
\endgroup |
3846 |
\lastnegativepageno = \pageno |
\lastnegativepageno = \pageno |
3847 |
\pageno = \savepageno |
\pageno = \savepageno |
3848 |
} |
} |
3849 |
\let\shortcontents = \summarycontents |
\let\shortcontents = \summarycontents |
3850 |
|
|
3851 |
|
\ifpdf |
3852 |
|
\pdfcatalog{/PageMode /UseOutlines}% |
3853 |
|
\fi |
3854 |
|
|
3855 |
% These macros generate individual entries in the table of contents. |
% These macros generate individual entries in the table of contents. |
3856 |
% The first argument is the chapter or section name. |
% The first argument is the chapter or section name. |
3857 |
% The last argument is the page number. |
% The last argument is the page number. |
3862 |
|
|
3863 |
% See comments in \dochapentry re vbox and related settings |
% See comments in \dochapentry re vbox and related settings |
3864 |
\def\shortchapentry#1#2#3{% |
\def\shortchapentry#1#2#3{% |
3865 |
\tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno{#3}}% |
\tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#3\egroup}% |
3866 |
} |
} |
3867 |
|
|
3868 |
% Typeset the label for a chapter or appendix for the short contents. |
% Typeset the label for a chapter or appendix for the short contents. |
3870 |
% We could simplify the code here by writing out an \appendixentry |
% We could simplify the code here by writing out an \appendixentry |
3871 |
% command in the toc file for appendices, instead of using \chapentry |
% command in the toc file for appendices, instead of using \chapentry |
3872 |
% for both, but it doesn't seem worth it. |
% for both, but it doesn't seem worth it. |
3873 |
\setbox0 = \hbox{\shortcontrm \putwordAppendix } |
% |
3874 |
\newdimen\shortappendixwidth \shortappendixwidth = \wd0 |
\newdimen\shortappendixwidth |
3875 |
|
% |
3876 |
\def\shortchaplabel#1{% |
\def\shortchaplabel#1{% |
3877 |
|
% Compute width of word "Appendix", may change with language. |
3878 |
|
\setbox0 = \hbox{\shortcontrm \putwordAppendix}% |
3879 |
|
\shortappendixwidth = \wd0 |
3880 |
|
% |
3881 |
% We typeset #1 in a box of constant width, regardless of the text of |
% We typeset #1 in a box of constant width, regardless of the text of |
3882 |
% #1, so the chapter titles will come out aligned. |
% #1, so the chapter titles will come out aligned. |
3883 |
\setbox0 = \hbox{#1}% |
\setbox0 = \hbox{#1}% |
3892 |
} |
} |
3893 |
|
|
3894 |
\def\unnumbchapentry#1#2{\dochapentry{#1}{#2}} |
\def\unnumbchapentry#1#2{\dochapentry{#1}{#2}} |
3895 |
\def\shortunnumberedentry#1#2{\tocentry{#1}{\doshortpageno{#2}}} |
\def\shortunnumberedentry#1#2{\tocentry{#1}{\doshortpageno\bgroup#2\egroup}} |
3896 |
|
|
3897 |
% Sections. |
% Sections. |
3898 |
\def\secentry#1#2#3#4{\dosecentry{#2.#3\labelspace#1}{#4}} |
\def\secentry#1#2#3#4{\dosecentry{#2.#3\labelspace#1}{#4}} |
3919 |
\penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip |
\penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip |
3920 |
\begingroup |
\begingroup |
3921 |
\chapentryfonts |
\chapentryfonts |
3922 |
\tocentry{#1}{\dopageno{#2}}% |
\tocentry{#1}{\dopageno\bgroup#2\egroup}% |
3923 |
\endgroup |
\endgroup |
3924 |
\nobreak\vskip .25\baselineskip plus.1\baselineskip |
\nobreak\vskip .25\baselineskip plus.1\baselineskip |
3925 |
} |
} |
3926 |
|
|
3927 |
\def\dosecentry#1#2{\begingroup |
\def\dosecentry#1#2{\begingroup |
3928 |
\secentryfonts \leftskip=\tocindent |
\secentryfonts \leftskip=\tocindent |
3929 |
\tocentry{#1}{\dopageno{#2}}% |
\tocentry{#1}{\dopageno\bgroup#2\egroup}% |
3930 |
\endgroup} |
\endgroup} |
3931 |
|
|
3932 |
\def\dosubsecentry#1#2{\begingroup |
\def\dosubsecentry#1#2{\begingroup |
3933 |
\subsecentryfonts \leftskip=2\tocindent |
\subsecentryfonts \leftskip=2\tocindent |
3934 |
\tocentry{#1}{\dopageno{#2}}% |
\tocentry{#1}{\dopageno\bgroup#2\egroup}% |
3935 |
\endgroup} |
\endgroup} |
3936 |
|
|
3937 |
\def\dosubsubsecentry#1#2{\begingroup |
\def\dosubsubsecentry#1#2{\begingroup |
3938 |
\subsubsecentryfonts \leftskip=3\tocindent |
\subsubsecentryfonts \leftskip=3\tocindent |
3939 |
\tocentry{#1}{\dopageno{#2}}% |
\tocentry{#1}{\dopageno\bgroup#2\egroup}% |
3940 |
\endgroup} |
\endgroup} |
3941 |
|
|
3942 |
% Final typesetting of a toc entry; we use the same \entry macro as for |
% Final typesetting of a toc entry; we use the same \entry macro as for |
3964 |
|
|
3965 |
|
|
3966 |
\message{environments,} |
\message{environments,} |
3967 |
|
% @foo ... @end foo. |
3968 |
|
|
3969 |
% Since these characters are used in examples, it should be an even number of |
% Since these characters are used in examples, it should be an even number of |
3970 |
% \tt widths. Each \tt character is 1en, so two makes it 1em. |
% \tt widths. Each \tt character is 1en, so two makes it 1em. |
4175 |
|
|
4176 |
% Define the \E... control sequence only if we are inside the particular |
% Define the \E... control sequence only if we are inside the particular |
4177 |
% environment, so the error checking in \end will work. |
% environment, so the error checking in \end will work. |
4178 |
% |
% |
4179 |
% To end an @example-like environment, we first end the paragraph (via |
% To end an @example-like environment, we first end the paragraph (via |
4180 |
% \afterenvbreak's vertical glue), and then the group. That way we keep |
% \afterenvbreak's vertical glue), and then the group. That way we keep |
4181 |
% the zero \parskip that the environments set -- \parskip glue will be |
% the zero \parskip that the environments set -- \parskip glue will be |
4200 |
% redefines). We must call \example (or whatever) last in the |
% redefines). We must call \example (or whatever) last in the |
4201 |
% definition, since it reads the return following the @example (or |
% definition, since it reads the return following the @example (or |
4202 |
% whatever) command. |
% whatever) command. |
4203 |
% |
% |
4204 |
% This actually allows (for example) @end display inside an |
% This actually allows (for example) @end display inside an |
4205 |
% @smalldisplay. Too bad, but makeinfo will catch the error anyway. |
% @smalldisplay. Too bad, but makeinfo will catch the error anyway. |
4206 |
% |
% |
4214 |
\def\smalllispx{\begingroup |
\def\smalllispx{\begingroup |
4215 |
\def\Esmalllisp{\nonfillfinish\endgroup}% |
\def\Esmalllisp{\nonfillfinish\endgroup}% |
4216 |
\def\Esmallexample{\nonfillfinish\endgroup}% |
\def\Esmallexample{\nonfillfinish\endgroup}% |
4217 |
\indexfonts |
\smallfonts |
4218 |
\lisp |
\lisp |
4219 |
} |
} |
4220 |
|
|
4230 |
% |
% |
4231 |
\def\smalldisplayx{\begingroup |
\def\smalldisplayx{\begingroup |
4232 |
\def\Esmalldisplay{\nonfillfinish\endgroup}% |
\def\Esmalldisplay{\nonfillfinish\endgroup}% |
4233 |
\indexfonts \rm |
\smallfonts \rm |
4234 |
\display |
\display |
4235 |
} |
} |
4236 |
|
|
4247 |
% |
% |
4248 |
\def\smallformatx{\begingroup |
\def\smallformatx{\begingroup |
4249 |
\def\Esmallformat{\nonfillfinish\endgroup}% |
\def\Esmallformat{\nonfillfinish\endgroup}% |
4250 |
\indexfonts \rm |
\smallfonts \rm |
4251 |
\format |
\format |
4252 |
} |
} |
4253 |
|
|
4256 |
\def\flushleft{\begingroup \def\Eflushleft{\nonfillfinish\endgroup}\format} |
\def\flushleft{\begingroup \def\Eflushleft{\nonfillfinish\endgroup}\format} |
4257 |
|
|
4258 |
% @flushright. |
% @flushright. |
4259 |
% |
% |
4260 |
\def\flushright{\begingroup |
\def\flushright{\begingroup |
4261 |
\let\nonarrowing = t |
\let\nonarrowing = t |
4262 |
\nonfillstart |
\nonfillstart |
4288 |
|
|
4289 |
|
|
4290 |
\message{defuns,} |
\message{defuns,} |
4291 |
% Define formatter for defuns |
% @defun etc. |
4292 |
% First, allow user to change definition object font (\df) internally |
|
4293 |
|
% Allow user to change definition object font (\df) internally |
4294 |
\def\setdeffont #1 {\csname DEF#1\endcsname} |
\def\setdeffont #1 {\csname DEF#1\endcsname} |
4295 |
|
|
4296 |
\newskip\defbodyindent \defbodyindent=.4in |
\newskip\defbodyindent \defbodyindent=.4in |
4344 |
%% contained text. This is especially needed for [ and ] |
%% contained text. This is especially needed for [ and ] |
4345 |
\def\opnr{{\sf\char`\(}\global\advance\parencount by 1 } |
\def\opnr{{\sf\char`\(}\global\advance\parencount by 1 } |
4346 |
\def\clnr{{\sf\char`\)}\global\advance\parencount by -1 } |
\def\clnr{{\sf\char`\)}\global\advance\parencount by -1 } |
4347 |
\def\ampnr{\&} |
\let\ampnr = \& |
4348 |
\def\lbrb{{\bf\char`\[}} |
\def\lbrb{{\bf\char`\[}} |
4349 |
\def\rbrb{{\bf\char`\]}} |
\def\rbrb{{\bf\char`\]}} |
4350 |
|
|
4351 |
|
% Active &'s sneak into the index arguments, so make sure it's defined. |
4352 |
|
{ |
4353 |
|
\catcode`& = 13 |
4354 |
|
\global\let& = \ampnr |
4355 |
|
} |
4356 |
|
|
4357 |
% First, defname, which formats the header line itself. |
% First, defname, which formats the header line itself. |
4358 |
% #1 should be the function name. |
% #1 should be the function name. |
4359 |
% #2 should be the type of definition, such as "Function". |
% #2 should be the type of definition, such as "Function". |
4405 |
% #2 is the \...x control sequence for consecutive fns (which we define). |
% #2 is the \...x control sequence for consecutive fns (which we define). |
4406 |
% #3 is the control sequence to call to resume processing. |
% #3 is the control sequence to call to resume processing. |
4407 |
% #4, delimited by the space, is the class name. |
% #4, delimited by the space, is the class name. |
4408 |
% |
% |
4409 |
\def\defmethparsebody#1#2#3#4 {\begingroup\inENV % |
\def\defmethparsebody#1#2#3#4 {\begingroup\inENV % |
4410 |
\medbreak % |
\medbreak % |
4411 |
% Define the end token that this defining construct specifies |
% Define the end token that this defining construct specifies |
4417 |
\exdentamount=\defbodyindent |
\exdentamount=\defbodyindent |
4418 |
\begingroup\obeylines\activeparens\spacesplit{#3{#4}}} |
\begingroup\obeylines\activeparens\spacesplit{#3{#4}}} |
4419 |
|
|
4420 |
% @deftypemethod has an extra argument that nothing else does. Sigh. |
% Used for @deftypemethod and @deftypeivar. |
4421 |
% #1 is the \E... control sequence to end the definition (which we define). |
% #1 is the \E... control sequence to end the definition (which we define). |
4422 |
% #2 is the \...x control sequence for consecutive fns (which we define). |
% #2 is the \...x control sequence for consecutive fns (which we define). |
4423 |
% #3 is the control sequence to call to resume processing. |
% #3 is the control sequence to call to resume processing. |
4424 |
% #4, delimited by the space, is the class name. |
% #4, delimited by a space, is the class name. |
4425 |
% #5 is the method's return type. |
% #5 is the method's return type. |
4426 |
|
% |
4427 |
|
\def\deftypemethparsebody#1#2#3#4 #5 {\begingroup\inENV |
4428 |
|
\medbreak |
4429 |
|
\def#1{\endgraf\endgroup\medbreak}% |
4430 |
|
\def#2##1 ##2 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}{##2}}}% |
4431 |
|
\parindent=0in |
4432 |
|
\advance\leftskip by \defbodyindent |
4433 |
|
\exdentamount=\defbodyindent |
4434 |
|
\begingroup\obeylines\activeparens\spacesplit{#3{#4}{#5}}} |
4435 |
|
|
4436 |
|
% Used for @deftypeop. The change from \deftypemethparsebody is an |
4437 |
|
% extra argument at the beginning which is the `category', instead of it |
4438 |
|
% being the hardwired string `Method' or `Instance Variable'. We have |
4439 |
|
% to account for this both in the \...x definition and in parsing the |
4440 |
|
% input at hand. Thus also need a control sequence (passed as #5) for |
4441 |
|
% the \E... definition to assign the category name to. |
4442 |
% |
% |
4443 |
\def\deftypemethparsebody#1#2#3#4 #5 {\begingroup\inENV % |
\def\deftypeopparsebody#1#2#3#4#5 #6 {\begingroup\inENV |
4444 |
\medbreak % |
\medbreak |
4445 |
% Define the end token that this defining construct specifies |
\def#1{\endgraf\endgroup\medbreak}% |
4446 |
% so that it will exit this group. |
\def#2##1 ##2 ##3 {% |
4447 |
\def#1{\endgraf\endgroup\medbreak}% |
\def#4{##1}% |
4448 |
\def#2##1 ##2 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}{##2}}}% |
\begingroup\obeylines\activeparens\spacesplit{#3{##2}{##3}}}% |
4449 |
\parindent=0in |
\parindent=0in |
4450 |
\advance\leftskip by \defbodyindent |
\advance\leftskip by \defbodyindent |
4451 |
\exdentamount=\defbodyindent |
\exdentamount=\defbodyindent |
4452 |
\begingroup\obeylines\activeparens\spacesplit{#3{#4}{#5}}} |
\begingroup\obeylines\activeparens\spacesplit{#3{#5}{#6}}} |
4453 |
|
|
4454 |
\def\defopparsebody #1#2#3#4#5 {\begingroup\inENV % |
\def\defopparsebody #1#2#3#4#5 {\begingroup\inENV % |
4455 |
\medbreak % |
\medbreak % |
4560 |
% First, define the processing that is wanted for arguments of \defun |
% First, define the processing that is wanted for arguments of \defun |
4561 |
% Use this to expand the args and terminate the paragraph they make up |
% Use this to expand the args and terminate the paragraph they make up |
4562 |
|
|
4563 |
\def\defunargs #1{\functionparens \sl |
\def\defunargs#1{\functionparens \sl |
4564 |
% Expand, preventing hyphenation at `-' chars. |
% Expand, preventing hyphenation at `-' chars. |
4565 |
% Note that groups don't affect changes in \hyphenchar. |
% Note that groups don't affect changes in \hyphenchar. |
4566 |
\hyphenchar\tensl=0 |
% Set the font temporarily and use \font in case \setfont made \tensl a macro. |
4567 |
|
{\tensl\hyphenchar\font=0}% |
4568 |
#1% |
#1% |
4569 |
\hyphenchar\tensl=45 |
{\tensl\hyphenchar\font=45}% |
4570 |
\ifnum\parencount=0 \else \errmessage{Unbalanced parentheses in @def}\fi% |
\ifnum\parencount=0 \else \errmessage{Unbalanced parentheses in @def}\fi% |
4571 |
\interlinepenalty=10000 |
\interlinepenalty=10000 |
4572 |
\advance\rightskip by 0pt plus 1fil |
\advance\rightskip by 0pt plus 1fil |
4600 |
\def\defun{\defparsebody\Edefun\defunx\defunheader} |
\def\defun{\defparsebody\Edefun\defunx\defunheader} |
4601 |
|
|
4602 |
\def\defunheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index |
\def\defunheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index |
4603 |
\begingroup\defname {#1}{Function}% |
\begingroup\defname {#1}{\putwordDeffunc}% |
4604 |
\defunargs {#2}\endgroup % |
\defunargs {#2}\endgroup % |
4605 |
\catcode 61=\other % Turn off change made in \defparsebody |
\catcode 61=\other % Turn off change made in \defparsebody |
4606 |
} |
} |
4614 |
% #1 is the data type, #2 the name, #3 the args. |
% #1 is the data type, #2 the name, #3 the args. |
4615 |
\def\deftypefunheaderx #1#2 #3\relax{% |
\def\deftypefunheaderx #1#2 #3\relax{% |
4616 |
\doind {fn}{\code{#2}}% Make entry in function index |
\doind {fn}{\code{#2}}% Make entry in function index |
4617 |
\begingroup\defname {\defheaderxcond#1\relax$$$#2}{Function}% |
\begingroup\defname {\defheaderxcond#1\relax$$$#2}{\putwordDeftypefun}% |
4618 |
\deftypefunargs {#3}\endgroup % |
\deftypefunargs {#3}\endgroup % |
4619 |
\catcode 61=\other % Turn off change made in \defparsebody |
\catcode 61=\other % Turn off change made in \defparsebody |
4620 |
} |
} |
4645 |
\def\defmac{\defparsebody\Edefmac\defmacx\defmacheader} |
\def\defmac{\defparsebody\Edefmac\defmacx\defmacheader} |
4646 |
|
|
4647 |
\def\defmacheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index |
\def\defmacheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index |
4648 |
\begingroup\defname {#1}{Macro}% |
\begingroup\defname {#1}{\putwordDefmac}% |
4649 |
\defunargs {#2}\endgroup % |
\defunargs {#2}\endgroup % |
4650 |
\catcode 61=\other % Turn off change made in \defparsebody |
\catcode 61=\other % Turn off change made in \defparsebody |
4651 |
} |
} |
4655 |
\def\defspec{\defparsebody\Edefspec\defspecx\defspecheader} |
\def\defspec{\defparsebody\Edefspec\defspecx\defspecheader} |
4656 |
|
|
4657 |
\def\defspecheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index |
\def\defspecheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index |
4658 |
\begingroup\defname {#1}{Special Form}% |
\begingroup\defname {#1}{\putwordDefspec}% |
4659 |
\defunargs {#2}\endgroup % |
\defunargs {#2}\endgroup % |
4660 |
\catcode 61=\other % Turn off change made in \defparsebody |
\catcode 61=\other % Turn off change made in \defparsebody |
4661 |
} |
} |
4662 |
|
|
|
% This definition is run if you use @defunx |
|
|
% anywhere other than immediately after a @defun or @defunx. |
|
|
|
|
|
\def\deffnx #1 {\errmessage{@deffnx in invalid context}} |
|
|
\def\defunx #1 {\errmessage{@defunx in invalid context}} |
|
|
\def\defmacx #1 {\errmessage{@defmacx in invalid context}} |
|
|
\def\defspecx #1 {\errmessage{@defspecx in invalid context}} |
|
|
\def\deftypefnx #1 {\errmessage{@deftypefnx in invalid context}} |
|
|
\def\deftypemethodx #1 {\errmessage{@deftypemethodx in invalid context}} |
|
|
\def\deftypefunx #1 {\errmessage{@deftypefunx in invalid context}} |
|
|
|
|
|
% @defmethod, and so on |
|
|
|
|
4663 |
% @defop CATEGORY CLASS OPERATION ARG... |
% @defop CATEGORY CLASS OPERATION ARG... |
4664 |
|
% |
4665 |
\def\defop #1 {\def\defoptype{#1}% |
\def\defop #1 {\def\defoptype{#1}% |
4666 |
\defopparsebody\Edefop\defopx\defopheader\defoptype} |
\defopparsebody\Edefop\defopx\defopheader\defoptype} |
4667 |
|
% |
4668 |
\def\defopheader #1#2#3{% |
\def\defopheader#1#2#3{% |
4669 |
\dosubind {fn}{\code{#2}}{\putwordon\ #1}% Make entry in function index |
\dosubind {fn}{\code{#2}}{\putwordon\ #1}% Make entry in function index |
4670 |
\begingroup\defname {#2}{\defoptype{} on #1}% |
\begingroup\defname {#2}{\defoptype\ \putwordon\ #1}% |
4671 |
\defunargs {#3}\endgroup % |
\defunargs {#3}\endgroup % |
4672 |
} |
} |
4673 |
|
|
4674 |
% @deftypemethod CLASS RETURN-TYPE METHOD ARG... |
% @deftypeop CATEGORY CLASS TYPE OPERATION ARG... |
4675 |
|
% |
4676 |
|
\def\deftypeop #1 {\def\deftypeopcategory{#1}% |
4677 |
|
\deftypeopparsebody\Edeftypeop\deftypeopx\deftypeopheader |
4678 |
|
\deftypeopcategory} |
4679 |
|
% |
4680 |
|
% #1 is the class name, #2 the data type, #3 the operation name, #4 the args. |
4681 |
|
\def\deftypeopheader#1#2#3#4{% |
4682 |
|
\dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index |
4683 |
|
\begingroup |
4684 |
|
\defname{\defheaderxcond#2\relax$$$#3} |
4685 |
|
{\deftypeopcategory\ \putwordon\ \code{#1}}% |
4686 |
|
\deftypefunargs{#4}% |
4687 |
|
\endgroup |
4688 |
|
} |
4689 |
|
|
4690 |
|
% @deftypemethod CLASS TYPE METHOD ARG... |
4691 |
% |
% |
4692 |
\def\deftypemethod{% |
\def\deftypemethod{% |
4693 |
\deftypemethparsebody\Edeftypemethod\deftypemethodx\deftypemethodheader} |
\deftypemethparsebody\Edeftypemethod\deftypemethodx\deftypemethodheader} |
4701 |
\endgroup |
\endgroup |
4702 |
} |
} |
4703 |
|
|
4704 |
|
% @deftypeivar CLASS TYPE VARNAME |
4705 |
|
% |
4706 |
|
\def\deftypeivar{% |
4707 |
|
\deftypemethparsebody\Edeftypeivar\deftypeivarx\deftypeivarheader} |
4708 |
|
% |
4709 |
|
% #1 is the class name, #2 the data type, #3 the variable name. |
4710 |
|
\def\deftypeivarheader#1#2#3{% |
4711 |
|
\dosubind{vr}{\code{#3}}{\putwordof\ \code{#1}}% entry in variable index |
4712 |
|
\begingroup |
4713 |
|
\defname{#3}{\putwordInstanceVariableof\ \code{#1}}% |
4714 |
|
\defvarargs{#3}% |
4715 |
|
\endgroup |
4716 |
|
} |
4717 |
|
|
4718 |
% @defmethod == @defop Method |
% @defmethod == @defop Method |
4719 |
% |
% |
4720 |
\def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader} |
\def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader} |
4734 |
\defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype} |
\defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype} |
4735 |
|
|
4736 |
\def\defcvarheader #1#2#3{% |
\def\defcvarheader #1#2#3{% |
4737 |
\dosubind {vr}{\code{#2}}{of #1}% Make entry in var index |
\dosubind {vr}{\code{#2}}{\putwordof\ #1}% Make entry in var index |
4738 |
\begingroup\defname {#2}{\defcvtype{} of #1}% |
\begingroup\defname {#2}{\defcvtype\ \putwordof\ #1}% |
4739 |
\defvarargs {#3}\endgroup % |
\defvarargs {#3}\endgroup % |
4740 |
} |
} |
4741 |
|
|
4742 |
% @defivar == @defcv {Instance Variable} |
% @defivar CLASS VARNAME == @defcv {Instance Variable} CLASS VARNAME |
4743 |
|
% |
4744 |
\def\defivar{\defvrparsebody\Edefivar\defivarx\defivarheader} |
\def\defivar{\defvrparsebody\Edefivar\defivarx\defivarheader} |
4745 |
|
% |
4746 |
\def\defivarheader #1#2#3{% |
\def\defivarheader#1#2#3{% |
4747 |
\dosubind {vr}{\code{#2}}{of #1}% Make entry in var index |
\dosubind {vr}{\code{#2}}{\putwordof\ #1}% entry in var index |
4748 |
\begingroup\defname {#2}{Instance Variable of #1}% |
\begingroup |
4749 |
\defvarargs {#3}\endgroup % |
\defname{#2}{\putwordInstanceVariableof\ #1}% |
4750 |
|
\defvarargs{#3}% |
4751 |
|
\endgroup |
4752 |
} |
} |
4753 |
|
|
4754 |
% These definitions are run if you use @defmethodx, etc., |
% @defvar |
|
% anywhere other than immediately after a @defmethod, etc. |
|
|
|
|
|
\def\defopx #1 {\errmessage{@defopx in invalid context}} |
|
|
\def\defmethodx #1 {\errmessage{@defmethodx in invalid context}} |
|
|
\def\defcvx #1 {\errmessage{@defcvx in invalid context}} |
|
|
\def\defivarx #1 {\errmessage{@defivarx in invalid context}} |
|
|
|
|
|
% Now @defvar |
|
|
|
|
4755 |
% First, define the processing that is wanted for arguments of @defvar. |
% First, define the processing that is wanted for arguments of @defvar. |
4756 |
% This is actually simple: just print them in roman. |
% This is actually simple: just print them in roman. |
4757 |
% This must expand the args and terminate the paragraph they make up |
% This must expand the args and terminate the paragraph they make up |
4771 |
\def\defvar{\defvarparsebody\Edefvar\defvarx\defvarheader} |
\def\defvar{\defvarparsebody\Edefvar\defvarx\defvarheader} |
4772 |
|
|
4773 |
\def\defvarheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index |
\def\defvarheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index |
4774 |
\begingroup\defname {#1}{Variable}% |
\begingroup\defname {#1}{\putwordDefvar}% |
4775 |
\defvarargs {#2}\endgroup % |
\defvarargs {#2}\endgroup % |
4776 |
} |
} |
4777 |
|
|
4780 |
\def\defopt{\defvarparsebody\Edefopt\defoptx\defoptheader} |
\def\defopt{\defvarparsebody\Edefopt\defoptx\defoptheader} |
4781 |
|
|
4782 |
\def\defoptheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index |
\def\defoptheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index |
4783 |
\begingroup\defname {#1}{User Option}% |
\begingroup\defname {#1}{\putwordDefopt}% |
4784 |
\defvarargs {#2}\endgroup % |
\defvarargs {#2}\endgroup % |
4785 |
} |
} |
4786 |
|
|
4792 |
% is actually part of the data type, which should not be put into the index. |
% is actually part of the data type, which should not be put into the index. |
4793 |
\def\deftypevarheader #1#2{% |
\def\deftypevarheader #1#2{% |
4794 |
\dovarind#2 \relax% Make entry in variables index |
\dovarind#2 \relax% Make entry in variables index |
4795 |
\begingroup\defname {\defheaderxcond#1\relax$$$#2}{Variable}% |
\begingroup\defname {\defheaderxcond#1\relax$$$#2}{\putwordDeftypevar}% |
4796 |
\interlinepenalty=10000 |
\interlinepenalty=10000 |
4797 |
\endgraf\nobreak\vskip -\parskip\nobreak |
\endgraf\nobreak\vskip -\parskip\nobreak |
4798 |
\endgroup} |
\endgroup} |
4808 |
\endgraf\nobreak\vskip -\parskip\nobreak |
\endgraf\nobreak\vskip -\parskip\nobreak |
4809 |
\endgroup} |
\endgroup} |
4810 |
|
|
|
% This definition is run if you use @defvarx |
|
|
% anywhere other than immediately after a @defvar or @defvarx. |
|
|
|
|
|
\def\defvrx #1 {\errmessage{@defvrx in invalid context}} |
|
|
\def\defvarx #1 {\errmessage{@defvarx in invalid context}} |
|
|
\def\defoptx #1 {\errmessage{@defoptx in invalid context}} |
|
|
\def\deftypevarx #1 {\errmessage{@deftypevarx in invalid context}} |
|
|
\def\deftypevrx #1 {\errmessage{@deftypevrx in invalid context}} |
|
|
|
|
4811 |
% Now define @deftp |
% Now define @deftp |
4812 |
% Args are printed in bold, a slight difference from @defvar. |
% Args are printed in bold, a slight difference from @defvar. |
4813 |
|
|
4820 |
\def\deftpheader #1#2#3{\doind {tp}{\code{#2}}% |
\def\deftpheader #1#2#3{\doind {tp}{\code{#2}}% |
4821 |
\begingroup\defname {#2}{#1}\deftpargs{#3}\endgroup} |
\begingroup\defname {#2}{#1}\deftpargs{#3}\endgroup} |
4822 |
|
|
4823 |
% This definition is run if you use @deftpx, etc |
% These definitions are used if you use @defunx (etc.) |
4824 |
% anywhere other than immediately after a @deftp, etc. |
% anywhere other than immediately after a @defun or @defunx. |
4825 |
|
% |
4826 |
\def\deftpx #1 {\errmessage{@deftpx in invalid context}} |
\def\defcvx#1 {\errmessage{@defcvx in invalid context}} |
4827 |
|
\def\deffnx#1 {\errmessage{@deffnx in invalid context}} |
4828 |
|
\def\defivarx#1 {\errmessage{@defivarx in invalid context}} |
4829 |
|
\def\defmacx#1 {\errmessage{@defmacx in invalid context}} |
4830 |
|
\def\defmethodx#1 {\errmessage{@defmethodx in invalid context}} |
4831 |
|
\def\defoptx #1 {\errmessage{@defoptx in invalid context}} |
4832 |
|
\def\defopx#1 {\errmessage{@defopx in invalid context}} |
4833 |
|
\def\defspecx#1 {\errmessage{@defspecx in invalid context}} |
4834 |
|
\def\deftpx#1 {\errmessage{@deftpx in invalid context}} |
4835 |
|
\def\deftypefnx#1 {\errmessage{@deftypefnx in invalid context}} |
4836 |
|
\def\deftypefunx#1 {\errmessage{@deftypefunx in invalid context}} |
4837 |
|
\def\deftypeivarx#1 {\errmessage{@deftypeivarx in invalid context}} |
4838 |
|
\def\deftypemethodx#1 {\errmessage{@deftypemethodx in invalid context}} |
4839 |
|
\def\deftypeopx#1 {\errmessage{@deftypeopx in invalid context}} |
4840 |
|
\def\deftypevarx#1 {\errmessage{@deftypevarx in invalid context}} |
4841 |
|
\def\deftypevrx#1 {\errmessage{@deftypevrx in invalid context}} |
4842 |
|
\def\defunx#1 {\errmessage{@defunx in invalid context}} |
4843 |
|
\def\defvarx#1 {\errmessage{@defvarx in invalid context}} |
4844 |
|
\def\defvrx#1 {\errmessage{@defvrx in invalid context}} |
4845 |
|
|
4846 |
|
|
4847 |
\message{macros,} |
\message{macros,} |
4848 |
% @macro. |
% @macro. |
4849 |
|
|
4850 |
% To do this right we need a feature of e-TeX, \scantokens, |
% To do this right we need a feature of e-TeX, \scantokens, |
4851 |
% which we arrange to emulate with a temporary file in ordinary TeX. |
% which we arrange to emulate with a temporary file in ordinary TeX. |
4852 |
\ifx\eTeXversion\undefined |
\ifx\eTeXversion\undefined |
4853 |
\newwrite\macscribble |
\newwrite\macscribble |
4854 |
\def\scanmacro#1{% |
\def\scanmacro#1{% |
4855 |
\begingroup \newlinechar`\^^M |
\begingroup \newlinechar`\^^M |
4856 |
|
% Undo catcode changes of \startcontents and \doprintindex |
4857 |
|
\catcode`\@=0 \catcode`\\=12 \escapechar=`\@ |
4858 |
|
% Append \endinput to make sure that TeX does not see the ending newline. |
4859 |
|
\toks0={#1\endinput}% |
4860 |
\immediate\openout\macscribble=\jobname.tmp |
\immediate\openout\macscribble=\jobname.tmp |
4861 |
\immediate\write\macscribble{#1}% |
\immediate\write\macscribble{\the\toks0}% |
4862 |
\immediate\closeout\macscribble |
\immediate\closeout\macscribble |
4863 |
\let\xeatspaces\eatspaces |
\let\xeatspaces\eatspaces |
4864 |
\input \jobname.tmp |
\input \jobname.tmp |
4867 |
\else |
\else |
4868 |
\def\scanmacro#1{% |
\def\scanmacro#1{% |
4869 |
\begingroup \newlinechar`\^^M |
\begingroup \newlinechar`\^^M |
4870 |
\let\xeatspaces\eatspaces\scantokens{#1}\endgroup} |
% Undo catcode changes of \startcontents and \doprintindex |
4871 |
|
\catcode`\@=0 \catcode`\\=12 \escapechar=`\@ |
4872 |
|
\let\xeatspaces\eatspaces\scantokens{#1\endinput}\endgroup} |
4873 |
\fi |
\fi |
4874 |
|
|
4875 |
\newcount\paramno % Count of parameters |
\newcount\paramno % Count of parameters |
4876 |
\newtoks\macname % Macro name |
\newtoks\macname % Macro name |
4877 |
\newif\ifrecursive % Is it recursive? |
\newif\ifrecursive % Is it recursive? |
4878 |
|
\def\macrolist{} % List of all defined macros in the form |
4879 |
|
% \do\macro1\do\macro2... |
4880 |
|
|
4881 |
% Utility routines. |
% Utility routines. |
4882 |
% Thisdoes \let #1 = #2, except with \csnames. |
% Thisdoes \let #1 = #2, except with \csnames. |
4908 |
% all characters are catcode 10, 11 or 12, except \ which is active |
% all characters are catcode 10, 11 or 12, except \ which is active |
4909 |
% (as in normal texinfo). It is necessary to change the definition of \. |
% (as in normal texinfo). It is necessary to change the definition of \. |
4910 |
|
|
4911 |
% It's necessary to have hard CRs when the macro is executed. This is |
% It's necessary to have hard CRs when the macro is executed. This is |
4912 |
% done by making ^^M (\endlinechar) catcode 12 when reading the macro |
% done by making ^^M (\endlinechar) catcode 12 when reading the macro |
4913 |
% body, and then making it the \newlinechar in \scanmacro. |
% body, and then making it the \newlinechar in \scanmacro. |
4914 |
|
|
4915 |
\def\macrobodyctxt{% |
\def\macrobodyctxt{% |
4938 |
\catcode`\\=12} |
\catcode`\\=12} |
4939 |
|
|
4940 |
% \mbodybackslash is the definition of \ in @macro bodies. |
% \mbodybackslash is the definition of \ in @macro bodies. |
4941 |
% It maps \foo\ => \csname macarg.foo\endcsname => #N |
% It maps \foo\ => \csname macarg.foo\endcsname => #N |
4942 |
% where N is the macro parameter number. |
% where N is the macro parameter number. |
4943 |
% We define \csname macarg.\endcsname to be \realbackslash, so |
% We define \csname macarg.\endcsname to be \realbackslash, so |
4944 |
% \\ in macro replacement text gets you a backslash. |
% \\ in macro replacement text gets you a backslash. |
4957 |
\ifx\argl\empty % no arguments |
\ifx\argl\empty % no arguments |
4958 |
\paramno=0% |
\paramno=0% |
4959 |
\else |
\else |
4960 |
\expandafter\parsemargdef \argl;% |
\expandafter\parsemargdef \argl;% |
4961 |
\fi |
\fi |
4962 |
\expandafter\ifx \csname macsave.\the\macname\endcsname \relax |
\if1\csname ismacro.\the\macname\endcsname |
|
\cslet{macsave.\the\macname}{\the\macname}% |
|
|
\else |
|
4963 |
\message{Warning: redefining \the\macname}% |
\message{Warning: redefining \the\macname}% |
4964 |
|
\else |
4965 |
|
\expandafter\ifx\csname \the\macname\endcsname \relax |
4966 |
|
\else \errmessage{The name \the\macname\space is reserved}\fi |
4967 |
|
\global\cslet{macsave.\the\macname}{\the\macname}% |
4968 |
|
\global\expandafter\let\csname ismacro.\the\macname\endcsname=1% |
4969 |
|
% Add the macroname to \macrolist |
4970 |
|
\toks0 = \expandafter{\macrolist\do}% |
4971 |
|
\xdef\macrolist{\the\toks0 |
4972 |
|
\expandafter\noexpand\csname\the\macname\endcsname}% |
4973 |
\fi |
\fi |
4974 |
\begingroup \macrobodyctxt |
\begingroup \macrobodyctxt |
4975 |
\ifrecursive \expandafter\parsermacbody |
\ifrecursive \expandafter\parsermacbody |
4976 |
\else \expandafter\parsemacbody |
\else \expandafter\parsemacbody |
4977 |
\fi} |
\fi} |
4978 |
|
|
4979 |
\def\unmacro{\parsearg\unmacroxxx} |
\def\unmacro{\parsearg\unmacroxxx} |
4980 |
\def\unmacroxxx#1{% |
\def\unmacroxxx#1{% |
4981 |
\expandafter\ifx \csname macsave.\the\macname\endcsname \relax |
\if1\csname ismacro.#1\endcsname |
4982 |
\errmessage{Macro \the\macname\ not defined.}% |
\global\cslet{#1}{macsave.#1}% |
4983 |
|
\global\expandafter\let \csname ismacro.#1\endcsname=0% |
4984 |
|
% Remove the macro name from \macrolist |
4985 |
|
\begingroup |
4986 |
|
\edef\tempa{\expandafter\noexpand\csname#1\endcsname}% |
4987 |
|
\def\do##1{% |
4988 |
|
\def\tempb{##1}% |
4989 |
|
\ifx\tempa\tempb |
4990 |
|
% remove this |
4991 |
|
\else |
4992 |
|
\toks0 = \expandafter{\newmacrolist\do}% |
4993 |
|
\edef\newmacrolist{\the\toks0\expandafter\noexpand\tempa}% |
4994 |
|
\fi}% |
4995 |
|
\def\newmacrolist{}% |
4996 |
|
% Execute macro list to define \newmacrolist |
4997 |
|
\macrolist |
4998 |
|
\global\let\macrolist\newmacrolist |
4999 |
|
\endgroup |
5000 |
\else |
\else |
5001 |
\cslet{#1}{macsave.#1}% |
\errmessage{Macro #1 not defined}% |
|
\expandafter\let \csname macsave.\the\macname\endcsname \undefined |
|
5002 |
\fi |
\fi |
5003 |
} |
} |
5004 |
|
|
5057 |
\or % 1 |
\or % 1 |
5058 |
\expandafter\xdef\csname\the\macname\endcsname{% |
\expandafter\xdef\csname\the\macname\endcsname{% |
5059 |
\bgroup\noexpand\macroargctxt |
\bgroup\noexpand\macroargctxt |
5060 |
\noexpand\braceorline\csname\the\macname xxx\endcsname}% |
\noexpand\braceorline |
5061 |
|
\expandafter\noexpand\csname\the\macname xxx\endcsname}% |
5062 |
\expandafter\xdef\csname\the\macname xxx\endcsname##1{% |
\expandafter\xdef\csname\the\macname xxx\endcsname##1{% |
5063 |
\egroup\noexpand\scanmacro{\temp}}% |
\egroup\noexpand\scanmacro{\temp}}% |
5064 |
\else % many |
\else % many |
5065 |
\expandafter\xdef\csname\the\macname\endcsname{% |
\expandafter\xdef\csname\the\macname\endcsname{% |
5066 |
\bgroup\noexpand\macroargctxt |
\bgroup\noexpand\macroargctxt |
5067 |
\noexpand\csname\the\macname xx\endcsname} |
\noexpand\csname\the\macname xx\endcsname}% |
5068 |
\expandafter\xdef\csname\the\macname xx\endcsname##1{% |
\expandafter\xdef\csname\the\macname xx\endcsname##1{% |
5069 |
\csname\the\macname xxx\endcsname ##1,}% |
\expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% |
5070 |
\expandafter\expandafter |
\expandafter\expandafter |
5071 |
\expandafter\xdef |
\expandafter\xdef |
5072 |
\expandafter\expandafter |
\expandafter\expandafter |
5073 |
\csname\the\macname xxx\endcsname |
\csname\the\macname xxx\endcsname |
5074 |
\paramlist{\egroup\noexpand\scanmacro{\temp}}% |
\paramlist{\egroup\noexpand\scanmacro{\temp}}% |
5075 |
\fi |
\fi |
5076 |
\else |
\else |
5082 |
\or % 1 |
\or % 1 |
5083 |
\expandafter\xdef\csname\the\macname\endcsname{% |
\expandafter\xdef\csname\the\macname\endcsname{% |
5084 |
\bgroup\noexpand\macroargctxt |
\bgroup\noexpand\macroargctxt |
5085 |
\noexpand\braceorline\csname\the\macname xxx\endcsname}% |
\noexpand\braceorline |
5086 |
|
\expandafter\noexpand\csname\the\macname xxx\endcsname}% |
5087 |
\expandafter\xdef\csname\the\macname xxx\endcsname##1{% |
\expandafter\xdef\csname\the\macname xxx\endcsname##1{% |
5088 |
\egroup |
\egroup |
5089 |
\noexpand\norecurse{\the\macname}% |
\noexpand\norecurse{\the\macname}% |
5091 |
\else % many |
\else % many |
5092 |
\expandafter\xdef\csname\the\macname\endcsname{% |
\expandafter\xdef\csname\the\macname\endcsname{% |
5093 |
\bgroup\noexpand\macroargctxt |
\bgroup\noexpand\macroargctxt |
5094 |
\noexpand\csname\the\macname xx\endcsname} |
\expandafter\noexpand\csname\the\macname xx\endcsname}% |
5095 |
\expandafter\xdef\csname\the\macname xx\endcsname##1{% |
\expandafter\xdef\csname\the\macname xx\endcsname##1{% |
5096 |
\csname\the\macname xxx\endcsname ##1,}% |
\expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% |
5097 |
\expandafter\expandafter |
\expandafter\expandafter |
5098 |
\expandafter\xdef |
\expandafter\xdef |
5099 |
\expandafter\expandafter |
\expandafter\expandafter |
5114 |
\def\braceorline#1{\let\next=#1\futurelet\nchar\braceorlinexxx} |
\def\braceorline#1{\let\next=#1\futurelet\nchar\braceorlinexxx} |
5115 |
\def\braceorlinexxx{% |
\def\braceorlinexxx{% |
5116 |
\ifx\nchar\bgroup\else |
\ifx\nchar\bgroup\else |
5117 |
\expandafter\parsearg |
\expandafter\parsearg |
5118 |
\fi \next} |
\fi \next} |
5119 |
|
|
5120 |
|
% We mant to disable all macros during \shipout so that they are not |
5121 |
|
% expanded by \write. |
5122 |
|
\def\turnoffmacros{\begingroup \def\do##1{\let\noexpand##1=\relax}% |
5123 |
|
\edef\next{\macrolist}\expandafter\endgroup\next} |
5124 |
|
|
5125 |
|
|
5126 |
|
% @alias. |
5127 |
|
% We need some trickery to remove the optional spaces around the equal |
5128 |
|
% sign. Just make them active and then expand them all to nothing. |
5129 |
|
\def\alias{\begingroup\obeyspaces\parsearg\aliasxxx} |
5130 |
|
\def\aliasxxx #1{\aliasyyy#1\relax} |
5131 |
|
\def\aliasyyy #1=#2\relax{\ignoreactivespaces |
5132 |
|
\edef\next{\global\let\expandafter\noexpand\csname#1\endcsname=% |
5133 |
|
\expandafter\noexpand\csname#2\endcsname}% |
5134 |
|
\expandafter\endgroup\next} |
5135 |
|
|
5136 |
|
|
5137 |
\message{cross references,} |
\message{cross references,} |
5138 |
|
% @xref etc. |
5139 |
|
|
5140 |
\newwrite\auxfile |
\newwrite\auxfile |
5141 |
|
|
5142 |
\newif\ifhavexrefs % True if xref values are known. |
\newif\ifhavexrefs % True if xref values are known. |
5178 |
|
|
5179 |
|
|
5180 |
% @anchor{NAME} -- define xref target at arbitrary point. |
% @anchor{NAME} -- define xref target at arbitrary point. |
5181 |
% |
% |
5182 |
\def\anchor#1{\setref{#1}{Ynothing}} |
\newcount\savesfregister |
5183 |
|
\gdef\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi} |
5184 |
|
\gdef\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi} |
5185 |
|
\gdef\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces} |
5186 |
|
|
5187 |
% \setref{NAME}{SNT} defines a cross-reference point NAME, namely |
% \setref{NAME}{SNT} defines a cross-reference point NAME, namely |
5188 |
% NAME-title, NAME-pg, and NAME-SNT. Called from \foonoderef. We have |
% NAME-title, NAME-pg, and NAME-SNT. Called from \foonoderef. We have |
5189 |
% to set \indexdummies so commands such as @code in a section title |
% to set \indexdummies so commands such as @code in a section title |
5190 |
% aren't expanded. It would be nicer not to expand the titles in the |
% aren't expanded. It would be nicer not to expand the titles in the |
5191 |
% first place, but there's so many layers that that is hard to do. |
% first place, but there's so many layers that that is hard to do. |
5192 |
% |
% |
5193 |
\def\setref#1#2{{% |
\def\setref#1#2{{% |
5194 |
\indexdummies |
\indexdummies |
5195 |
|
\pdfmkdest{#1}% |
5196 |
\dosetq{#1-title}{Ytitle}% |
\dosetq{#1-title}{Ytitle}% |
5197 |
\dosetq{#1-pg}{Ypagenumber}% |
\dosetq{#1-pg}{Ypagenumber}% |
5198 |
\dosetq{#1-snt}{#2} |
\dosetq{#1-snt}{#2}% |
5199 |
}} |
}} |
5200 |
|
|
5201 |
% @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is |
% @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is |
5207 |
\def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]} |
\def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]} |
5208 |
\def\ref#1{\xrefX[#1,,,,,,,]} |
\def\ref#1{\xrefX[#1,,,,,,,]} |
5209 |
\def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup |
\def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup |
5210 |
|
\unsepspaces |
5211 |
\def\printedmanual{\ignorespaces #5}% |
\def\printedmanual{\ignorespaces #5}% |
5212 |
\def\printednodename{\ignorespaces #3}% |
\def\printednodename{\ignorespaces #3}% |
5213 |
\setbox1=\hbox{\printedmanual}% |
\setbox1=\hbox{\printedmanual}% |
5241 |
% are best written with fairly long node names, containing hyphens, this |
% are best written with fairly long node names, containing hyphens, this |
5242 |
% is a loss. Therefore, we give the text of the node name again, so it |
% is a loss. Therefore, we give the text of the node name again, so it |
5243 |
% is as if TeX is seeing it for the first time. |
% is as if TeX is seeing it for the first time. |
5244 |
|
\ifpdf |
5245 |
|
\leavevmode |
5246 |
|
\getfilename{#4}% |
5247 |
|
\ifnum\filenamelength>0 |
5248 |
|
\startlink attr{/Border [0 0 0]}% |
5249 |
|
goto file{\the\filename.pdf} name{#1@}% |
5250 |
|
\else |
5251 |
|
\startlink attr{/Border [0 0 0]}% |
5252 |
|
goto name{#1@}% |
5253 |
|
\fi |
5254 |
|
\linkcolor |
5255 |
|
\fi |
5256 |
|
% |
5257 |
\ifdim \wd1 > 0pt |
\ifdim \wd1 > 0pt |
5258 |
\putwordsection{} ``\printednodename'' in \cite{\printedmanual}% |
\putwordsection{} ``\printednodename'' \putwordin{} \cite{\printedmanual}% |
5259 |
\else |
\else |
5260 |
% _ (for example) has to be the character _ for the purposes of the |
% _ (for example) has to be the character _ for the purposes of the |
5261 |
% control sequence corresponding to the node, but it has to expand |
% control sequence corresponding to the node, but it has to expand |
5268 |
\setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}% |
\setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}% |
5269 |
\ifdim \wd2 > 0pt \refx{#1-snt}\space\fi |
\ifdim \wd2 > 0pt \refx{#1-snt}\space\fi |
5270 |
}% |
}% |
5271 |
% [mynode], |
% [mynode], |
5272 |
[\printednodename],\space |
[\printednodename],\space |
5273 |
% page 3 |
% page 3 |
5274 |
\turnoffactive \putwordpage\tie\refx{#1-pg}{}% |
\turnoffactive \putwordpage\tie\refx{#1-pg}{}% |
5275 |
\fi |
\fi |
5276 |
|
\endlink |
5277 |
\endgroup} |
\endgroup} |
5278 |
|
|
5279 |
% \dosetq is the interface for calls from other macros |
% \dosetq is the interface for calls from other macros |
5281 |
% Use \normalturnoffactive so that punctuation chars such as underscore |
% Use \normalturnoffactive so that punctuation chars such as underscore |
5282 |
% and backslash work in node names. (\turnoffactive doesn't do \.) |
% and backslash work in node names. (\turnoffactive doesn't do \.) |
5283 |
\def\dosetq#1#2{% |
\def\dosetq#1#2{% |
5284 |
{\let\folio=0 |
{\let\folio=0% |
5285 |
\normalturnoffactive |
\normalturnoffactive |
5286 |
\edef\next{\write\auxfile{\internalsetq{#1}{#2}}}% |
\edef\next{\write\auxfile{\internalsetq{#1}{#2}}}% |
5287 |
\iflinks |
\iflinks |
5358 |
} |
} |
5359 |
|
|
5360 |
% This is the macro invoked by entries in the aux file. |
% This is the macro invoked by entries in the aux file. |
5361 |
% |
% |
5362 |
\def\xrdef#1{\begingroup |
\def\xrdef#1{\begingroup |
5363 |
% Reenable \ as an escape while reading the second argument. |
% Reenable \ as an escape while reading the second argument. |
5364 |
\catcode`\\ = 0 |
\catcode`\\ = 0 |
5510 |
\xspaceskip\z@skip |
\xspaceskip\z@skip |
5511 |
\parindent\defaultparindent |
\parindent\defaultparindent |
5512 |
% |
% |
5513 |
|
\smallfonts \rm |
5514 |
|
% |
5515 |
% Hang the footnote text off the number. |
% Hang the footnote text off the number. |
5516 |
\hang |
\hang |
5517 |
\textindent{\thisfootno}% |
\textindent{\thisfootno}% |
5526 |
\else\let\next\f@t\fi \next} |
\else\let\next\f@t\fi \next} |
5527 |
\def\f@@t{\bgroup\aftergroup\@foot\let\next} |
\def\f@@t{\bgroup\aftergroup\@foot\let\next} |
5528 |
\def\f@t#1{#1\@foot} |
\def\f@t#1{#1\@foot} |
5529 |
\def\@foot{\strut\egroup} |
\def\@foot{\strut\par\egroup} |
5530 |
|
|
5531 |
}%end \catcode `\@=11 |
}%end \catcode `\@=11 |
5532 |
|
|
5585 |
|
|
5586 |
% @image. We use the macros from epsf.tex to support this. |
% @image. We use the macros from epsf.tex to support this. |
5587 |
% If epsf.tex is not installed and @image is used, we complain. |
% If epsf.tex is not installed and @image is used, we complain. |
5588 |
% |
% |
5589 |
% Check for and read epsf.tex up front. If we read it only at @image |
% Check for and read epsf.tex up front. If we read it only at @image |
5590 |
% time, we might be inside a group, and then its definitions would get |
% time, we might be inside a group, and then its definitions would get |
5591 |
% undone and the next image would fail. |
% undone and the next image would fail. |
5598 |
\input epsf.tex |
\input epsf.tex |
5599 |
\fi |
\fi |
5600 |
% |
% |
5601 |
|
% We will only complain once about lack of epsf.tex. |
5602 |
\newif\ifwarnednoepsf |
\newif\ifwarnednoepsf |
5603 |
\newhelp\noepsfhelp{epsf.tex must be installed for images to |
\newhelp\noepsfhelp{epsf.tex must be installed for images to |
5604 |
work. It is also included in the Texinfo distribution, or you can get |
work. It is also included in the Texinfo distribution, or you can get |
5605 |
it from ftp://ftp.tug.org/tex/epsf.tex.} |
it from ftp://tug.org/tex/epsf.tex.} |
5606 |
% |
% |
|
% Only complain once about lack of epsf.tex. |
|
5607 |
\def\image#1{% |
\def\image#1{% |
5608 |
\ifx\epsfbox\undefined |
\ifx\epsfbox\undefined |
5609 |
\ifwarnednoepsf \else |
\ifwarnednoepsf \else |
5621 |
% #2 is (optional) width, #3 is (optional) height. |
% #2 is (optional) width, #3 is (optional) height. |
5622 |
% #4 is just the usual extra ignored arg for parsing this stuff. |
% #4 is just the usual extra ignored arg for parsing this stuff. |
5623 |
\def\imagexxx#1,#2,#3,#4\finish{% |
\def\imagexxx#1,#2,#3,#4\finish{% |
5624 |
% \epsfbox itself resets \epsf?size at each figure. |
\ifpdf |
5625 |
\setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi |
\centerline{\dopdfimage{#1}{#2}{#3}}% |
|
\setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi |
|
|
% If the image is by itself, center it. |
|
|
\ifvmode |
|
|
\nobreak\medskip |
|
|
\nobreak |
|
|
\centerline{\epsfbox{#1.eps}}% |
|
|
\bigbreak |
|
5626 |
\else |
\else |
5627 |
\epsfbox{#1.eps}% |
% \epsfbox itself resets \epsf?size at each figure. |
5628 |
|
\setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi |
5629 |
|
\setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi |
5630 |
|
\begingroup |
5631 |
|
\catcode`\^^M = 5 % in case we're inside an example |
5632 |
|
% If the image is by itself, center it. |
5633 |
|
\ifvmode |
5634 |
|
\nobreak\bigskip |
5635 |
|
% Usually we'll have text after the image which will insert |
5636 |
|
% \parskip glue, so insert it here too to equalize the space |
5637 |
|
% above and below. |
5638 |
|
\nobreak\vskip\parskip |
5639 |
|
\nobreak |
5640 |
|
\centerline{\epsfbox{#1.eps}}% |
5641 |
|
\bigbreak |
5642 |
|
\else |
5643 |
|
% In the middle of a paragraph, no extra space. |
5644 |
|
\epsfbox{#1.eps}% |
5645 |
|
\fi |
5646 |
|
\endgroup |
5647 |
\fi |
\fi |
5648 |
} |
} |
5649 |
|
|
5650 |
|
|
5651 |
\message{paper sizes,} |
\message{localization,} |
5652 |
% And other related parameters. |
% and i18n. |
5653 |
|
|
5654 |
|
% @documentlanguage is usually given very early, just after |
5655 |
|
% @setfilename. If done too late, it may not override everything |
5656 |
|
% properly. Single argument is the language abbreviation. |
5657 |
|
% It would be nice if we could set up a hyphenation file here. |
5658 |
|
% |
5659 |
|
\def\documentlanguage{\parsearg\dodocumentlanguage} |
5660 |
|
\def\dodocumentlanguage#1{% |
5661 |
|
\tex % read txi-??.tex file in plain TeX. |
5662 |
|
% Read the file if it exists. |
5663 |
|
\openin 1 txi-#1.tex |
5664 |
|
\ifeof1 |
5665 |
|
\errhelp = \nolanghelp |
5666 |
|
\errmessage{Cannot read language file txi-#1.tex}% |
5667 |
|
\let\temp = \relax |
5668 |
|
\else |
5669 |
|
\def\temp{\input txi-#1.tex }% |
5670 |
|
\fi |
5671 |
|
\temp |
5672 |
|
\endgroup |
5673 |
|
} |
5674 |
|
\newhelp\nolanghelp{The given language definition file cannot be found or |
5675 |
|
is empty. Maybe you need to install it? In the current directory |
5676 |
|
should work if nowhere else does.} |
5677 |
|
|
5678 |
|
|
5679 |
|
% @documentencoding should change something in TeX eventually, most |
5680 |
|
% likely, but for now just recognize it. |
5681 |
|
\let\documentencoding = \comment |
5682 |
|
|
5683 |
|
|
5684 |
|
% Page size parameters. |
5685 |
|
% |
5686 |
\newdimen\defaultparindent \defaultparindent = 15pt |
\newdimen\defaultparindent \defaultparindent = 15pt |
5687 |
|
|
5688 |
\chapheadingskip = 15pt plus 4pt minus 2pt |
\chapheadingskip = 15pt plus 4pt minus 2pt |
5702 |
% Use TeX 3.0's \emergencystretch to help line breaking, but if we're |
% Use TeX 3.0's \emergencystretch to help line breaking, but if we're |
5703 |
% using an old version of TeX, don't do anything. We want the amount of |
% using an old version of TeX, don't do anything. We want the amount of |
5704 |
% stretch added to depend on the line length, hence the dependence on |
% stretch added to depend on the line length, hence the dependence on |
5705 |
% \hsize. This makes it come to about 9pt for the 8.5x11 format. We |
% \hsize. We call this whenever the paper size is set. |
|
% call this whenever the paper size is set. |
|
5706 |
% |
% |
5707 |
\def\setemergencystretch{% |
\def\setemergencystretch{% |
5708 |
\ifx\emergencystretch\thisisundefined |
\ifx\emergencystretch\thisisundefined |
5709 |
% Allow us to assign to \emergencystretch anyway. |
% Allow us to assign to \emergencystretch anyway. |
5710 |
\def\emergencystretch{\dimen0}% |
\def\emergencystretch{\dimen0}% |
5711 |
\else |
\else |
5712 |
\emergencystretch = \hsize |
\emergencystretch = .15\hsize |
|
\divide\emergencystretch by 45 |
|
5713 |
\fi |
\fi |
5714 |
} |
} |
5715 |
|
|
5802 |
% @pagesizes TEXTHEIGHT[,TEXTWIDTH] |
% @pagesizes TEXTHEIGHT[,TEXTWIDTH] |
5803 |
% Perhaps we should allow setting the margins, \topskip, \parskip, |
% Perhaps we should allow setting the margins, \topskip, \parskip, |
5804 |
% and/or leading, also. Or perhaps we should compute them somehow. |
% and/or leading, also. Or perhaps we should compute them somehow. |
5805 |
% |
% |
5806 |
\def\pagesizes{\parsearg\pagesizesxxx} |
\def\pagesizes{\parsearg\pagesizesxxx} |
5807 |
\def\pagesizesxxx#1{\pagesizesyyy #1,,\finish} |
\def\pagesizesxxx#1{\pagesizesyyy #1,,\finish} |
5808 |
\def\pagesizesyyy#1,#2,#3\finish{{% |
\def\pagesizesyyy#1,#2,#3\finish{{% |
5816 |
}} |
}} |
5817 |
|
|
5818 |
% Set default to letter. |
% Set default to letter. |
5819 |
% |
% |
5820 |
\letterpaper |
\letterpaper |
5821 |
|
|
5822 |
|
|
5823 |
\message{and turning on texinfo input format.} |
\message{and turning on texinfo input format.} |
5824 |
|
|
5825 |
% Define macros to output various characters with catcode for normal text. |
% Define macros to output various characters with catcode for normal text. |
5831 |
\catcode`\<=\other |
\catcode`\<=\other |
5832 |
\catcode`\>=\other |
\catcode`\>=\other |
5833 |
\catcode`\+=\other |
\catcode`\+=\other |
5834 |
|
\catcode`\$=\other |
5835 |
\def\normaldoublequote{"} |
\def\normaldoublequote{"} |
5836 |
\def\normaltilde{~} |
\def\normaltilde{~} |
5837 |
\def\normalcaret{^} |
\def\normalcaret{^} |
5840 |
\def\normalless{<} |
\def\normalless{<} |
5841 |
\def\normalgreater{>} |
\def\normalgreater{>} |
5842 |
\def\normalplus{+} |
\def\normalplus{+} |
5843 |
|
\def\normaldollar{$} |
5844 |
|
|
5845 |
% This macro is used to make a character print one way in ttfont |
% This macro is used to make a character print one way in ttfont |
5846 |
% where it can probably just be output, and another way in other fonts, |
% where it can probably just be output, and another way in other fonts, |
5851 |
% interword stretch (and shrink), and it is reasonable to expect all |
% interword stretch (and shrink), and it is reasonable to expect all |
5852 |
% typewriter fonts to have this, we can check that font parameter. |
% typewriter fonts to have this, we can check that font parameter. |
5853 |
% |
% |
5854 |
\def\ifusingtt#1#2{\ifdim \fontdimen3\the\font=0pt #1\else #2\fi} |
\def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi} |
5855 |
|
|
5856 |
|
% Same as above, but check for italic font. Actually this also catches |
5857 |
|
% non-italic slanted fonts since it is impossible to distinguish them from |
5858 |
|
% italic fonts. But since this is only used by $ and it uses \sl anyway |
5859 |
|
% this is not a problem. |
5860 |
|
\def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi} |
5861 |
|
|
5862 |
% Turn off all special characters except @ |
% Turn off all special characters except @ |
5863 |
% (and those which the user can use as if they were ordinary). |
% (and those which the user can use as if they were ordinary). |
5888 |
\def>{{\tt \gtr}} |
\def>{{\tt \gtr}} |
5889 |
\catcode`\+=\active |
\catcode`\+=\active |
5890 |
\def+{{\tt \char 43}} |
\def+{{\tt \char 43}} |
5891 |
|
\catcode`\$=\active |
5892 |
|
\def${\ifusingit{{\sl\$}}\normaldollar} |
5893 |
%\catcode 27=\active |
%\catcode 27=\active |
5894 |
%\def^^[{$\diamondsuit$} |
%\def^^[{$\diamondsuit$} |
5895 |
|
|
5920 |
% \normalbackslash outputs one backslash in fixed width font. |
% \normalbackslash outputs one backslash in fixed width font. |
5921 |
\def\normalbackslash{{\tt\rawbackslashxx}} |
\def\normalbackslash{{\tt\rawbackslashxx}} |
5922 |
|
|
|
% Say @foo, not \foo, in error messages. |
|
|
\escapechar=`\@ |
|
|
|
|
5923 |
% \catcode 17=0 % Define control-q |
% \catcode 17=0 % Define control-q |
5924 |
\catcode`\\=\active |
\catcode`\\=\active |
5925 |
|
|
5933 |
@let|=@normalverticalbar |
@let|=@normalverticalbar |
5934 |
@let<=@normalless |
@let<=@normalless |
5935 |
@let>=@normalgreater |
@let>=@normalgreater |
5936 |
@let+=@normalplus} |
@let+=@normalplus |
5937 |
|
@let$=@normaldollar} |
5938 |
|
|
5939 |
@def@normalturnoffactive{@let"=@normaldoublequote |
@def@normalturnoffactive{@let"=@normaldoublequote |
5940 |
@let\=@normalbackslash |
@let\=@normalbackslash |
5944 |
@let|=@normalverticalbar |
@let|=@normalverticalbar |
5945 |
@let<=@normalless |
@let<=@normalless |
5946 |
@let>=@normalgreater |
@let>=@normalgreater |
5947 |
@let+=@normalplus} |
@let+=@normalplus |
5948 |
|
@let$=@normaldollar} |
5949 |
|
|
5950 |
% Make _ and + \other characters, temporarily. |
% Make _ and + \other characters, temporarily. |
5951 |
% This is canceled by @fixbackslash. |
% This is canceled by @fixbackslash. |
5964 |
% Also back turn on active characters that might appear in the input |
% Also back turn on active characters that might appear in the input |
5965 |
% file name, in case not using a pre-dumped format. |
% file name, in case not using a pre-dumped format. |
5966 |
% |
% |
5967 |
@gdef@fixbackslash{@ifx\@eatinput @let\ = @normalbackslash @fi |
@gdef@fixbackslash{% |
5968 |
@catcode`+=@active @catcode`@_=@active} |
@ifx\@eatinput @let\ = @normalbackslash @fi |
5969 |
|
@catcode`+=@active |
5970 |
|
@catcode`@_=@active |
5971 |
|
} |
5972 |
|
|
5973 |
% These look ok in all fonts, so just make them not special. The @rm below |
% Say @foo, not \foo, in error messages. |
5974 |
% makes sure that the current font starts out as the newly loaded cmr10 |
@escapechar = `@@ |
5975 |
@catcode`@$=@other @catcode`@%=@other @catcode`@&=@other @catcode`@#=@other |
|
5976 |
|
% These look ok in all fonts, so just make them not special. |
5977 |
|
@catcode`@& = @other |
5978 |
|
@catcode`@# = @other |
5979 |
|
@catcode`@% = @other |
5980 |
|
|
5981 |
|
@c Set initial fonts. |
5982 |
@textfonts |
@textfonts |
5983 |
@rm |
@rm |
5984 |
|
|
5985 |
|
|
5986 |
@c Local variables: |
@c Local variables: |
5987 |
@c eval: (add-hook 'write-file-hooks 'time-stamp) |
@c eval: (add-hook 'write-file-hooks 'time-stamp) |
5988 |
@c page-delimiter: "^\\\\message" |
@c page-delimiter: "^\\\\message" |
5989 |
@c time-stamp-start: "def\\\\texinfoversion{" |
@c time-stamp-start: "def\\\\texinfoversion{" |
5990 |
@c time-stamp-format: "%:y-%02m-%02d" |
@c time-stamp-format: "%:y-%02m-%02d.%02H" |
5991 |
@c time-stamp-end: "}" |
@c time-stamp-end: "}" |
5992 |
@c End: |
@c End: |