comparison man/texinfo.tex @ 50:ee648375d8d6 r19-16b91

Import from CVS: tag r19-16b91
author cvs
date Mon, 13 Aug 2007 08:56:41 +0200
parents ec9a17fef872
children 131b0175ea99
comparison
equal deleted inserted replaced
49:b46643e427ac 50:ee648375d8d6
1 %% TeX macros to handle texinfo files 1 %% TeX macros to handle Texinfo files.
2 %% $Id: texinfo.tex,v 1.3 1997/08/30 03:56:39 steve Exp $
2 3
3 % Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 4 % Copyright (C) 1985, 86, 88, 90, 91, 92, 93,
4 % 94, 95, 1996 Free Software Foundation, Inc. 5 % 94, 95, 96, 97 Free Software Foundation, Inc.
5 6
6 %This texinfo.tex file is free software; you can redistribute it and/or 7 %This texinfo.tex file is free software; you can redistribute it and/or
7 %modify it under the terms of the GNU General Public License as 8 %modify it under the terms of the GNU General Public License as
8 %published by the Free Software Foundation; either version 2, or (at 9 %published by the Free Software Foundation; either version 2, or (at
9 %your option) any later version. 10 %your option) any later version.
33 % Added by gildea November 1993. 34 % Added by gildea November 1993.
34 \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi 35 \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
35 36
36 % This automatically updates the version number based on RCS. 37 % This automatically updates the version number based on RCS.
37 \def\deftexinfoversion$#1: #2 ${\def\texinfoversion{#2}} 38 \def\deftexinfoversion$#1: #2 ${\def\texinfoversion{#2}}
38 \deftexinfoversion$Revision: 1.2 $ 39 \deftexinfoversion$Revision: 1.3 $
39 \message{Loading texinfo package [Version \texinfoversion]:} 40 \message{Loading texinfo package [Version \texinfoversion]:}
40 41
41 % If in a .fmt file, print the version number 42 % If in a .fmt file, print the version number
42 % and turn on active characters that we couldn't do earlier because 43 % and turn on active characters that we couldn't do earlier because
43 % they might have appeared in the input file name. 44 % they might have appeared in the input file name.
57 \let\ptexi=\i 58 \let\ptexi=\i
58 \let\ptexlbrace=\{ 59 \let\ptexlbrace=\{
59 \let\ptexrbrace=\} 60 \let\ptexrbrace=\}
60 \let\ptexstar=\* 61 \let\ptexstar=\*
61 \let\ptext=\t 62 \let\ptext=\t
62 \let\ptextilde=\~
63 63
64 % Be sure we're in horizontal mode when doing a tie, since we make space 64 % Be sure we're in horizontal mode when doing a tie, since we make space
65 % equivalent to this in @example-like environments. Otherwise, a space 65 % equivalent to this in @example-like environments. Otherwise, a space
66 % at the beginning of a line will start with \penalty -- and 66 % at the beginning of a line will start with \penalty -- and
67 % since \penalty is valid in vertical mode, we'd end up putting the 67 % since \penalty is valid in vertical mode, we'd end up putting the
70 % Avoid using \@M directly, because that causes trouble 70 % Avoid using \@M directly, because that causes trouble
71 % if the definition is written into an index file. 71 % if the definition is written into an index file.
72 \global\let\tiepenalty = \@M 72 \global\let\tiepenalty = \@M
73 \gdef\tie{\leavevmode\penalty\tiepenalty\ } 73 \gdef\tie{\leavevmode\penalty\tiepenalty\ }
74 } 74 }
75 \let\~ = \tie % And make it available as @~.
76 75
77 76
78 \message{Basics,} 77 \message{Basics,}
79 \chardef\other=12 78 \chardef\other=12
80 79
100 \def\gobble#1{} 99 \def\gobble#1{}
101 100
102 \hyphenation{ap-pen-dix} 101 \hyphenation{ap-pen-dix}
103 \hyphenation{mini-buf-fer mini-buf-fers} 102 \hyphenation{mini-buf-fer mini-buf-fers}
104 \hyphenation{eshell} 103 \hyphenation{eshell}
104 \hyphenation{white-space}
105 105
106 % Margin to add to right of even pages, to left of odd pages. 106 % Margin to add to right of even pages, to left of odd pages.
107 \newdimen \bindingoffset 107 \newdimen \bindingoffset
108 \newdimen \normaloffset 108 \newdimen \normaloffset
109 \newdimen\pagewidth \newdimen\pageheight 109 \newdimen\pagewidth \newdimen\pageheight
110 110
111 % Sometimes it is convenient to have everything in the transcript file 111 % Sometimes it is convenient to have everything in the transcript file
112 % and nothing on the terminal. We don't just call \tracingall here, 112 % and nothing on the terminal. We don't just call \tracingall here,
113 % since that produces some useless output on the terminal. 113 % since that produces some useless output on the terminal.
117 \tracingpages1 \tracingoutput1 \tracinglostchars1 117 \tracingpages1 \tracingoutput1 \tracinglostchars1
118 \tracingmacros2 \tracingparagraphs1 \tracingrestores1 118 \tracingmacros2 \tracingparagraphs1 \tracingrestores1
119 \showboxbreadth\maxdimen\showboxdepth\maxdimen 119 \showboxbreadth\maxdimen\showboxdepth\maxdimen
120 }% 120 }%
121 121
122 %---------------------Begin change----------------------- 122 % For @cropmarks command.
123 % 123 % Do @cropmarks to get crop marks.
124 %%%% For @cropmarks command. 124 %
125 % Dimensions to add cropmarks at corners Added by P. A. MacKay, 12 Nov. 1986 125 \newif\ifcropmarks
126 \let\cropmarks = \cropmarkstrue
127 %
128 % Dimensions to add cropmarks at corners.
129 % Added by P. A. MacKay, 12 Nov. 1986
126 % 130 %
127 \newdimen\cornerlong \newdimen\cornerthick 131 \newdimen\cornerlong \newdimen\cornerthick
128 \newdimen \topandbottommargin 132 \newdimen\topandbottommargin
129 \newdimen \outerhsize \newdimen \outervsize 133 \newdimen\outerhsize \newdimen\outervsize
130 \cornerlong=1pc\cornerthick=.3pt % These set size of cropmarks 134 \cornerlong=1pc\cornerthick=.3pt % These set size of cropmarks
131 \outerhsize=7in 135 \outerhsize=7in
132 %\outervsize=9.5in 136 %\outervsize=9.5in
133 % Alternative @smallbook page size is 9.25in 137 % Alternative @smallbook page size is 9.25in
134 \outervsize=9.25in 138 \outervsize=9.25in
135 \topandbottommargin=.75in 139 \topandbottommargin=.75in
136 % 140
137 %---------------------End change----------------------- 141 % Main output routine.
142 \chardef\PAGE = 255
143 \output = {\onepageout{\pagecontents\PAGE}}
144
145 \newbox\headlinebox
146 \newbox\footlinebox
138 147
139 % \onepageout takes a vbox as an argument. Note that \pagecontents 148 % \onepageout takes a vbox as an argument. Note that \pagecontents
140 % does insertions, but you have to call it yourself. 149 % does insertions, but you have to call it yourself.
141 \chardef\PAGE=255 \output={\onepageout{\pagecontents\PAGE}}
142 \def\onepageout#1{% 150 \def\onepageout#1{%
143 \hoffset=\normaloffset 151 \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi
152 %
144 \ifodd\pageno \advance\hoffset by \bindingoffset 153 \ifodd\pageno \advance\hoffset by \bindingoffset
145 \else \advance\hoffset by -\bindingoffset\fi 154 \else \advance\hoffset by -\bindingoffset\fi
155 %
156 % Do this outside of the \shipout so @code etc. will be expanded in
157 % the headline as they should be, not taken literally (outputting ''code).
158 \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}%
159 \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}%
160 %
146 {% 161 {%
147 \escapechar = `\\ % use backslash in output files. 162 % Have to do this stuff outside the \shipout because we want it to
148 \indexdummies 163 % take effect in \write's, yet the group defined by the \vbox ends
164 % before the \shipout runs.
165 %
166 \escapechar = `\\ % use backslash in output files.
167 \indexdummies % don't expand commands in the output.
168 \normalturnoffactive % \ in index entries must not stay \, e.g., if
169 % the page break happens to be in the middle of an example.
149 \shipout\vbox{% 170 \shipout\vbox{%
150 {\let\hsize=\pagewidth \makeheadline}% 171 \ifcropmarks \vbox to \outervsize\bgroup
172 \hsize = \outerhsize
173 \line{\ewtop\hfil\ewtop}%
174 \nointerlineskip
175 \line{%
176 \vbox{\moveleft\cornerthick\nstop}%
177 \hfill
178 \vbox{\moveright\cornerthick\nstop}%
179 }%
180 \vskip\topandbottommargin
181 \line\bgroup
182 \hfil % center the page within the outer (page) hsize.
183 \ifodd\pageno\hskip\bindingoffset\fi
184 \vbox\bgroup
185 \fi
186 %
187 \unvbox\headlinebox
151 \pagebody{#1}% 188 \pagebody{#1}%
152 {\let\hsize=\pagewidth \makefootline}% 189 \ifdim\ht\footlinebox > 0pt
153 }% 190 % Only leave this space if the footline is nonempty.
154 }% 191 % (We lessened \vsize for it in \oddfootingxxx.)
192 % The \baselineskip=24pt in plain's \makefootline has no effect.
193 \vskip 2\baselineskip
194 \unvbox\footlinebox
195 \fi
196 %
197 \ifcropmarks
198 \egroup % end of \vbox\bgroup
199 \hfil\egroup % end of (centering) \line\bgroup
200 \vskip\topandbottommargin plus1fill minus1fill
201 \boxmaxdepth = \cornerthick
202 \line{%
203 \vbox{\moveleft\cornerthick\nsbot}%
204 \hfill
205 \vbox{\moveright\cornerthick\nsbot}%
206 }%
207 \nointerlineskip
208 \line{\ewbot\hfil\ewbot}%
209 \egroup % \vbox from first cropmarks clause
210 \fi
211 }% end of \shipout\vbox
212 }% end of group with \turnoffactive
155 \advancepageno 213 \advancepageno
156 \ifnum\outputpenalty>-20000 \else\dosupereject\fi 214 \ifnum\outputpenalty>-20000 \else\dosupereject\fi
157 } 215 }
158
159 %%%% For @cropmarks command %%%%
160
161 % Here is a modification of the main output routine for Near East Publications
162 % This provides right-angle cropmarks at all four corners.
163 % The contents of the page are centerlined into the cropmarks,
164 % and any desired binding offset is added as an \hskip on either
165 % site of the centerlined box. (P. A. MacKay, 12 November, 1986)
166 %
167 \def\croppageout#1{\hoffset=0pt % make sure this doesn't mess things up
168 {\escapechar=`\\\relax % makes sure backslash is used in output files.
169 \shipout
170 \vbox to \outervsize{\hsize=\outerhsize
171 \vbox{\line{\ewtop\hfill\ewtop}}
172 \nointerlineskip
173 \line{\vbox{\moveleft\cornerthick\nstop}
174 \hfill
175 \vbox{\moveright\cornerthick\nstop}}
176 \vskip \topandbottommargin
177 \centerline{\ifodd\pageno\hskip\bindingoffset\fi
178 \vbox{
179 {\let\hsize=\pagewidth \makeheadline}
180 \pagebody{#1}
181 {\let\hsize=\pagewidth \makefootline}}
182 \ifodd\pageno\else\hskip\bindingoffset\fi}
183 \vskip \topandbottommargin plus1fill minus1fill
184 \boxmaxdepth\cornerthick
185 \line{\vbox{\moveleft\cornerthick\nsbot}
186 \hfill
187 \vbox{\moveright\cornerthick\nsbot}}
188 \nointerlineskip
189 \vbox{\line{\ewbot\hfill\ewbot}}
190 }}
191 \advancepageno
192 \ifnum\outputpenalty>-20000 \else\dosupereject\fi}
193 %
194 % Do @cropmarks to get crop marks
195 \def\cropmarks{\let\onepageout=\croppageout }
196 216
197 \newinsert\margin \dimen\margin=\maxdimen 217 \newinsert\margin \dimen\margin=\maxdimen
198 218
199 \def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}} 219 \def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}}
200 {\catcode`\@ =11 220 {\catcode`\@ =11
205 \dimen@=\dp#1 \unvbox#1 225 \dimen@=\dp#1 \unvbox#1
206 \ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi 226 \ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi
207 \ifr@ggedbottom \kern-\dimen@ \vfil \fi} 227 \ifr@ggedbottom \kern-\dimen@ \vfil \fi}
208 } 228 }
209 229
210 %
211 % Here are the rules for the cropmarks. Note that they are 230 % Here are the rules for the cropmarks. Note that they are
212 % offset so that the space between them is truly \outerhsize or \outervsize 231 % offset so that the space between them is truly \outerhsize or \outervsize
213 % (P. A. MacKay, 12 November, 1986) 232 % (P. A. MacKay, 12 November, 1986)
214 % 233 %
215 \def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong} 234 \def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong}
715 734
716 % Ignore @ignore ... @end ignore. 735 % Ignore @ignore ... @end ignore.
717 % 736 %
718 \def\ignore{\doignore{ignore}} 737 \def\ignore{\doignore{ignore}}
719 738
720 % Also ignore @ifinfo, @ifhtml, @html, @menu, and @direntry text. 739 % Ignore @ifinfo, @ifhtml, @ifnottex, @html, @menu, and @direntry text.
721 % 740 %
722 \def\ifinfo{\doignore{ifinfo}} 741 \def\ifinfo{\doignore{ifinfo}}
723 \def\ifhtml{\doignore{ifhtml}} 742 \def\ifhtml{\doignore{ifhtml}}
743 \def\ifnottex{\doignore{ifnottex}}
724 \def\html{\doignore{html}} 744 \def\html{\doignore{html}}
725 \def\menu{\doignore{menu}} 745 \def\menu{\doignore{menu}}
726 \def\direntry{\doignore{direntry}} 746 \def\direntry{\doignore{direntry}}
727 747
728 % Also ignore @macro ... @end macro. The user must run texi2dvi, 748 % Also ignore @macro ... @end macro. The user must run texi2dvi,
744 % Define a command to swallow text until we reach `@end #1'. 764 % Define a command to swallow text until we reach `@end #1'.
745 \long\def\doignoretext##1\end #1{\enddoignore}% 765 \long\def\doignoretext##1\end #1{\enddoignore}%
746 % 766 %
747 % Make sure that spaces turn into tokens that match what \doignoretext wants. 767 % Make sure that spaces turn into tokens that match what \doignoretext wants.
748 \catcode32 = 10 768 \catcode32 = 10
769 %
770 % Ignore braces, too, so mismatched braces don't cause trouble.
771 \catcode`\{ = 9
772 \catcode`\} = 9
749 % 773 %
750 % And now expand that command. 774 % And now expand that command.
751 \doignoretext 775 \doignoretext
752 } 776 }
753 777
836 % 860 %
837 % Do minimal line-breaking. 861 % Do minimal line-breaking.
838 \pretolerance = 10000 862 \pretolerance = 10000
839 % 863 %
840 % Do not execute instructions in @tex 864 % Do not execute instructions in @tex
841 \def\tex{\doignore{tex}} 865 \def\tex{\doignore{tex}}%
842 } 866 }
843 867
844 % @set VAR sets the variable VAR to an empty value. 868 % @set VAR sets the variable VAR to an empty value.
845 % @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE. 869 % @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
846 % 870 %
848 % empty), we can't just use \parsearg; we have to insert a space of our 872 % empty), we can't just use \parsearg; we have to insert a space of our
849 % own to delimit the rest of the line, and then take it out again if we 873 % own to delimit the rest of the line, and then take it out again if we
850 % didn't need it. Make sure the catcode of space is correct to avoid 874 % didn't need it. Make sure the catcode of space is correct to avoid
851 % losing inside @example, for instance. 875 % losing inside @example, for instance.
852 % 876 %
853 \def\set{\begingroup\catcode` =10 \parsearg\setxxx} 877 \def\set{\begingroup\catcode` =10
878 \catcode`\-=12 \catcode`\_=12 % Allow - and _ in VAR.
879 \parsearg\setxxx}
854 \def\setxxx#1{\setyyy#1 \endsetyyy} 880 \def\setxxx#1{\setyyy#1 \endsetyyy}
855 \def\setyyy#1 #2\endsetyyy{% 881 \def\setyyy#1 #2\endsetyyy{%
856 \def\temp{#2}% 882 \def\temp{#2}%
857 \ifx\temp\empty \global\expandafter\let\csname SET#1\endcsname = \empty 883 \ifx\temp\empty \global\expandafter\let\csname SET#1\endcsname = \empty
858 \else \setzzz{#1}#2\endsetzzz % Remove the trailing space \setxxx inserted. 884 \else \setzzz{#1}#2\endsetzzz % Remove the trailing space \setxxx inserted.
869 \def\clear{\parsearg\clearxxx} 895 \def\clear{\parsearg\clearxxx}
870 \def\clearxxx#1{\global\expandafter\let\csname SET#1\endcsname=\relax} 896 \def\clearxxx#1{\global\expandafter\let\csname SET#1\endcsname=\relax}
871 897
872 % @value{foo} gets the text saved in variable foo. 898 % @value{foo} gets the text saved in variable foo.
873 % 899 %
874 \def\value#1{\expandafter 900 \def\value{\begingroup
875 \ifx\csname SET#1\endcsname\relax 901 \catcode`\-=12 \catcode`\_=12 % Allow - and _ in VAR.
876 {\{No value for ``#1''\}} 902 \valuexxx}
877 \else \csname SET#1\endcsname \fi} 903 \def\valuexxx#1{%
904 \expandafter\ifx\csname SET#1\endcsname\relax
905 {\{No value for ``#1''\}}%
906 \else
907 \csname SET#1\endcsname
908 \fi
909 \endgroup}
878 910
879 % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined 911 % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
880 % with @set. 912 % with @set.
881 % 913 %
882 \def\ifset{\parsearg\ifsetxxx} 914 \def\ifset{\parsearg\ifsetxxx}
904 } 936 }
905 \def\ifclearsucceed{\conditionalsucceed{ifclear}} 937 \def\ifclearsucceed{\conditionalsucceed{ifclear}}
906 \def\ifclearfail{\nestedignore{ifclear}} 938 \def\ifclearfail{\nestedignore{ifclear}}
907 \defineunmatchedend{ifclear} 939 \defineunmatchedend{ifclear}
908 940
909 % @iftex always succeeds; we read the text following, through @end 941 % @iftex, @ifnothtml, @ifnotinfo always succeed; we read the text
910 % iftex). But `@end iftex' should be valid only after an @iftex. 942 % following, through the first @end iftex (etc.). Make `@end iftex'
943 % (etc.) valid only after an @iftex.
911 % 944 %
912 \def\iftex{\conditionalsucceed{iftex}} 945 \def\iftex{\conditionalsucceed{iftex}}
946 \def\ifnothtml{\conditionalsucceed{ifnothtml}}
947 \def\ifnotinfo{\conditionalsucceed{ifnotinfo}}
913 \defineunmatchedend{iftex} 948 \defineunmatchedend{iftex}
949 \defineunmatchedend{ifnothtml}
950 \defineunmatchedend{ifnotinfo}
914 951
915 % We can't just want to start a group at @iftex (for example) and end it 952 % We can't just want to start a group at @iftex (for example) and end it
916 % at @end iftex, since then @set commands inside the conditional have no 953 % at @end iftex, since then @set commands inside the conditional have no
917 % effect (they'd get reverted at the end of the group). So we must 954 % effect (they'd get reverted at the end of the group). So we must
918 % define \Eiftex to redefine itself to be its previous value. (We can't 955 % define \Eiftex to redefine itself to be its previous value. (We can't
984 \readauxfile 1021 \readauxfile
985 \opencontents 1022 \opencontents
986 \openindices 1023 \openindices
987 \fixbackslash % Turn off hack to swallow `\input texinfo'. 1024 \fixbackslash % Turn off hack to swallow `\input texinfo'.
988 \global\let\setfilename=\comment % Ignore extra @setfilename cmds. 1025 \global\let\setfilename=\comment % Ignore extra @setfilename cmds.
1026 %
1027 % If texinfo.cnf is present on the system, read it.
1028 % Useful for site-wide @afourpaper, etc.
1029 % Just to be on the safe side, close the input stream before the \input.
1030 \openin 1 texinfo.cnf
1031 \ifeof1 \let\temp=\relax \else \def\temp{\input texinfo.cnf }\fi
1032 \closein1
1033 \temp
1034 %
989 \comment % Ignore the actual filename. 1035 \comment % Ignore the actual filename.
990 } 1036 }
991 1037
992 % @bye. 1038 % @bye.
993 \outer\def\bye{\pagealignmacro\tracingstats=1\ptexend} 1039 \outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
1019 \let\li = \sf % Sometimes we call it \li, not \sf. 1065 \let\li = \sf % Sometimes we call it \li, not \sf.
1020 1066
1021 % We don't need math for this one. 1067 % We don't need math for this one.
1022 \def\ttsl{\tenttsl} 1068 \def\ttsl{\tenttsl}
1023 1069
1024 %% Try out Computer Modern fonts at \magstephalf 1070 % Use Computer Modern fonts at \magstephalf (11pt).
1025 \let\mainmagstep=\magstephalf 1071 \newcount\mainmagstep
1072 \mainmagstep=\magstephalf
1026 1073
1027 % Set the font macro #1 to the font named #2, adding on the 1074 % Set the font macro #1 to the font named #2, adding on the
1028 % specified font prefix (normally `cm'). 1075 % specified font prefix (normally `cm').
1029 % #3 is the font's design size, #4 is a scale factor 1076 % #3 is the font's design size, #4 is a scale factor
1030 \def\setfont#1#2#3#4{\font#1=\fontprefix#2#3 scaled #4} 1077 \def\setfont#1#2#3#4{\font#1=\fontprefix#2#3 scaled #4}
1092 \let\indbf=\indrm 1139 \let\indbf=\indrm
1093 \setfont\indsc\scshape{10}{900} 1140 \setfont\indsc\scshape{10}{900}
1094 \font\indi=cmmi9 1141 \font\indi=cmmi9
1095 \font\indsy=cmsy9 1142 \font\indsy=cmsy9
1096 1143
1144 % Fonts for title page:
1145 \setfont\titlerm\rmbshape{12}{\magstep3}
1146 \setfont\titleit\itbshape{10}{\magstep4}
1147 \setfont\titlesl\slbshape{10}{\magstep4}
1148 \setfont\titlett\ttbshape{12}{\magstep3}
1149 \setfont\titlettsl\ttslshape{10}{\magstep4}
1150 \setfont\titlesf\sfbshape{17}{\magstep1}
1151 \let\titlebf=\titlerm
1152 \setfont\titlesc\scbshape{10}{\magstep4}
1153 \font\titlei=cmmi12 scaled \magstep3
1154 \font\titlesy=cmsy10 scaled \magstep4
1155 \def\authorrm{\secrm}
1156
1097 % Chapter (and unnumbered) fonts (17.28pt). 1157 % Chapter (and unnumbered) fonts (17.28pt).
1098 \setfont\chaprm\rmbshape{12}{\magstep2} 1158 \setfont\chaprm\rmbshape{12}{\magstep2}
1099 \setfont\chapit\itbshape{10}{\magstep3} 1159 \setfont\chapit\itbshape{10}{\magstep3}
1100 \setfont\chapsl\slbshape{10}{\magstep3} 1160 \setfont\chapsl\slbshape{10}{\magstep3}
1101 \setfont\chaptt\ttbshape{12}{\magstep2} 1161 \setfont\chaptt\ttbshape{12}{\magstep2}
1102 \setfont\chapttsl\ttslshape{10}{\magstep3} 1162 \setfont\chapttsl\ttslshape{10}{\magstep3}
1103 \setfont\chapsf\sfbshape{12}{\magstep2} 1163 \setfont\chapsf\sfbshape{17}{1000}
1104 \let\chapbf=\chaprm 1164 \let\chapbf=\chaprm
1105 \setfont\chapsc\scbshape{10}{\magstep3} 1165 \setfont\chapsc\scbshape{10}{\magstep3}
1106 \font\chapi=cmmi12 scaled \magstep2 1166 \font\chapi=cmmi12 scaled \magstep2
1107 \font\chapsy=cmsy10 scaled \magstep3 1167 \font\chapsy=cmsy10 scaled \magstep3
1108 1168
1135 % Subsection fonts (13.15pt). 1195 % Subsection fonts (13.15pt).
1136 \setfont\ssecrm\rmbshape{12}{\magstephalf} 1196 \setfont\ssecrm\rmbshape{12}{\magstephalf}
1137 \setfont\ssecit\itbshape{10}{1315} 1197 \setfont\ssecit\itbshape{10}{1315}
1138 \setfont\ssecsl\slbshape{10}{1315} 1198 \setfont\ssecsl\slbshape{10}{1315}
1139 \setfont\ssectt\ttbshape{12}{\magstephalf} 1199 \setfont\ssectt\ttbshape{12}{\magstephalf}
1140 \setfont\ssecttsl\ttslshape{10}{\magstep1} 1200 \setfont\ssecttsl\ttslshape{10}{1315}
1141 \setfont\ssecsf\sfbshape{12}{\magstephalf} 1201 \setfont\ssecsf\sfbshape{12}{\magstephalf}
1142 \let\ssecbf\ssecrm 1202 \let\ssecbf\ssecrm
1143 \setfont\ssecsc\scbshape{10}{\magstep1} 1203 \setfont\ssecsc\scbshape{10}{\magstep1}
1144 \font\sseci=cmmi12 scaled \magstephalf 1204 \font\sseci=cmmi12 scaled \magstephalf
1145 \font\ssecsy=cmsy10 scaled \magstep1 1205 \font\ssecsy=cmsy10 scaled 1315
1146 % The smallcaps and symbol fonts should actually be scaled \magstep1.5, 1206 % The smallcaps and symbol fonts should actually be scaled \magstep1.5,
1147 % but that is not a standard magnification. 1207 % but that is not a standard magnification.
1148
1149 % Fonts for title page:
1150 \setfont\titlerm\rmbshape{12}{\magstep3}
1151 \let\authorrm = \secrm
1152 1208
1153 % In order for the font changes to affect most math symbols and letters, 1209 % In order for the font changes to affect most math symbols and letters,
1154 % we have to define the \textfont of the standard families. Since 1210 % we have to define the \textfont of the standard families. Since
1155 % texinfo doesn't allow for producing subscripts and superscripts, we 1211 % texinfo doesn't allow for producing subscripts and superscripts, we
1156 % don't bother to reset \scriptfont and \scriptscriptfont (which would 1212 % don't bother to reset \scriptfont and \scriptscriptfont (which would
1172 \def\textfonts{% 1228 \def\textfonts{%
1173 \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl 1229 \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl
1174 \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc 1230 \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
1175 \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy \let\tenttsl=\textttsl 1231 \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy \let\tenttsl=\textttsl
1176 \resetmathfonts} 1232 \resetmathfonts}
1233 \def\titlefonts{%
1234 \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl
1235 \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc
1236 \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy
1237 \let\tenttsl=\titlettsl
1238 \resetmathfonts \setleading{25pt}}
1239 \def\titlefont#1{{\titlefonts #1}}
1177 \def\chapfonts{% 1240 \def\chapfonts{%
1178 \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl 1241 \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
1179 \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc 1242 \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
1180 \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy \let\tenttsl=\chapttsl 1243 \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy \let\tenttsl=\chapttsl
1181 \resetmathfonts \setleading{19pt}} 1244 \resetmathfonts \setleading{19pt}}
1249 % The old definition, with no lozenge: 1312 % The old definition, with no lozenge:
1250 %\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null} 1313 %\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null}
1251 \def\ctrl #1{{\tt \rawbackslash \hat}#1} 1314 \def\ctrl #1{{\tt \rawbackslash \hat}#1}
1252 1315
1253 \let\file=\samp 1316 \let\file=\samp
1254 \let\url=\samp % perhaps include a hypertex \special eventually
1255 \def\email#1{$\langle${\tt #1}$\rangle$}
1256 1317
1257 % @code is a modification of @t, 1318 % @code is a modification of @t,
1258 % which makes spaces the same size as normal in the surrounding text. 1319 % which makes spaces the same size as normal in the surrounding text.
1259 \def\tclose#1{% 1320 \def\tclose#1{%
1260 {% 1321 {%
1287 % and arrange explicitly to hyphenate at a dash. 1348 % and arrange explicitly to hyphenate at a dash.
1288 % -- rms. 1349 % -- rms.
1289 { 1350 {
1290 \catcode`\-=\active 1351 \catcode`\-=\active
1291 \catcode`\_=\active 1352 \catcode`\_=\active
1353 \catcode`\|=\active
1292 \global\def\code{\begingroup \catcode`\-=\active \let-\codedash \catcode`\_=\active \let_\codeunder \codex} 1354 \global\def\code{\begingroup \catcode`\-=\active \let-\codedash \catcode`\_=\active \let_\codeunder \codex}
1293 % The following is used by \doprintindex to insure that long function names 1355 % The following is used by \doprintindex to insure that long function names
1294 % wrap around. It is necessary for - and _ to be active before the index is 1356 % wrap around. It is necessary for - and _ to be active before the index is
1295 % read from the file, as \entry parses the arguments long before \code is 1357 % read from the file, as \entry parses the arguments long before \code is
1296 % ever called. -- mycroft 1358 % ever called. -- mycroft
1297 \global\def\indexbreaks{\catcode`\-=\active \let-\realdash \catcode`\_=\active \let_\realunder} 1359 % _ is always active; and it shouldn't be \let = to an _ that is a
1360 % subscript character anyway. Then, @cindex @samp{_} (for example)
1361 % fails. --karl
1362 \global\def\indexbreaks{%
1363 \catcode`\-=\active \let-\realdash
1364 }
1298 } 1365 }
1299 1366
1300 \def\realdash{-} 1367 \def\realdash{-}
1301 \def\realunder{_}
1302 \def\codedash{-\discretionary{}{}{}} 1368 \def\codedash{-\discretionary{}{}{}}
1303 \def\codeunder{\normalunderscore\discretionary{}{}{}} 1369 \def\codeunder{\ifusingtt{\normalunderscore\discretionary{}{}{}}{\_}}
1304 \def\codex #1{\tclose{#1}\endgroup} 1370 \def\codex #1{\tclose{#1}\endgroup}
1305 1371
1306 %\let\exp=\tclose %Was temporary 1372 %\let\exp=\tclose %Was temporary
1307 1373
1308 % @kbd is like @code, except that if the argument is just one @key command, 1374 % @kbd is like @code, except that if the argument is just one @key command,
1309 % then @kbd has no effect. 1375 % then @kbd has no effect.
1310 % 1376
1377 % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
1378 % `example' (@kbd uses ttsl only inside of @example and friends),
1379 % or `code' (@kbd uses normal tty font always).
1380 \def\kbdinputstyle{\parsearg\kbdinputstylexxx}
1381 \def\kbdinputstylexxx#1{%
1382 \def\arg{#1}%
1383 \ifx\arg\worddistinct
1384 \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}%
1385 \else\ifx\arg\wordexample
1386 \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
1387 \else\ifx\arg\wordcode
1388 \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
1389 \fi\fi\fi
1390 }
1391 \def\worddistinct{distinct}
1392 \def\wordexample{example}
1393 \def\wordcode{code}
1394
1395 % Default is kbdinputdistinct. (Too much of a hassle to call the macro,
1396 % the catcodes are wrong for parsearg to work.)
1397 \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}
1398
1311 \def\xkey{\key} 1399 \def\xkey{\key}
1312 \def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}% 1400 \def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}%
1313 \ifx\one\xkey\ifx\threex\three \key{#2}% 1401 \ifx\one\xkey\ifx\threex\three \key{#2}%
1314 \else{\tclose{\ttsl\look}}\fi 1402 \else{\tclose{\kbdfont\look}}\fi
1315 \else{\tclose{\ttsl\look}}\fi} 1403 \else{\tclose{\kbdfont\look}}\fi}
1404
1405 % @url. Quotes do not seem necessary, so use \code.
1406 \let\url=\code
1407
1408 % @uref (abbreviation for `urlref') takes an optional second argument
1409 % specifying the text to display. First (mandatory) arg is the url.
1410 % Perhaps eventually put in a hypertex \special here.
1411 %
1412 \def\uref#1{\urefxxx #1,,\finish}
1413 \def\urefxxx#1,#2,#3\finish{%
1414 \setbox0 = \hbox{\ignorespaces #2}%
1415 \ifdim\wd0 > 0pt
1416 \unhbox0\ (\code{#1})%
1417 \else
1418 \code{#1}%
1419 \fi
1420 }
1421
1422 % rms does not like the angle brackets --karl, 17may97.
1423 % So now @email is just like @uref.
1424 %\def\email#1{$\langle${\tt #1}$\rangle$}
1425 \let\email=\uref
1316 1426
1317 % Check if we are currently using a typewriter font. Since all the 1427 % Check if we are currently using a typewriter font. Since all the
1318 % Computer Modern typewriter fonts have zero interword stretch (and 1428 % Computer Modern typewriter fonts have zero interword stretch (and
1319 % shrink), and it is reasonable to expect all typewriter fonts to have 1429 % shrink), and it is reasonable to expect all typewriter fonts to have
1320 % this property, we can check that font parameter. 1430 % this property, we can check that font parameter.
1321 % 1431 %
1322 \def\ifmonospace{\ifdim\fontdimen3\font=0pt } 1432 \def\ifmonospace{\ifdim\fontdimen3\font=0pt }
1323 1433
1324 % Typeset a dimension, e.g., `in' or `pt'. The only reason for the 1434 % Typeset a dimension, e.g., `in' or `pt'. The only reason for the
1325 % argument is to make the input look right: @dmn{pt} instead of 1435 % argument is to make the input look right: @dmn{pt} instead of
1326 % @dmn{}pt. 1436 % @dmn{}pt.
1347 1457
1348 \newskip\titlepagetopglue \titlepagetopglue = 1.5in 1458 \newskip\titlepagetopglue \titlepagetopglue = 1.5in
1349 \newskip\titlepagebottomglue \titlepagebottomglue = 2pc 1459 \newskip\titlepagebottomglue \titlepagebottomglue = 2pc
1350 1460
1351 % First the title page. Must do @settitle before @titlepage. 1461 % First the title page. Must do @settitle before @titlepage.
1352 \def\titlefont#1{{\titlerm #1}}
1353
1354 \newif\ifseenauthor 1462 \newif\ifseenauthor
1355 \newif\iffinishedtitlepage 1463 \newif\iffinishedtitlepage
1356 1464
1357 \def\shorttitlepage{\parsearg\shorttitlepagezzz} 1465 \def\shorttitlepage{\parsearg\shorttitlepagezzz}
1358 \def\shorttitlepagezzz #1{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}% 1466 \def\shorttitlepagezzz #1{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}%
1370 % Leave some space at the very top of the page. 1478 % Leave some space at the very top of the page.
1371 \vglue\titlepagetopglue 1479 \vglue\titlepagetopglue
1372 % 1480 %
1373 % Now you can print the title using @title. 1481 % Now you can print the title using @title.
1374 \def\title{\parsearg\titlezzz}% 1482 \def\title{\parsearg\titlezzz}%
1375 \def\titlezzz##1{\leftline{\titlefont{##1}} 1483 \def\titlezzz##1{\leftline{\titlefonts\rm ##1}
1376 % print a rule at the page bottom also. 1484 % print a rule at the page bottom also.
1377 \finishedtitlepagefalse 1485 \finishedtitlepagefalse
1378 \vskip4pt \hrule height 4pt width \hsize \vskip4pt}% 1486 \vskip4pt \hrule height 4pt width \hsize \vskip4pt}%
1379 % No rule at page bottom unless we print one at the top with @title. 1487 % No rule at page bottom unless we print one at the top with @title.
1380 \finishedtitlepagetrue 1488 \finishedtitlepagetrue
1459 1567
1460 \gdef\oddheadingxxx #1{\oddheadingyyy #1@|@|@|@|\finish} 1568 \gdef\oddheadingxxx #1{\oddheadingyyy #1@|@|@|@|\finish}
1461 \gdef\oddheadingyyy #1@|#2@|#3@|#4\finish{% 1569 \gdef\oddheadingyyy #1@|#2@|#3@|#4\finish{%
1462 \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} 1570 \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
1463 1571
1464 \gdef\everyheadingxxx #1{\everyheadingyyy #1@|@|@|@|\finish} 1572 \gdef\everyheadingxxx#1{\oddheadingxxx{#1}\evenheadingxxx{#1}}%
1465 \gdef\everyheadingyyy #1@|#2@|#3@|#4\finish{%
1466 \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}
1467 \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
1468 1573
1469 \gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|\finish} 1574 \gdef\evenfootingxxx #1{\evenfootingyyy #1@|@|@|@|\finish}
1470 \gdef\evenfootingyyy #1@|#2@|#3@|#4\finish{% 1575 \gdef\evenfootingyyy #1@|#2@|#3@|#4\finish{%
1471 \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} 1576 \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
1472 1577
1473 \gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|\finish} 1578 \gdef\oddfootingxxx #1{\oddfootingyyy #1@|@|@|@|\finish}
1474 \gdef\oddfootingyyy #1@|#2@|#3@|#4\finish{% 1579 \gdef\oddfootingyyy #1@|#2@|#3@|#4\finish{%
1475 \global\oddfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} 1580 \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}%
1476 1581 %
1477 \gdef\everyfootingxxx #1{\everyfootingyyy #1@|@|@|@|\finish} 1582 % Leave some space for the footline. Hopefully ok to assume
1478 \gdef\everyfootingyyy #1@|#2@|#3@|#4\finish{% 1583 % @evenfooting will not be used by itself.
1479 \global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}} 1584 \global\advance\pageheight by -\baselineskip
1480 \global\oddfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} 1585 \global\advance\vsize by -\baselineskip
1586 }
1587
1588 \gdef\everyfootingxxx#1{\oddfootingxxx{#1}\evenfootingxxx{#1}}
1481 % 1589 %
1482 }% unbind the catcode of @. 1590 }% unbind the catcode of @.
1483 1591
1484 % @headings double turns headings on for double-sided printing. 1592 % @headings double turns headings on for double-sided printing.
1485 % @headings single turns headings on for single-sided printing. 1593 % @headings single turns headings on for single-sided printing.
1859 % Definition of @item while inside @itemize. 1967 % Definition of @item while inside @itemize.
1860 1968
1861 \def\itemizeitem{% 1969 \def\itemizeitem{%
1862 \advance\itemno by 1 1970 \advance\itemno by 1
1863 {\let\par=\endgraf \smallbreak}% 1971 {\let\par=\endgraf \smallbreak}%
1864 \ifhmode \errmessage{\in hmode at itemizeitem}\fi 1972 \ifhmode \errmessage{In hmode at itemizeitem}\fi
1865 {\parskip=0in \hskip 0pt 1973 {\parskip=0in \hskip 0pt
1866 \hbox to 0pt{\hss \itemcontents\hskip \itemmargin}% 1974 \hbox to 0pt{\hss \itemcontents\hskip \itemmargin}%
1867 \vadjust{\penalty 1200}}% 1975 \vadjust{\penalty 1200}}%
1868 \flushcr} 1976 \flushcr}
1869 1977
1877 1985
1878 % Table can continue over pages but will only break between lines. 1986 % Table can continue over pages but will only break between lines.
1879 1987
1880 % To make preamble: 1988 % To make preamble:
1881 % 1989 %
1882 % Either define widths of columns in terms of percent of \hsize: 1990 % Either define widths of columns in terms of percent of \hsize:
1883 % @multitable @columnfractions .25 .3 .45 1991 % @multitable @columnfractions .25 .3 .45
1884 % @item ... 1992 % @item ...
1885 % 1993 %
1886 % Numbers following @columnfractions are the percent of the total 1994 % Numbers following @columnfractions are the percent of the total
1887 % current hsize to be used for each column. You may use as many 1995 % current hsize to be used for each column. You may use as many
1895 % 2003 %
1896 % For those who want to use more than one line's worth of words in 2004 % For those who want to use more than one line's worth of words in
1897 % the preamble, break the line within one argument and it 2005 % the preamble, break the line within one argument and it
1898 % will parse correctly, i.e., 2006 % will parse correctly, i.e.,
1899 % 2007 %
1900 % @multitable {Column 1 template} {Column 2 template} {Column 3 2008 % @multitable {Column 1 template} {Column 2 template} {Column 3
1901 % template} 2009 % template}
1902 % Not: 2010 % Not:
1903 % @multitable {Column 1 template} {Column 2 template} 2011 % @multitable {Column 1 template} {Column 2 template}
1904 % {Column 3 template} 2012 % {Column 3 template}
1905 2013
1906 % Each new table line starts with @item, each subsequent new column 2014 % Each new table line starts with @item, each subsequent new column
1907 % starts with @tab. Empty columns may be produced by supplying @tab's 2015 % starts with @tab. Empty columns may be produced by supplying @tab's
1908 % with nothing between them for as many times as empty columns are needed, 2016 % with nothing between them for as many times as empty columns are needed,
1909 % ie, @tab@tab@tab will produce two empty columns. 2017 % ie, @tab@tab@tab will produce two empty columns.
1910 2018
1911 % @item, @tab, @multitable or @end multitable do not need to be on their 2019 % @item, @tab, @multitable or @end multitable do not need to be on their
1913 2021
1914 % Sample multitable: 2022 % Sample multitable:
1915 2023
1916 % @multitable {Column 1 template} {Column 2 template} {Column 3 template} 2024 % @multitable {Column 1 template} {Column 2 template} {Column 3 template}
1917 % @item first col stuff @tab second col stuff @tab third col 2025 % @item first col stuff @tab second col stuff @tab third col
1918 % @item 2026 % @item
1919 % first col stuff 2027 % first col stuff
1920 % @tab 2028 % @tab
1921 % second col stuff 2029 % second col stuff
1922 % @tab 2030 % @tab
1923 % third col 2031 % third col
1924 % @item first col stuff @tab second col stuff 2032 % @item first col stuff @tab second col stuff
1925 % @tab Many paragraphs of text may be used in any column. 2033 % @tab Many paragraphs of text may be used in any column.
1926 % 2034 %
1927 % They will wrap at the width determined by the template. 2035 % They will wrap at the width determined by the template.
1928 % @item@tab@tab This will be in third column. 2036 % @item@tab@tab This will be in third column.
1929 % @end multitable 2037 % @end multitable
1930 2038
1931 % Default dimensions may be reset by user. 2039 % Default dimensions may be reset by user.
1935 % @multitablelinespace is space to leave between table items, baseline 2043 % @multitablelinespace is space to leave between table items, baseline
1936 % to baseline. 2044 % to baseline.
1937 % 0pt means it depends on current normal line spacing. 2045 % 0pt means it depends on current normal line spacing.
1938 2046
1939 %%%% 2047 %%%%
1940 % Dimensions 2048 % Dimensions
1941 2049
1942 \newskip\multitableparskip 2050 \newskip\multitableparskip
1943 \newskip\multitableparindent 2051 \newskip\multitableparindent
1944 \newdimen\multitablecolspace 2052 \newdimen\multitablecolspace
1945 \newskip\multitablelinespace 2053 \newskip\multitablelinespace
2005 \global\colcount=0\relax% 2113 \global\colcount=0\relax%
2006 \def\Emultitable{\global\setpercentfalse\global\everycr{}\cr\egroup\egroup}% 2114 \def\Emultitable{\global\setpercentfalse\global\everycr{}\cr\egroup\egroup}%
2007 % To parse everything between @multitable and @item : 2115 % To parse everything between @multitable and @item :
2008 \setuptable#1 \endsetuptable 2116 \setuptable#1 \endsetuptable
2009 % Need to reset this to 0 after \setuptable. 2117 % Need to reset this to 0 after \setuptable.
2010 \global\colcount=0\relax% 2118 \global\colcount=0\relax%
2011 % 2119 %
2012 % This preamble sets up a generic column definition, which will 2120 % This preamble sets up a generic column definition, which will
2013 % be used as many times as user calls for columns. 2121 % be used as many times as user calls for columns.
2014 % \vtop will set a single line and will also let text wrap and 2122 % \vtop will set a single line and will also let text wrap and
2015 % continue for many paragraphs if desired. 2123 % continue for many paragraphs if desired.
2016 \halign\bgroup&\global\advance\colcount by 1\relax% 2124 \halign\bgroup&\global\advance\colcount by 1\relax%
2017 \multistrut\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname 2125 \multistrut\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname
2018 % In order to keep entries from bumping into each other 2126 % In order to keep entries from bumping into each other
2019 % we will add a \leftskip of \multitablecolspace to all columns after 2127 % we will add a \leftskip of \multitablecolspace to all columns after
2020 % the first one. 2128 % the first one.
2021 % If a template has been used, we will add \multitablecolspace 2129 % If a template has been used, we will add \multitablecolspace
2022 % to the width of each template entry. 2130 % to the width of each template entry.
2023 % If user has set preamble in terms of percent of \hsize 2131 % If user has set preamble in terms of percent of \hsize
2024 % we will use that dimension as the width of the column, and 2132 % we will use that dimension as the width of the column, and
2025 % the \leftskip will keep entries from bumping into each other. 2133 % the \leftskip will keep entries from bumping into each other.
2026 % Table will start at left margin and final column will justify at 2134 % Table will start at left margin and final column will justify at
2028 \ifnum\colcount=1 2136 \ifnum\colcount=1
2029 \else 2137 \else
2030 \ifsetpercent 2138 \ifsetpercent
2031 \else 2139 \else
2032 % If user has <not> set preamble in terms of percent of \hsize 2140 % If user has <not> set preamble in terms of percent of \hsize
2033 % we will advance \hsize by \multitablecolspace 2141 % we will advance \hsize by \multitablecolspace
2034 \advance\hsize by \multitablecolspace 2142 \advance\hsize by \multitablecolspace
2035 \fi 2143 \fi
2036 % In either case we will make \leftskip=\multitablecolspace: 2144 % In either case we will make \leftskip=\multitablecolspace:
2037 \leftskip=\multitablecolspace 2145 \leftskip=\multitablecolspace
2038 \fi 2146 \fi
2039 \noindent##\multistrut}\cr% 2147 % Ignoring space at the beginning and end avoids an occasional spurious
2148 % blank line, when TeX decides to break the line at the space before the
2149 % box from the multistrut, so the strut ends up on a line by itself.
2150 % For example:
2151 % @multitable @columnfractions .11 .89
2152 % @item @code{#}
2153 % @tab Legal holiday which is valid in major parts of the whole country.
2154 % Is automatically provided with highlighting sequences respectively marking
2155 % characters.
2156 \noindent\ignorespaces##\unskip\multistrut}\cr
2040 % \everycr will reset column counter, \colcount, at the end of 2157 % \everycr will reset column counter, \colcount, at the end of
2041 % each line. Every column entry will cause \colcount to advance by one. 2158 % each line. Every column entry will cause \colcount to advance by one.
2042 % The table preamble 2159 % The table preamble
2043 % looks at the current \colcount to find the correct column width. 2160 % looks at the current \colcount to find the correct column width.
2044 \global\everycr{\noalign{% 2161 \global\everycr{\noalign{%
2045 \filbreak%% keeps underfull box messages off when table breaks over pages. 2162 % \filbreak%% keeps underfull box messages off when table breaks over pages.
2163 % Maybe so, but it also creates really weird page breaks when the table
2164 % breaks over pages Wouldn't \vfil be better? Wait until the problem
2165 % manifests itself, so it can be fixed for real --karl.
2046 \global\colcount=0\relax}} 2166 \global\colcount=0\relax}}
2047 } 2167 }
2048 2168
2049 \def\setmultitablespacing{% test to see if user has set \multitablelinespace. 2169 \def\setmultitablespacing{% test to see if user has set \multitablelinespace.
2050 % If so, do nothing. If not, give it an appropriate dimension based on 2170 % If so, do nothing. If not, give it an appropriate dimension based on
2052 \ifdim\multitablelinespace=0pt 2172 \ifdim\multitablelinespace=0pt
2053 %% strut to put in table in case some entry doesn't have descenders, 2173 %% strut to put in table in case some entry doesn't have descenders,
2054 %% to keep lines equally spaced 2174 %% to keep lines equally spaced
2055 \let\multistrut = \strut 2175 \let\multistrut = \strut
2056 %% Test to see if parskip is larger than space between lines of 2176 %% Test to see if parskip is larger than space between lines of
2057 %% table. If not, do nothing. 2177 %% table. If not, do nothing.
2058 %% If so, set to same dimension as multitablelinespace. 2178 %% If so, set to same dimension as multitablelinespace.
2059 \else 2179 \else
2060 \gdef\multistrut{\vrule height\multitablelinespace depth\dp0 2180 \gdef\multistrut{\vrule height\multitablelinespace depth\dp0
2061 width0pt\relax} \fi 2181 width0pt\relax} \fi
2062 \ifdim\multitableparskip>\multitablelinespace 2182 \ifdim\multitableparskip>\multitablelinespace
2187 \def\less{\realbackslash less}% 2307 \def\less{\realbackslash less}%
2188 \def\hat{\realbackslash hat}% 2308 \def\hat{\realbackslash hat}%
2189 %\def\char{\realbackslash char}% 2309 %\def\char{\realbackslash char}%
2190 \def\TeX{\realbackslash TeX}% 2310 \def\TeX{\realbackslash TeX}%
2191 \def\dots{\realbackslash dots }% 2311 \def\dots{\realbackslash dots }%
2192 \def\copyright{\realbackslash copyright }% 2312 \def\result{\realbackslash result}%
2313 \def\equiv{\realbackslash equiv}%
2314 \def\expansion{\realbackslash expansion}%
2315 \def\print{\realbackslash print}%
2316 \def\error{\realbackslash error}%
2317 \def\point{\realbackslash point}%
2318 \def\copyright{\realbackslash copyright}%
2193 \def\tclose##1{\realbackslash tclose {##1}}% 2319 \def\tclose##1{\realbackslash tclose {##1}}%
2194 \def\code##1{\realbackslash code {##1}}% 2320 \def\code##1{\realbackslash code {##1}}%
2195 \def\dotless##1{\realbackslash dotless {##1}}% 2321 \def\dotless##1{\realbackslash dotless {##1}}%
2196 \def\samp##1{\realbackslash samp {##1}}% 2322 \def\samp##1{\realbackslash samp {##1}}%
2197 \def\,##1{\realbackslash ,{##1}}% 2323 \def\,##1{\realbackslash ,{##1}}%
2198 \def\t##1{\realbackslash t {##1}}% 2324 \def\t##1{\realbackslash t {##1}}%
2199 \def\r##1{\realbackslash r {##1}}% 2325 \def\r##1{\realbackslash r {##1}}%
2200 \def\i##1{\realbackslash i {##1}}% 2326 \def\i##1{\realbackslash i {##1}}%
2201 \def\b##1{\realbackslash b {##1}}% 2327 \def\b##1{\realbackslash b {##1}}%
2328 \def\sc##1{\realbackslash sc {##1}}%
2202 \def\cite##1{\realbackslash cite {##1}}% 2329 \def\cite##1{\realbackslash cite {##1}}%
2203 \def\key##1{\realbackslash key {##1}}% 2330 \def\key##1{\realbackslash key {##1}}%
2204 \def\file##1{\realbackslash file {##1}}% 2331 \def\file##1{\realbackslash file {##1}}%
2205 \def\var##1{\realbackslash var {##1}}% 2332 \def\var##1{\realbackslash var {##1}}%
2206 \def\kbd##1{\realbackslash kbd {##1}}% 2333 \def\kbd##1{\realbackslash kbd {##1}}%
2207 \def\dfn##1{\realbackslash dfn {##1}}% 2334 \def\dfn##1{\realbackslash dfn {##1}}%
2208 \def\emph##1{\realbackslash emph {##1}}% 2335 \def\emph##1{\realbackslash emph {##1}}%
2336 \def\value##1{\realbackslash value {##1}}%
2209 \unsepspaces 2337 \unsepspaces
2210 } 2338 }
2211 2339
2212 % If an index command is used in an @example environment, any spaces 2340 % If an index command is used in an @example environment, any spaces
2213 % therein should become regular spaces in the raw index file, not the 2341 % therein should become regular spaces in the raw index file, not the
2294 \count255=\lastpenalty 2422 \count255=\lastpenalty
2295 {% 2423 {%
2296 \indexdummies % Must do this here, since \bf, etc expand at this stage 2424 \indexdummies % Must do this here, since \bf, etc expand at this stage
2297 \escapechar=`\\ 2425 \escapechar=`\\
2298 {% 2426 {%
2299 \let\folio=0 % We will expand all macros now EXCEPT \folio. 2427 \let\folio=0% We will expand all macros now EXCEPT \folio.
2300 \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now 2428 \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now
2301 % so it will be output as is; and it will print as backslash. 2429 % so it will be output as is; and it will print as backslash.
2302 % 2430 %
2303 % First process the index-string with all font commands turned off 2431 % First process the index-string with all font commands turned off
2304 % to get the string to sort by. 2432 % to get the string to sort by.
2368 \gdef\cindexsub "#1" #2^^M{\endgroup % 2496 \gdef\cindexsub "#1" #2^^M{\endgroup %
2369 \dosubind{cp}{#2}{#1}}} 2497 \dosubind{cp}{#2}{#1}}}
2370 2498
2371 % Define the macros used in formatting output of the sorted index material. 2499 % Define the macros used in formatting output of the sorted index material.
2372 2500
2373 % This is what you call to cause a particular index to get printed. 2501 % @printindex causes a particular index (the ??s file) to get printed.
2374 % Write 2502 % It does not print any chapter heading (usually an @unnumbered).
2375 % @unnumbered Function Index 2503 %
2376 % @printindex fn
2377
2378 \def\printindex{\parsearg\doprintindex} 2504 \def\printindex{\parsearg\doprintindex}
2379
2380 \def\doprintindex#1{\begingroup 2505 \def\doprintindex#1{\begingroup
2381 \dobreak \chapheadingskip{10000}% 2506 \dobreak \chapheadingskip{10000}%
2382 % 2507 %
2383 \indexfonts \rm 2508 \indexfonts \rm
2384 \tolerance = 9500 2509 \tolerance = 9500
2385 \indexbreaks 2510 \indexbreaks
2386 \def\indexbackslash{\rawbackslashxx}%
2387 % Index files are almost Texinfo source, but we use \ as the escape
2388 % character. It would be better to use @, but that's too big a change
2389 % to make right now.
2390 \catcode`\\ = 0
2391 \catcode`\@ = 11
2392 \escapechar = `\\
2393 \begindoublecolumns
2394 % 2511 %
2395 % See if the index file exists and is nonempty. 2512 % See if the index file exists and is nonempty.
2396 \openin 1 \jobname.#1s 2513 \openin 1 \jobname.#1s
2397 \ifeof 1 2514 \ifeof 1
2398 % \enddoublecolumns gets confused if there is no text in the index, 2515 % \enddoublecolumns gets confused if there is no text in the index,
2407 % it can discover if there is anything in it. 2524 % it can discover if there is anything in it.
2408 \read 1 to \temp 2525 \read 1 to \temp
2409 \ifeof 1 2526 \ifeof 1
2410 (Index is empty) 2527 (Index is empty)
2411 \else 2528 \else
2529 % Index files are almost Texinfo source, but we use \ as the escape
2530 % character. It would be better to use @, but that's too big a change
2531 % to make right now.
2532 \def\indexbackslash{\rawbackslashxx}%
2533 \catcode`\\ = 0
2534 \catcode`\@ = 11
2535 \escapechar = `\\
2536 \begindoublecolumns
2412 \input \jobname.#1s 2537 \input \jobname.#1s
2538 \enddoublecolumns
2413 \fi 2539 \fi
2414 \fi 2540 \fi
2415 \closein 1 2541 \closein 1
2416 \enddoublecolumns
2417 \endgroup} 2542 \endgroup}
2418 2543
2419 % These macros are used by the sorted index file itself. 2544 % These macros are used by the sorted index file itself.
2420 % Change them to control the appearance of the index. 2545 % Change them to control the appearance of the index.
2421 2546
2513 \newbox\partialpage 2638 \newbox\partialpage
2514 \newdimen\doublecolumnhsize 2639 \newdimen\doublecolumnhsize
2515 2640
2516 \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns 2641 \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
2517 % Grab any single-column material above us. 2642 % Grab any single-column material above us.
2518 \output = {\global\setbox\partialpage 2643 \output = {\global\setbox\partialpage = \vbox{%
2519 =\vbox{\unvbox255\kern -\topskip \kern \baselineskip}}% 2644 %
2645 % Here is a possibility not foreseen in manmac: if we accumulate a
2646 % whole lot of material, we might end up calling this \output
2647 % routine twice in a row (see the doublecol-lose test, which is
2648 % essentially a couple of indexes with @setchapternewpage off). In
2649 % that case, we must prevent the second \partialpage from
2650 % simply overwriting the first, causing us to lose the page.
2651 % This will preserve it until a real output routine can ship it
2652 % out. Generally, \partialpage will be empty when this runs and
2653 % this will be a no-op.
2654 \unvbox\partialpage
2655 %
2656 % Unvbox the main output page.
2657 \unvbox255
2658 \kern-\topskip \kern\baselineskip
2659 }}%
2520 \eject 2660 \eject
2521 % 2661 %
2522 % Now switch to the double-column output routine. 2662 % Use the double-column output routine for subsequent pages.
2523 \output={\doublecolumnout}% 2663 \output = {\doublecolumnout}%
2524 % 2664 %
2525 % Change the page size parameters. We could do this once outside this 2665 % Change the page size parameters. We could do this once outside this
2526 % routine, in each of @smallbook, @afourpaper, and the default 8.5x11 2666 % routine, in each of @smallbook, @afourpaper, and the default 8.5x11
2527 % format, but then we repeat the same computation. Repeating a couple 2667 % format, but then we repeat the same computation. Repeating a couple
2528 % of assignments once per index is clearly meaningless for the 2668 % of assignments once per index is clearly meaningless for the
2529 % execution time, so we may as well do it once. 2669 % execution time, so we may as well do it in one place.
2530 % 2670 %
2531 % First we halve the line length, less a little for the gutter between 2671 % First we halve the line length, less a little for the gutter between
2532 % the columns. We compute the gutter based on the line length, so it 2672 % the columns. We compute the gutter based on the line length, so it
2533 % changes automatically with the paper format. The magic constant 2673 % changes automatically with the paper format. The magic constant
2534 % below is chosen so that the gutter has the same value (well, +- < 2674 % below is chosen so that the gutter has the same value (well, +-<1pt)
2535 % 1pt) as it did when we hard-coded it. 2675 % as it did when we hard-coded it.
2536 % 2676 %
2537 % We put the result in a separate register, \doublecolumhsize, so we 2677 % We put the result in a separate register, \doublecolumhsize, so we
2538 % can restore it in \pagesofar, after \hsize itself has (potentially) 2678 % can restore it in \pagesofar, after \hsize itself has (potentially)
2539 % been clobbered. 2679 % been clobbered.
2540 % 2680 %
2551 \splittopskip=\topskip \splitmaxdepth=\maxdepth 2691 \splittopskip=\topskip \splitmaxdepth=\maxdepth
2552 % Get the available space for the double columns -- the normal 2692 % Get the available space for the double columns -- the normal
2553 % (undoubled) page height minus any material left over from the 2693 % (undoubled) page height minus any material left over from the
2554 % previous page. 2694 % previous page.
2555 \dimen@=\pageheight \advance\dimen@ by-\ht\partialpage 2695 \dimen@=\pageheight \advance\dimen@ by-\ht\partialpage
2556 % box0 will be the left-hand column, box1 the right. 2696 % box0 will be the left-hand column, box2 the right.
2557 \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@ 2697 \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
2558 \onepageout\pagesofar 2698 \onepageout\pagesofar
2559 \unvbox255 \penalty\outputpenalty 2699 \unvbox255
2700 \penalty\outputpenalty
2560 } 2701 }
2561 \def\pagesofar{% 2702 \def\pagesofar{%
2562 % The contents of the output page -- any previous material, 2703 % Re-output the contents of the output page -- any previous material,
2563 % followed by the two boxes we just split. 2704 % followed by the two boxes we just split.
2564 \unvbox\partialpage 2705 \unvbox\partialpage
2565 \hsize = \doublecolumnhsize 2706 \hsize = \doublecolumnhsize
2566 \wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}% 2707 \wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}%
2567 } 2708 }
2568 \def\enddoublecolumns{% 2709 \def\enddoublecolumns{%
2569 \output={\balancecolumns}\eject % split what we have 2710 \output = {\balancecolumns}\eject % split what we have
2570 \endgroup 2711 \endgroup % started in \begindoublecolumns
2712 %
2571 % Back to normal single-column typesetting, but take account of the 2713 % Back to normal single-column typesetting, but take account of the
2572 % fact that we just accumulated some stuff on the output page. 2714 % fact that we just accumulated some stuff on the output page.
2573 \pagegoal=\vsize 2715 \pagegoal = \vsize
2574 } 2716 }
2575 \def\balancecolumns{% 2717 \def\balancecolumns{%
2576 % Called on the last page of the double column material. 2718 % Called at the end of the double column material.
2577 \setbox0=\vbox{\unvbox255}% 2719 \setbox0 = \vbox{\unvbox255}%
2578 \dimen@ = \ht0 2720 \dimen@ = \ht0
2579 \advance\dimen@ by \topskip 2721 \advance\dimen@ by \topskip
2580 \advance\dimen@ by-\baselineskip 2722 \advance\dimen@ by-\baselineskip
2581 \divide\dimen@ by 2 2723 \divide\dimen@ by 2
2582 \splittopskip = \topskip 2724 \splittopskip = \topskip
2583 % Loop until we get a decent breakpoint. 2725 % Loop until we get a decent breakpoint.
2584 {\vbadness=10000 \loop \global\setbox3=\copy0 2726 {\vbadness=10000 \loop
2727 \global\setbox3=\copy0
2585 \global\setbox1=\vsplit3 to\dimen@ 2728 \global\setbox1=\vsplit3 to\dimen@
2586 \ifdim\ht3>\dimen@ \global\advance\dimen@ by1pt \repeat}% 2729 \ifdim\ht3>\dimen@ \global\advance\dimen@ by1pt
2730 \repeat}%
2587 \setbox0=\vbox to\dimen@{\unvbox1}% 2731 \setbox0=\vbox to\dimen@{\unvbox1}%
2588 \setbox2=\vbox to\dimen@{\unvbox3}% 2732 \setbox2=\vbox to\dimen@{\unvbox3}%
2589 \pagesofar 2733 \pagesofar
2590 } 2734 }
2591 \catcode `\@=\other 2735 \catcode`\@ = \other
2592 2736
2593 2737
2594 \message{sectioning,} 2738 \message{sectioning,}
2595 % Define chapters, sections, etc. 2739 % Define chapters, sections, etc.
2596 2740
2597 \newcount \chapno 2741 \newcount\chapno
2598 \newcount \secno \secno=0 2742 \newcount\secno \secno=0
2599 \newcount \subsecno \subsecno=0 2743 \newcount\subsecno \subsecno=0
2600 \newcount \subsubsecno \subsubsecno=0 2744 \newcount\subsubsecno \subsubsecno=0
2601 2745
2602 % This counter is funny since it counts through charcodes of letters A, B, ... 2746 % This counter is funny since it counts through charcodes of letters A, B, ...
2603 \newcount \appendixno \appendixno = `\@ 2747 \newcount\appendixno \appendixno = `\@
2604 \def\appendixletter{\char\the\appendixno} 2748 \def\appendixletter{\char\the\appendixno}
2605 2749
2606 \newwrite \contentsfile 2750 \newwrite\contentsfile
2607 % This is called from \setfilename. 2751 % This is called from \setfilename.
2608 \def\opencontents{\openout \contentsfile = \jobname.toc} 2752 \def\opencontents{\openout\contentsfile = \jobname.toc }
2609 2753
2610 % Each @chapter defines this as the name of the chapter. 2754 % Each @chapter defines this as the name of the chapter.
2611 % page headings and footings can use it. @section does likewise 2755 % page headings and footings can use it. @section does likewise
2612 2756
2613 \def\thischapter{} \def\thissection{} 2757 \def\thischapter{} \def\thissection{}
2614 \def\seccheck#1{\if \pageno<0 % 2758 \def\seccheck#1{\ifnum \pageno<0
2615 \errmessage{@#1 not allowed after generating table of contents}\fi 2759 \errmessage{@#1 not allowed after generating table of contents}%
2616 % 2760 \fi}
2617 }
2618 2761
2619 \def\chapternofonts{% 2762 \def\chapternofonts{%
2620 \let\rawbackslash=\relax% 2763 \let\rawbackslash=\relax
2621 \let\frenchspacing=\relax% 2764 \let\frenchspacing=\relax
2622 \def\result{\realbackslash result} 2765 \def\result{\realbackslash result}%
2623 \def\equiv{\realbackslash equiv} 2766 \def\equiv{\realbackslash equiv}%
2624 \def\expansion{\realbackslash expansion} 2767 \def\expansion{\realbackslash expansion}%
2625 \def\print{\realbackslash print} 2768 \def\print{\realbackslash print}%
2626 \def\TeX{\realbackslash TeX} 2769 \def\TeX{\realbackslash TeX}%
2627 \def\dots{\realbackslash dots} 2770 \def\dots{\realbackslash dots}%
2628 \def\copyright{\realbackslash copyright} 2771 \def\result{\realbackslash result}%
2629 \def\tt{\realbackslash tt} 2772 \def\equiv{\realbackslash equiv}%
2630 \def\bf{\realbackslash bf } 2773 \def\expansion{\realbackslash expansion}%
2631 \def\w{\realbackslash w} 2774 \def\print{\realbackslash print}%
2632 \def\less{\realbackslash less} 2775 \def\error{\realbackslash error}%
2633 \def\gtr{\realbackslash gtr} 2776 \def\point{\realbackslash point}%
2634 \def\hat{\realbackslash hat} 2777 \def\copyright{\realbackslash copyright}%
2635 \def\char{\realbackslash char} 2778 \def\tt{\realbackslash tt}%
2636 \def\tclose##1{\realbackslash tclose {##1}} 2779 \def\bf{\realbackslash bf}%
2637 \def\code##1{\realbackslash code {##1}} 2780 \def\w{\realbackslash w}%
2638 \def\samp##1{\realbackslash samp {##1}} 2781 \def\less{\realbackslash less}%
2639 \def\r##1{\realbackslash r {##1}} 2782 \def\gtr{\realbackslash gtr}%
2640 \def\b##1{\realbackslash b {##1}} 2783 \def\hat{\realbackslash hat}%
2641 \def\key##1{\realbackslash key {##1}} 2784 \def\char{\realbackslash char}%
2642 \def\file##1{\realbackslash file {##1}} 2785 \def\tclose##1{\realbackslash tclose{##1}}%
2643 \def\kbd##1{\realbackslash kbd {##1}} 2786 \def\code##1{\realbackslash code{##1}}%
2644 % These are redefined because @smartitalic wouldn't work inside xdef. 2787 \def\samp##1{\realbackslash samp{##1}}%
2645 \def\i##1{\realbackslash i {##1}} 2788 \def\r##1{\realbackslash r{##1}}%
2646 \def\cite##1{\realbackslash cite {##1}} 2789 \def\b##1{\realbackslash b{##1}}%
2647 \def\var##1{\realbackslash var {##1}} 2790 \def\key##1{\realbackslash key{##1}}%
2648 \def\emph##1{\realbackslash emph {##1}} 2791 \def\file##1{\realbackslash file{##1}}%
2649 \def\dfn##1{\realbackslash dfn {##1}} 2792 \def\kbd##1{\realbackslash kbd{##1}}%
2793 % These are redefined because @smartitalic wouldn't work inside xdef.
2794 \def\i##1{\realbackslash i{##1}}%
2795 \def\cite##1{\realbackslash cite{##1}}%
2796 \def\var##1{\realbackslash var{##1}}%
2797 \def\emph##1{\realbackslash emph{##1}}%
2798 \def\dfn##1{\realbackslash dfn{##1}}%
2650 } 2799 }
2651 2800
2652 \newcount\absseclevel % used to calculate proper heading level 2801 \newcount\absseclevel % used to calculate proper heading level
2653 \newcount\secbase\secbase=0 % @raise/lowersections modify this count 2802 \newcount\secbase\secbase=0 % @raise/lowersections modify this count
2654 2803
2731 \gdef\thischaptername{#1}% 2880 \gdef\thischaptername{#1}%
2732 % We don't substitute the actual chapter name into \thischapter 2881 % We don't substitute the actual chapter name into \thischapter
2733 % because we don't want its macros evaluated now. 2882 % because we don't want its macros evaluated now.
2734 \xdef\thischapter{\putwordChapter{} \the\chapno: \noexpand\thischaptername}% 2883 \xdef\thischapter{\putwordChapter{} \the\chapno: \noexpand\thischaptername}%
2735 {\chapternofonts% 2884 {\chapternofonts%
2736 \edef\temp{{\realbackslash chapentry {#1}{\the\chapno}{\noexpand\folio}}}% 2885 \toks0 = {#1}%
2886 \edef\temp{{\realbackslash chapentry{\the\toks0}{\the\chapno}{\noexpand\folio}}}%
2737 \escapechar=`\\% 2887 \escapechar=`\\%
2738 \write \contentsfile \temp % 2888 \write \contentsfile \temp %
2739 \donoderef % 2889 \donoderef %
2740 \global\let\section = \numberedsec 2890 \global\let\section = \numberedsec
2741 \global\let\subsection = \numberedsubsec 2891 \global\let\subsection = \numberedsubsec
2750 \chapmacro {#1}{\putwordAppendix{} \appendixletter}% 2900 \chapmacro {#1}{\putwordAppendix{} \appendixletter}%
2751 \gdef\thissection{#1}% 2901 \gdef\thissection{#1}%
2752 \gdef\thischaptername{#1}% 2902 \gdef\thischaptername{#1}%
2753 \xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}% 2903 \xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}%
2754 {\chapternofonts% 2904 {\chapternofonts%
2755 \edef\temp{{\realbackslash chapentry 2905 \toks0 = {#1}%
2756 {#1}{\putwordAppendix{} \appendixletter}{\noexpand\folio}}}% 2906 \edef\temp{{\realbackslash chapentry{\the\toks0}%
2907 {\putwordAppendix{} \appendixletter}{\noexpand\folio}}}%
2757 \escapechar=`\\% 2908 \escapechar=`\\%
2758 \write \contentsfile \temp % 2909 \write \contentsfile \temp %
2759 \appendixnoderef % 2910 \appendixnoderef %
2760 \global\let\section = \appendixsec 2911 \global\let\section = \appendixsec
2761 \global\let\subsection = \appendixsubsec 2912 \global\let\subsection = \appendixsubsec
2785 \toks0 = {#1}\message{(\the\toks0)}% 2936 \toks0 = {#1}\message{(\the\toks0)}%
2786 % 2937 %
2787 \unnumbchapmacro {#1}% 2938 \unnumbchapmacro {#1}%
2788 \gdef\thischapter{#1}\gdef\thissection{#1}% 2939 \gdef\thischapter{#1}\gdef\thissection{#1}%
2789 {\chapternofonts% 2940 {\chapternofonts%
2790 \edef\temp{{\realbackslash unnumbchapentry {#1}{\noexpand\folio}}}% 2941 \toks0 = {#1}%
2942 \edef\temp{{\realbackslash unnumbchapentry{\the\toks0}{\noexpand\folio}}}%
2791 \escapechar=`\\% 2943 \escapechar=`\\%
2792 \write \contentsfile \temp % 2944 \write \contentsfile \temp %
2793 \unnumbnoderef % 2945 \unnumbnoderef %
2794 \global\let\section = \unnumberedsec 2946 \global\let\section = \unnumberedsec
2795 \global\let\subsection = \unnumberedsubsec 2947 \global\let\subsection = \unnumberedsubsec
2800 \def\secyyy #1{\numhead1{#1}} % normally calls seczzz 2952 \def\secyyy #1{\numhead1{#1}} % normally calls seczzz
2801 \def\seczzz #1{\seccheck{section}% 2953 \def\seczzz #1{\seccheck{section}%
2802 \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 % 2954 \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
2803 \gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}% 2955 \gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}%
2804 {\chapternofonts% 2956 {\chapternofonts%
2957 \toks0 = {#1}%
2805 \edef\temp{{\realbackslash secentry % 2958 \edef\temp{{\realbackslash secentry %
2806 {#1}{\the\chapno}{\the\secno}{\noexpand\folio}}}% 2959 {\the\toks0}{\the\chapno}{\the\secno}{\noexpand\folio}}}%
2807 \escapechar=`\\% 2960 \escapechar=`\\%
2808 \write \contentsfile \temp % 2961 \write \contentsfile \temp %
2809 \donoderef % 2962 \donoderef %
2810 \penalty 10000 % 2963 \penalty 10000 %
2811 }} 2964 }}
2815 \def\appendixsecyyy #1{\apphead1{#1}} % normally calls appendixsectionzzz 2968 \def\appendixsecyyy #1{\apphead1{#1}} % normally calls appendixsectionzzz
2816 \def\appendixsectionzzz #1{\seccheck{appendixsection}% 2969 \def\appendixsectionzzz #1{\seccheck{appendixsection}%
2817 \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 % 2970 \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
2818 \gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}% 2971 \gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}%
2819 {\chapternofonts% 2972 {\chapternofonts%
2973 \toks0 = {#1}%
2820 \edef\temp{{\realbackslash secentry % 2974 \edef\temp{{\realbackslash secentry %
2821 {#1}{\appendixletter}{\the\secno}{\noexpand\folio}}}% 2975 {\the\toks0}{\appendixletter}{\the\secno}{\noexpand\folio}}}%
2822 \escapechar=`\\% 2976 \escapechar=`\\%
2823 \write \contentsfile \temp % 2977 \write \contentsfile \temp %
2824 \appendixnoderef % 2978 \appendixnoderef %
2825 \penalty 10000 % 2979 \penalty 10000 %
2826 }} 2980 }}
2828 \outer\def\unnumberedsec{\parsearg\unnumberedsecyyy} 2982 \outer\def\unnumberedsec{\parsearg\unnumberedsecyyy}
2829 \def\unnumberedsecyyy #1{\unnmhead1{#1}} % normally calls unnumberedseczzz 2983 \def\unnumberedsecyyy #1{\unnmhead1{#1}} % normally calls unnumberedseczzz
2830 \def\unnumberedseczzz #1{\seccheck{unnumberedsec}% 2984 \def\unnumberedseczzz #1{\seccheck{unnumberedsec}%
2831 \plainsecheading {#1}\gdef\thissection{#1}% 2985 \plainsecheading {#1}\gdef\thissection{#1}%
2832 {\chapternofonts% 2986 {\chapternofonts%
2833 \edef\temp{{\realbackslash unnumbsecentry{#1}{\noexpand\folio}}}% 2987 \toks0 = {#1}%
2988 \edef\temp{{\realbackslash unnumbsecentry{\the\toks0}{\noexpand\folio}}}%
2834 \escapechar=`\\% 2989 \escapechar=`\\%
2835 \write \contentsfile \temp % 2990 \write \contentsfile \temp %
2836 \unnumbnoderef % 2991 \unnumbnoderef %
2837 \penalty 10000 % 2992 \penalty 10000 %
2838 }} 2993 }}
2841 \def\numberedsubsecyyy #1{\numhead2{#1}} % normally calls numberedsubseczzz 2996 \def\numberedsubsecyyy #1{\numhead2{#1}} % normally calls numberedsubseczzz
2842 \def\numberedsubseczzz #1{\seccheck{subsection}% 2997 \def\numberedsubseczzz #1{\seccheck{subsection}%
2843 \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 % 2998 \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
2844 \subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}% 2999 \subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}%
2845 {\chapternofonts% 3000 {\chapternofonts%
3001 \toks0 = {#1}%
2846 \edef\temp{{\realbackslash subsecentry % 3002 \edef\temp{{\realbackslash subsecentry %
2847 {#1}{\the\chapno}{\the\secno}{\the\subsecno}{\noexpand\folio}}}% 3003 {\the\toks0}{\the\chapno}{\the\secno}{\the\subsecno}{\noexpand\folio}}}%
2848 \escapechar=`\\% 3004 \escapechar=`\\%
2849 \write \contentsfile \temp % 3005 \write \contentsfile \temp %
2850 \donoderef % 3006 \donoderef %
2851 \penalty 10000 % 3007 \penalty 10000 %
2852 }} 3008 }}
2855 \def\appendixsubsecyyy #1{\apphead2{#1}} % normally calls appendixsubseczzz 3011 \def\appendixsubsecyyy #1{\apphead2{#1}} % normally calls appendixsubseczzz
2856 \def\appendixsubseczzz #1{\seccheck{appendixsubsec}% 3012 \def\appendixsubseczzz #1{\seccheck{appendixsubsec}%
2857 \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 % 3013 \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
2858 \subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}% 3014 \subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}%
2859 {\chapternofonts% 3015 {\chapternofonts%
3016 \toks0 = {#1}%
2860 \edef\temp{{\realbackslash subsecentry % 3017 \edef\temp{{\realbackslash subsecentry %
2861 {#1}{\appendixletter}{\the\secno}{\the\subsecno}{\noexpand\folio}}}% 3018 {\the\toks0}{\appendixletter}{\the\secno}{\the\subsecno}{\noexpand\folio}}}%
2862 \escapechar=`\\% 3019 \escapechar=`\\%
2863 \write \contentsfile \temp % 3020 \write \contentsfile \temp %
2864 \appendixnoderef % 3021 \appendixnoderef %
2865 \penalty 10000 % 3022 \penalty 10000 %
2866 }} 3023 }}
2868 \outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy} 3025 \outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy}
2869 \def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz 3026 \def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz
2870 \def\unnumberedsubseczzz #1{\seccheck{unnumberedsubsec}% 3027 \def\unnumberedsubseczzz #1{\seccheck{unnumberedsubsec}%
2871 \plainsubsecheading {#1}\gdef\thissection{#1}% 3028 \plainsubsecheading {#1}\gdef\thissection{#1}%
2872 {\chapternofonts% 3029 {\chapternofonts%
2873 \edef\temp{{\realbackslash unnumbsubsecentry{#1}{\noexpand\folio}}}% 3030 \toks0 = {#1}%
3031 \edef\temp{{\realbackslash unnumbsubsecentry{\the\toks0}{\noexpand\folio}}}%
2874 \escapechar=`\\% 3032 \escapechar=`\\%
2875 \write \contentsfile \temp % 3033 \write \contentsfile \temp %
2876 \unnumbnoderef % 3034 \unnumbnoderef %
2877 \penalty 10000 % 3035 \penalty 10000 %
2878 }} 3036 }}
2882 \def\numberedsubsubseczzz #1{\seccheck{subsubsection}% 3040 \def\numberedsubsubseczzz #1{\seccheck{subsubsection}%
2883 \gdef\thissection{#1}\global\advance \subsubsecno by 1 % 3041 \gdef\thissection{#1}\global\advance \subsubsecno by 1 %
2884 \subsubsecheading {#1} 3042 \subsubsecheading {#1}
2885 {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}% 3043 {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
2886 {\chapternofonts% 3044 {\chapternofonts%
2887 \edef\temp{{\realbackslash subsubsecentry % 3045 \toks0 = {#1}%
2888 {#1} 3046 \edef\temp{{\realbackslash subsubsecentry{\the\toks0}
2889 {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno} 3047 {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}
2890 {\noexpand\folio}}}% 3048 {\noexpand\folio}}}%
2891 \escapechar=`\\% 3049 \escapechar=`\\%
2892 \write \contentsfile \temp % 3050 \write \contentsfile \temp %
2893 \donoderef % 3051 \donoderef %
2899 \def\appendixsubsubseczzz #1{\seccheck{appendixsubsubsec}% 3057 \def\appendixsubsubseczzz #1{\seccheck{appendixsubsubsec}%
2900 \gdef\thissection{#1}\global\advance \subsubsecno by 1 % 3058 \gdef\thissection{#1}\global\advance \subsubsecno by 1 %
2901 \subsubsecheading {#1} 3059 \subsubsecheading {#1}
2902 {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}% 3060 {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
2903 {\chapternofonts% 3061 {\chapternofonts%
2904 \edef\temp{{\realbackslash subsubsecentry{#1}% 3062 \toks0 = {#1}%
3063 \edef\temp{{\realbackslash subsubsecentry{\the\toks0}%
2905 {\appendixletter} 3064 {\appendixletter}
2906 {\the\secno}{\the\subsecno}{\the\subsubsecno}{\noexpand\folio}}}% 3065 {\the\secno}{\the\subsecno}{\the\subsubsecno}{\noexpand\folio}}}%
2907 \escapechar=`\\% 3066 \escapechar=`\\%
2908 \write \contentsfile \temp % 3067 \write \contentsfile \temp %
2909 \appendixnoderef % 3068 \appendixnoderef %
2913 \outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy} 3072 \outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy}
2914 \def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz 3073 \def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz
2915 \def\unnumberedsubsubseczzz #1{\seccheck{unnumberedsubsubsec}% 3074 \def\unnumberedsubsubseczzz #1{\seccheck{unnumberedsubsubsec}%
2916 \plainsubsubsecheading {#1}\gdef\thissection{#1}% 3075 \plainsubsubsecheading {#1}\gdef\thissection{#1}%
2917 {\chapternofonts% 3076 {\chapternofonts%
2918 \edef\temp{{\realbackslash unnumbsubsubsecentry{#1}{\noexpand\folio}}}% 3077 \toks0 = {#1}%
3078 \edef\temp{{\realbackslash unnumbsubsubsecentry{\the\toks0}{\noexpand\folio}}}%
2919 \escapechar=`\\% 3079 \escapechar=`\\%
2920 \write \contentsfile \temp % 3080 \write \contentsfile \temp %
2921 \unnumbnoderef % 3081 \unnumbnoderef %
2922 \penalty 10000 % 3082 \penalty 10000 %
2923 }} 3083 }}
3094 \def\subsubsecheading#1#2#3#4#5{\sectionheading{subsubsec}{#2.#3.#4.#5}{#1}} 3254 \def\subsubsecheading#1#2#3#4#5{\sectionheading{subsubsec}{#2.#3.#4.#5}{#1}}
3095 \def\plainsubsubsecheading#1{\sectionheading{subsubsec}{}{#1}} 3255 \def\plainsubsubsecheading#1{\sectionheading{subsubsec}{}{#1}}
3096 3256
3097 3257
3098 % Print any size section title. 3258 % Print any size section title.
3099 % 3259 %
3100 % #1 is the section type (sec/subsec/subsubsec), #2 is the section 3260 % #1 is the section type (sec/subsec/subsubsec), #2 is the section
3101 % number (maybe empty), #3 the text. 3261 % number (maybe empty), #3 the text.
3102 \def\sectionheading#1#2#3{% 3262 \def\sectionheading#1#2#3{%
3103 {% 3263 {%
3104 \expandafter\advance\csname #1headingskip\endcsname by \parskip 3264 \expandafter\advance\csname #1headingskip\endcsname by \parskip
3138 % Don't need to put `Contents' or `Short Contents' in the headline. 3298 % Don't need to put `Contents' or `Short Contents' in the headline.
3139 % It is abundantly clear what they are. 3299 % It is abundantly clear what they are.
3140 \unnumbchapmacro{#1}\def\thischapter{}% 3300 \unnumbchapmacro{#1}\def\thischapter{}%
3141 \begingroup % Set up to handle contents files properly. 3301 \begingroup % Set up to handle contents files properly.
3142 \catcode`\\=0 \catcode`\{=1 \catcode`\}=2 \catcode`\@=11 3302 \catcode`\\=0 \catcode`\{=1 \catcode`\}=2 \catcode`\@=11
3143 \catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi 3303 % We can't do this, because then an actual ^ in a section
3304 % title fails, e.g., @chapter ^ -- exponentiation. --karl, 9jul97.
3305 %\catcode`\^=7 % to see ^^e4 as \"a etc. juha@piuha.ydi.vtt.fi
3144 \raggedbottom % Worry more about breakpoints than the bottom. 3306 \raggedbottom % Worry more about breakpoints than the bottom.
3145 \advance\hsize by -\contentsrightmargin % Don't use the full line length. 3307 \advance\hsize by -\contentsrightmargin % Don't use the full line length.
3146 } 3308 }
3147 3309
3148 3310
3346 \catcode`\<=12 3508 \catcode`\<=12
3347 \catcode`\>=12 3509 \catcode`\>=12
3348 \escapechar=`\\ 3510 \escapechar=`\\
3349 % 3511 %
3350 \let\,=\ptexcomma 3512 \let\,=\ptexcomma
3351 \let\~=\ptextilde
3352 \let\{=\ptexlbrace 3513 \let\{=\ptexlbrace
3353 \let\}=\ptexrbrace 3514 \let\}=\ptexrbrace
3354 \let\.=\ptexdot 3515 \let\.=\ptexdot
3355 \let\*=\ptexstar 3516 \let\*=\ptexstar
3356 \let\dots=\ptexdots 3517 \let\dots=\ptexdots
3357 \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}} 3518 \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
3358 \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi} 3519 \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}%
3359 \def\@{@}% 3520 \def\@{@}%
3360 \let\bullet=\ptexbullet 3521 \let\bullet=\ptexbullet
3361 \let\b=\ptexb \let\c=\ptexc \let\i=\ptexi \let\t=\ptext 3522 \let\b=\ptexb \let\c=\ptexc \let\i=\ptexi \let\t=\ptext
3362 % 3523 %
3363 \let\Etex=\endgroup} 3524 \let\Etex=\endgroup}
3494 % will be inserted at the beginning of the next paragraph in the 3655 % will be inserted at the beginning of the next paragraph in the
3495 % document, after the environment. 3656 % document, after the environment.
3496 % 3657 %
3497 \def\nonfillfinish{\afterenvbreak\endgroup}% 3658 \def\nonfillfinish{\afterenvbreak\endgroup}%
3498 3659
3499 % This macro is
3500 \def\lisp{\begingroup 3660 \def\lisp{\begingroup
3501 \nonfillstart 3661 \nonfillstart
3502 \let\Elisp = \nonfillfinish 3662 \let\Elisp = \nonfillfinish
3503 \tt 3663 \tt
3664 % Make @kbd do something special, if requested.
3665 \let\kbdfont\kbdexamplefont
3504 \rawbackslash % have \ input char produce \ char from current font 3666 \rawbackslash % have \ input char produce \ char from current font
3505 \gobble 3667 \gobble
3506 } 3668 }
3507 3669
3508 % Define the \E... control sequence only if we are inside the 3670 % Define the \E... control sequence only if we are inside the
3616 % but make & act ordinary (given that it's active). 3778 % but make & act ordinary (given that it's active).
3617 \gdef\boldbraxnoamp{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb\let&=\ampnr} 3779 \gdef\boldbraxnoamp{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb\let&=\ampnr}
3618 3780
3619 % Definitions of (, ) and & used in args for functions. 3781 % Definitions of (, ) and & used in args for functions.
3620 % This is the definition of ( outside of all parentheses. 3782 % This is the definition of ( outside of all parentheses.
3621 \gdef\oprm#1 {{\rm\char`\(}#1 \bf \let(=\opnested % 3783 \gdef\oprm#1 {{\rm\char`\(}#1 \bf \let(=\opnested
3622 \global\advance\parencount by 1 } 3784 \global\advance\parencount by 1
3785 }
3623 % 3786 %
3624 % This is the definition of ( when already inside a level of parens. 3787 % This is the definition of ( when already inside a level of parens.
3625 \gdef\opnested{\char`\(\global\advance\parencount by 1 } 3788 \gdef\opnested{\char`\(\global\advance\parencount by 1 }
3626 % 3789 %
3627 \gdef\clrm{% Print a paren in roman if it is taking us back to depth of 0. 3790 \gdef\clrm{% Print a paren in roman if it is taking us back to depth of 0.
3628 % also in that case restore the outer-level definition of (. 3791 % also in that case restore the outer-level definition of (.
3629 \ifnum \parencount=1 {\rm \char `\)}\sl \let(=\oprm \else \char `\) \fi 3792 \ifnum \parencount=1 {\rm \char `\)}\sl \let(=\oprm \else \char `\) \fi
3630 \global\advance \parencount by -1 } 3793 \global\advance \parencount by -1 }
3631 % If we encounter &foo, then turn on ()-hacking afterwards 3794 % If we encounter &foo, then turn on ()-hacking afterwards
3632 \gdef\amprm#1 {{\rm\&#1}\let(=\oprm \let)=\clrm\ } 3795 \gdef\amprm#1 {{\rm\&#1}\let(=\oprm \let)=\clrm\ }
3633 % 3796 %
3634 \gdef\normalparens{\boldbrax\let&=\ampnr} 3797 \gdef\normalparens{\boldbrax\let&=\ampnr}
3635 } % End of definition inside \activeparens 3798 } % End of definition inside \activeparens
3636 %% These parens (in \boldbrax) actually are a little bolder than the 3799 %% These parens (in \boldbrax) actually are a little bolder than the
3637 %% contained text. This is especially needed for [ and ] 3800 %% contained text. This is especially needed for [ and ]
3638 \def\opnr{{\sf\char`\(}} \def\clnr{{\sf\char`\)}} \def\ampnr{\&} 3801 \def\opnr{{\sf\char`\(}\global\advance\parencount by 1 }
3639 \def\lbrb{{\bf\char`\[}} \def\rbrb{{\bf\char`\]}} 3802 \def\clnr{{\sf\char`\)}\global\advance\parencount by -1 }
3803 \def\ampnr{\&}
3804 \def\lbrb{{\bf\char`\[}}
3805 \def\rbrb{{\bf\char`\]}}
3640 3806
3641 % First, defname, which formats the header line itself. 3807 % First, defname, which formats the header line itself.
3642 % #1 should be the function name. 3808 % #1 should be the function name.
3643 % #2 should be the type of definition, such as "Function". 3809 % #2 should be the type of definition, such as "Function".
3644 3810
3727 \catcode 61=\active % 3893 \catcode 61=\active %
3728 \obeylines\spacesplit#3} 3894 \obeylines\spacesplit#3}
3729 3895
3730 % This is used for \def{tp,vr}parsebody. It could probably be used for 3896 % This is used for \def{tp,vr}parsebody. It could probably be used for
3731 % some of the others, too, with some judicious conditionals. 3897 % some of the others, too, with some judicious conditionals.
3732 % 3898 %
3733 \def\parsebodycommon#1#2#3{% 3899 \def\parsebodycommon#1#2#3{%
3734 \begingroup\inENV % 3900 \begingroup\inENV %
3735 \medbreak % 3901 \medbreak %
3736 % Define the end token that this defining construct specifies 3902 % Define the end token that this defining construct specifies
3737 % so that it will exit this group. 3903 % so that it will exit this group.
3761 \parsebodycommon{#1}{#2}{#3}% 3927 \parsebodycommon{#1}{#2}{#3}%
3762 \spacesplit{\parsetpheaderline{#3{#4}}}\empty 3928 \spacesplit{\parsetpheaderline{#3{#4}}}\empty
3763 } 3929 }
3764 3930
3765 % Fine, but then we have to eventually remove the \empty *and* the 3931 % Fine, but then we have to eventually remove the \empty *and* the
3766 % braces (if any). That's what this does, putting the result in \tptemp. 3932 % braces (if any). That's what this does.
3767 % 3933 %
3768 \def\removeemptybraces\empty#1\relax{\def\tptemp{#1}}% 3934 \def\removeemptybraces\empty#1\relax{#1}
3769 3935
3770 % After \spacesplit has done its work, this is called -- #1 is the final 3936 % After \spacesplit has done its work, this is called -- #1 is the final
3771 % thing to call, #2 the type name (which starts with \empty), and #3 3937 % thing to call, #2 the type name (which starts with \empty), and #3
3772 % (which might be empty) the arguments. 3938 % (which might be empty) the arguments.
3773 % 3939 %
3774 \def\parsetpheaderline#1#2#3{% 3940 \def\parsetpheaderline#1#2#3{%
3775 \removeemptybraces#2\relax 3941 #1{\removeemptybraces#2\relax}{#3}%
3776 #1{\tptemp}{#3}%
3777 }% 3942 }%
3778 3943
3779 \def\defopvarparsebody #1#2#3#4#5 {\begingroup\inENV % 3944 \def\defopvarparsebody #1#2#3#4#5 {\begingroup\inENV %
3780 \medbreak % 3945 \medbreak %
3781 % Define the end token that this defining construct specifies 3946 % Define the end token that this defining construct specifies
3812 % Expand, preventing hyphenation at `-' chars. 3977 % Expand, preventing hyphenation at `-' chars.
3813 % Note that groups don't affect changes in \hyphenchar. 3978 % Note that groups don't affect changes in \hyphenchar.
3814 \hyphenchar\tensl=0 3979 \hyphenchar\tensl=0
3815 #1% 3980 #1%
3816 \hyphenchar\tensl=45 3981 \hyphenchar\tensl=45
3817 \ifnum\parencount=0 \else \errmessage{unbalanced parens in @def arguments}\fi% 3982 \ifnum\parencount=0 \else \errmessage{Unbalanced parentheses in @def}\fi%
3818 \interlinepenalty=10000 3983 \interlinepenalty=10000
3819 \advance\rightskip by 0pt plus 1fil 3984 \advance\rightskip by 0pt plus 1fil
3820 \endgraf\penalty 10000\vskip -\parskip\penalty 10000% 3985 \endgraf\penalty 10000\vskip -\parskip\penalty 10000%
3821 } 3986 }
3822 3987
3913 \def\deffnx #1 {\errmessage{@deffnx in invalid context}} 4078 \def\deffnx #1 {\errmessage{@deffnx in invalid context}}
3914 \def\defunx #1 {\errmessage{@defunx in invalid context}} 4079 \def\defunx #1 {\errmessage{@defunx in invalid context}}
3915 \def\defmacx #1 {\errmessage{@defmacx in invalid context}} 4080 \def\defmacx #1 {\errmessage{@defmacx in invalid context}}
3916 \def\defspecx #1 {\errmessage{@defspecx in invalid context}} 4081 \def\defspecx #1 {\errmessage{@defspecx in invalid context}}
3917 \def\deftypefnx #1 {\errmessage{@deftypefnx in invalid context}} 4082 \def\deftypefnx #1 {\errmessage{@deftypefnx in invalid context}}
4083 \def\deftypemethodx #1 {\errmessage{@deftypemethodx in invalid context}}
3918 \def\deftypeunx #1 {\errmessage{@deftypeunx in invalid context}} 4084 \def\deftypeunx #1 {\errmessage{@deftypeunx in invalid context}}
3919 4085
3920 % @defmethod, and so on 4086 % @defmethod, and so on
3921 4087
3922 % @defop {Funny Method} foo-class frobnicate argument 4088 % @defop {Funny Method} foo-class frobnicate argument
3926 4092
3927 \def\defopheader #1#2#3{% 4093 \def\defopheader #1#2#3{%
3928 \dosubind {fn}{\code{#2}}{on #1}% Make entry in function index 4094 \dosubind {fn}{\code{#2}}{on #1}% Make entry in function index
3929 \begingroup\defname {#2}{\defoptype{} on #1}% 4095 \begingroup\defname {#2}{\defoptype{} on #1}%
3930 \defunargs {#3}\endgroup % 4096 \defunargs {#3}\endgroup %
4097 }
4098
4099 % @deftypemethod foo-class return-type foo-method args
4100 %
4101 \def\deftypemethod{%
4102 \defmethparsebody\Edeftypemethod\deftypemethodx\deftypemethodheader}
4103 %
4104 % #1 is the class name, #2 the data type, #3 the method name, #4 the args.
4105 \def\deftypemethodheader#1#2#3#4{%
4106 \deftypefnheaderx{Method on #1}{#2}#3 #4\relax
3931 } 4107 }
3932 4108
3933 % @defmethod == @defop Method 4109 % @defmethod == @defop Method
3934 4110
3935 \def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader} 4111 \def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader}
4005 4181
4006 % @deftypevar int foobar 4182 % @deftypevar int foobar
4007 4183
4008 \def\deftypevar{\defvarparsebody\Edeftypevar\deftypevarx\deftypevarheader} 4184 \def\deftypevar{\defvarparsebody\Edeftypevar\deftypevarx\deftypevarheader}
4009 4185
4010 % #1 is the data type. #2 is the name. 4186 % #1 is the data type. #2 is the name, perhaps followed by text that
4187 % is actually part of the data type, which should not be put into the index.
4011 \def\deftypevarheader #1#2{% 4188 \def\deftypevarheader #1#2{%
4012 \doind {vr}{\code{#2}}% Make entry in variables index 4189 \dovarind#2 \relax% Make entry in variables index
4013 \begingroup\defname {\defheaderxcond#1\relax$$$#2}{Variable}% 4190 \begingroup\defname {\defheaderxcond#1\relax$$$#2}{Variable}%
4014 \interlinepenalty=10000 4191 \interlinepenalty=10000
4015 \endgraf\penalty 10000\vskip -\parskip\penalty 10000 4192 \endgraf\penalty 10000\vskip -\parskip\penalty 10000
4016 \endgroup} 4193 \endgroup}
4194 \def\dovarind#1 #2\relax{\doind{vr}{\code{#1}}}
4017 4195
4018 % @deftypevr {Global Flag} int enable 4196 % @deftypevr {Global Flag} int enable
4019 4197
4020 \def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader} 4198 \def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader}
4021 4199
4022 \def\deftypevrheader #1#2#3{\doind {vr}{\code{#3}}% 4200 \def\deftypevrheader #1#2#3{\dovarind#3 \relax%
4023 \begingroup\defname {\defheaderxcond#2\relax$$$#3}{#1} 4201 \begingroup\defname {\defheaderxcond#2\relax$$$#3}{#1}
4024 \interlinepenalty=10000 4202 \interlinepenalty=10000
4025 \endgraf\penalty 10000\vskip -\parskip\penalty 10000 4203 \endgraf\penalty 10000\vskip -\parskip\penalty 10000
4026 \endgroup} 4204 \endgroup}
4027 4205
4140 4318
4141 % \dosetq is the interface for calls from other macros 4319 % \dosetq is the interface for calls from other macros
4142 4320
4143 % Use \turnoffactive so that punctuation chars such as underscore 4321 % Use \turnoffactive so that punctuation chars such as underscore
4144 % work in node names. 4322 % work in node names.
4145 \def\dosetq #1#2{{\let\folio=0 \turnoffactive \auxhat% 4323 \def\dosetq #1#2{{\let\folio=0 \turnoffactive
4146 \edef\next{\write\auxfile{\internalsetq {#1}{#2}}}% 4324 \edef\next{\write\auxfile{\internalsetq {#1}{#2}}}%
4147 \next}} 4325 \next}}
4148 4326
4149 % \internalsetq {foo}{page} expands into 4327 % \internalsetq {foo}{page} expands into
4150 % CHARACTERS 'xrdef {foo}{...expansion of \Ypage...} 4328 % CHARACTERS 'xrdef {foo}{...expansion of \Ypage...}
4209 \csname X#1\endcsname 4387 \csname X#1\endcsname
4210 \fi 4388 \fi
4211 #2% Output the suffix in any case. 4389 #2% Output the suffix in any case.
4212 } 4390 }
4213 4391
4392 % This is the macro invoked by entries in the aux file.
4393 \def\xrdef #1#2{{%
4394 \catcode`\'=\other
4395 \expandafter\gdef\csname X#1\endcsname{#2}%
4396 }}
4397
4214 % Read the last existing aux file, if any. No error if none exists. 4398 % Read the last existing aux file, if any. No error if none exists.
4215 4399 \def\readauxfile{\begingroup
4216 % This is the macro invoked by entries in the aux file. 4400 \catcode`\^^@=\other
4217 \def\xrdef #1#2{ 4401 \catcode`\^^A=\other
4218 {\catcode`\'=\other\expandafter \gdef \csname X#1\endcsname {#2}}} 4402 \catcode`\^^B=\other
4219 4403 \catcode`\^^C=\other
4220 \def\readauxfile{% 4404 \catcode`\^^D=\other
4221 \begingroup 4405 \catcode`\^^E=\other
4222 \catcode `\^^@=\other 4406 \catcode`\^^F=\other
4223 \catcode `\=\other 4407 \catcode`\^^G=\other
4224 \catcode `\=\other 4408 \catcode`\^^H=\other
4225 \catcode `\^^C=\other 4409 \catcode`\^^K=\other
4226 \catcode `\^^D=\other 4410 \catcode`\^^L=\other
4227 \catcode `\^^E=\other 4411 \catcode`\^^N=\other
4228 \catcode `\^^F=\other 4412 \catcode`\^^P=\other
4229 \catcode `\^^G=\other 4413 \catcode`\^^Q=\other
4230 \catcode `\^^H=\other 4414 \catcode`\^^R=\other
4231 \catcode `\ =\other 4415 \catcode`\^^S=\other
4232 \catcode `\^^L=\other 4416 \catcode`\^^T=\other
4233 \catcode `\=\other 4417 \catcode`\^^U=\other
4234 \catcode `\=\other 4418 \catcode`\^^V=\other
4235 \catcode `\=\other 4419 \catcode`\^^W=\other
4236 \catcode `\=\other 4420 \catcode`\^^X=\other
4237 \catcode `\=\other 4421 \catcode`\^^Z=\other
4238 \catcode `\=\other 4422 \catcode`\^^[=\other
4239 \catcode `\=\other 4423 \catcode`\^^\=\other
4240 \catcode `\=\other 4424 \catcode`\^^]=\other
4241 \catcode `\=\other 4425 \catcode`\^^^=\other
4242 \catcode `\=\other 4426 \catcode`\^^_=\other
4243 \catcode `\=\other 4427 \catcode`\@=\other
4244 \catcode `\=\other 4428 \catcode`\^=\other
4245 \catcode 26=\other 4429 % It was suggested to define this as 7, which would allow ^^e4 etc.
4246 \catcode `\^^[=\other 4430 % in xref tags, i.e., node names. But since ^^e4 notation isn't
4247 \catcode `\^^\=\other 4431 % supported in the main text, it doesn't seem desirable. Furthermore,
4248 \catcode `\^^]=\other 4432 % that is not enough: for node names that actually contain a ^
4249 \catcode `\^^^=\other 4433 % character, we would end up writing a line like this: 'xrdef {'hat
4250 \catcode `\^^_=\other 4434 % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first
4251 \catcode `\@=\other 4435 % argument, and \hat is not an expandable control sequence. It could
4252 \catcode `\^=\other 4436 % all be worked out, but why? Either we support ^^ or we don't.
4253 \catcode `\~=\other 4437 %
4254 \catcode `\[=\other 4438 % The other change necessary for this was to define \auxhat:
4255 \catcode `\]=\other 4439 % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter
4256 \catcode`\"=\other 4440 % and then to call \auxhat in \setq.
4257 \catcode`\_=\other 4441 %
4258 \catcode`\|=\other 4442 \catcode`\~=\other
4259 \catcode`\<=\other 4443 \catcode`\[=\other
4260 \catcode`\>=\other 4444 \catcode`\]=\other
4261 \catcode `\$=\other 4445 \catcode`\"=\other
4262 \catcode `\#=\other 4446 \catcode`\_=\other
4263 \catcode `\&=\other 4447 \catcode`\|=\other
4264 % `\+ does not work, so use 43. 4448 \catcode`\<=\other
4265 \catcode 43=\other 4449 \catcode`\>=\other
4266 % Make the characters 128-255 be printing characters 4450 \catcode`\$=\other
4267 {% 4451 \catcode`\#=\other
4268 \count 1=128 4452 \catcode`\&=\other
4269 \def\loop{% 4453 % `\+ does not work, so use 43.
4270 \catcode\count 1=\other 4454 \catcode43=\other
4271 \advance\count 1 by 1 4455 % Make the characters 128-255 be printing characters
4272 \ifnum \count 1<256 \loop \fi 4456 {%
4457 \count 1=128
4458 \def\loop{%
4459 \catcode\count 1=\other
4460 \advance\count 1 by 1
4461 \ifnum \count 1<256 \loop \fi
4462 }%
4273 }% 4463 }%
4274 }% 4464 % The aux file uses ' as the escape (for now).
4275 % the aux file uses ' as the escape. 4465 % Turn off \ as an escape so we do not lose on
4276 % Turn off \ as an escape so we do not lose on 4466 % entries which were dumped with control sequences in their names.
4277 % entries which were dumped with control sequences in their names. 4467 % For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^
4278 % For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^ 4468 % Reference to such entries still does not work the way one would wish,
4279 % Reference to such entries still does not work the way one would wish, 4469 % but at least they do not bomb out when the aux file is read in.
4280 % but at least they do not bomb out when the aux file is read in. 4470 \catcode`\{=1
4281 \catcode `\{=1 \catcode `\}=2 4471 \catcode`\}=2
4282 \catcode `\%=\other 4472 \catcode`\%=\other
4283 \catcode `\'=0 4473 \catcode`\'=0
4284 \catcode`\^=7 % to make ^^e4 etc usable in xref tags 4474 \catcode`\\=\other
4285 \catcode `\\=\other 4475 %
4286 \openin 1 \jobname.aux 4476 \openin 1 \jobname.aux
4287 \ifeof 1 \else \closein 1 \input \jobname.aux \global\havexrefstrue 4477 \ifeof 1 \else
4288 \global\warnedobstrue 4478 \closein 1
4289 \fi 4479 \input \jobname.aux
4290 % Open the new aux file. Tex will close it automatically at exit. 4480 \global\havexrefstrue
4291 \openout \auxfile=\jobname.aux 4481 \global\warnedobstrue
4482 \fi
4483 % Open the new aux file. TeX will close it automatically at exit.
4484 \openout\auxfile=\jobname.aux
4292 \endgroup} 4485 \endgroup}
4293 4486
4294 4487
4295 % Footnotes. 4488 % Footnotes.
4296 4489
4301 % pagealignmacro call if that space before the closing brace is 4494 % pagealignmacro call if that space before the closing brace is
4302 % removed. (Generally, numeric constants should always be followed by a 4495 % removed. (Generally, numeric constants should always be followed by a
4303 % space to prevent strange expansion errors.) 4496 % space to prevent strange expansion errors.)
4304 \def\supereject{\par\penalty -20000\footnoteno =0 } 4497 \def\supereject{\par\penalty -20000\footnoteno =0 }
4305 4498
4306 % @footnotestyle is meaningful for info output only.. 4499 % @footnotestyle is meaningful for info output only.
4307 \let\footnotestyle=\comment 4500 \let\footnotestyle=\comment
4308 4501
4309 \let\ptexfootnote=\footnote 4502 \let\ptexfootnote=\footnote
4310 4503
4311 {\catcode `\@=11 4504 {\catcode `\@=11
4327 }% 4520 }%
4328 4521
4329 % Don't bother with the trickery in plain.tex to not require the 4522 % Don't bother with the trickery in plain.tex to not require the
4330 % footnote text as a parameter. Our footnotes don't need to be so general. 4523 % footnote text as a parameter. Our footnotes don't need to be so general.
4331 % 4524 %
4332 \long\gdef\footnotezzz#1{\insert\footins{% 4525 % Oh yes, they do; otherwise, @ifset and anything else that uses
4526 % \parseargline fail inside footnotes because the tokens are fixed when
4527 % the footnote is read. --karl, 16nov96.
4528 %
4529 \long\gdef\footnotezzz{\insert\footins\bgroup
4333 % We want to typeset this text as a normal paragraph, even if the 4530 % We want to typeset this text as a normal paragraph, even if the
4334 % footnote reference occurs in (for example) a display environment. 4531 % footnote reference occurs in (for example) a display environment.
4335 % So reset some parameters. 4532 % So reset some parameters.
4336 \interlinepenalty\interfootnotelinepenalty 4533 \interlinepenalty\interfootnotelinepenalty
4337 \splittopskip\ht\strutbox % top baseline for broken footnotes 4534 \splittopskip\ht\strutbox % top baseline for broken footnotes
4349 % 4546 %
4350 % Don't crash into the line above the footnote text. Since this 4547 % Don't crash into the line above the footnote text. Since this
4351 % expands into a box, it must come within the paragraph, lest it 4548 % expands into a box, it must come within the paragraph, lest it
4352 % provide a place where TeX can split the footnote. 4549 % provide a place where TeX can split the footnote.
4353 \footstrut 4550 \footstrut
4354 #1\strut}% 4551 \futurelet\next\fo@t
4355 } 4552 }
4553 \def\fo@t{\ifcat\bgroup\noexpand\next \let\next\f@@t
4554 \else\let\next\f@t\fi \next}
4555 \def\f@@t{\bgroup\aftergroup\@foot\let\next}
4556 \def\f@t#1{#1\@foot}
4557 \def\@foot{\strut\egroup}
4356 4558
4357 }%end \catcode `\@=11 4559 }%end \catcode `\@=11
4358 4560
4359 % Set the baselineskip to #1, and the lineskip and strut size 4561 % Set the baselineskip to #1, and the lineskip and strut size
4360 % correspondingly. There is no deep meaning behind these magic numbers 4562 % correspondingly. There is no deep meaning behind these magic numbers
4407 % that mark overfull boxes (in case you have decided 4609 % that mark overfull boxes (in case you have decided
4408 % that the text looks ok even though it passes the margin). 4610 % that the text looks ok even though it passes the margin).
4409 % 4611 %
4410 \def\finalout{\overfullrule=0pt} 4612 \def\finalout{\overfullrule=0pt}
4411 4613
4614 % @image. We use the macros from epsf.tex to support this.
4615 % If epsf.tex is not installed and @image is used, we complain.
4616 %
4617 % Check for and read epsf.tex up front. If we read it only at @image
4618 % time, we might be inside a group, and then its definitions would get
4619 % undone and the next image would fail.
4620 \openin 1 = xepsf.tex
4621 \ifeof 1 \else
4622 \closein 1
4623 \def\epsfannounce{\toks0 = }% do not bother showing banner
4624 \input epsf.tex
4625 \fi
4626 %
4627 \newif\ifwarnednoepsf
4628 \newhelp\noepsfhelp{epsf.tex must be installed for images to
4629 work. It is also included in the Texinfo distribution, or you can get
4630 it from ftp://ftp.tug.org/tex/epsf.tex.}
4631 %
4632 % Only complain once about lack of epsf.tex.
4633 \def\image#1{%
4634 \ifx\epsfbox\undefined
4635 \ifwarnednoepsf \else
4636 \errhelp = \noepsfhelp
4637 \errmessage{epsf.tex not found, images will be ignored}%
4638 \global\warnednoepsftrue
4639 \fi
4640 \else
4641 \imagexxx #1,,,\finish
4642 \fi
4643 }
4644 %
4645 % Arguments to @image:
4646 % #1 is (mandatory) image filename; we tack on .eps extension.
4647 % #2 is (optional) width, #3 is (optional) height.
4648 % #4 is just the usual extra ignored arg for parsing this stuff.
4649 \def\imagexxx#1,#2,#3,#4\finish{%
4650 % \epsfbox itself resets \epsf?size at each figure.
4651 \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
4652 \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
4653 \epsfbox{#1.eps}%
4654 }
4412 4655
4413 % End of control word definitions. 4656 % End of control word definitions.
4657
4414 4658
4415 \message{and turning on texinfo input format.} 4659 \message{and turning on texinfo input format.}
4416 4660
4417 \def\openindices{% 4661 \def\openindices{%
4418 \newindex{cp}% 4662 \newindex{cp}%
4582 \let"=\activedoublequote 4826 \let"=\activedoublequote
4583 \catcode`\~=\active 4827 \catcode`\~=\active
4584 \def~{{\tt \char '176}} 4828 \def~{{\tt \char '176}}
4585 \chardef\hat=`\^ 4829 \chardef\hat=`\^
4586 \catcode`\^=\active 4830 \catcode`\^=\active
4587 \def\auxhat{\def^{'hat}}
4588 \def^{{\tt \hat}} 4831 \def^{{\tt \hat}}
4589 4832
4590 \catcode`\_=\active 4833 \catcode`\_=\active
4591 \def_{\ifusingtt\normalunderscore\_} 4834 \def_{\ifusingtt\normalunderscore\_}
4592 % Subroutine for the previous macro. 4835 % Subroutine for the previous macro.