aboutsummaryrefslogtreecommitdiff
path: root/doc/texinfo.tex
diff options
context:
space:
mode:
Diffstat (limited to 'doc/texinfo.tex')
-rw-r--r--doc/texinfo.tex1874
1 files changed, 626 insertions, 1248 deletions
diff --git a/doc/texinfo.tex b/doc/texinfo.tex
index 2abda0f3..91408263 100644
--- a/doc/texinfo.tex
+++ b/doc/texinfo.tex
@@ -3,11 +3,11 @@
3% Load plain if necessary, i.e., if running under initex. 3% Load plain if necessary, i.e., if running under initex.
4\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi 4\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
5% 5%
6\def\texinfoversion{2012-01-03.09} 6\def\texinfoversion{2009-08-14.15}
7% 7%
8% Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, 8% Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
9% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 9% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
10% 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. 10% 2007, 2008, 2009 Free Software Foundation, Inc.
11% 11%
12% This texinfo.tex file is free software: you can redistribute it and/or 12% This texinfo.tex file is free software: you can redistribute it and/or
13% modify it under the terms of the GNU General Public License as 13% modify it under the terms of the GNU General Public License as
@@ -65,6 +65,7 @@
65\everyjob{\message{[Texinfo version \texinfoversion]}% 65\everyjob{\message{[Texinfo version \texinfoversion]}%
66 \catcode`+=\active \catcode`\_=\active} 66 \catcode`+=\active \catcode`\_=\active}
67 67
68
68\chardef\other=12 69\chardef\other=12
69 70
70% We never want plain's \outer definition of \+ in Texinfo. 71% We never want plain's \outer definition of \+ in Texinfo.
@@ -92,13 +93,14 @@
92\let\ptexnewwrite\newwrite 93\let\ptexnewwrite\newwrite
93\let\ptexnoindent=\noindent 94\let\ptexnoindent=\noindent
94\let\ptexplus=+ 95\let\ptexplus=+
95\let\ptexraggedright=\raggedright
96\let\ptexrbrace=\} 96\let\ptexrbrace=\}
97\let\ptexslash=\/ 97\let\ptexslash=\/
98\let\ptexstar=\* 98\let\ptexstar=\*
99\let\ptext=\t 99\let\ptext=\t
100\let\ptextop=\top 100\let\ptextop=\top
101{\catcode`\'=\active \global\let\ptexquoteright'}% active in plain's math mode 101{\catcode`\'=\active
102\global\let\ptexquoteright'}% Math-mode def from plain.tex.
103\let\ptexraggedright=\raggedright
102 104
103% If this character appears in an error message or help string, it 105% If this character appears in an error message or help string, it
104% starts a new line in the output. 106% starts a new line in the output.
@@ -116,11 +118,10 @@
116% Set up fixed words for English if not already set. 118% Set up fixed words for English if not already set.
117\ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi 119\ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi
118\ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi 120\ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi
119\ifx\putworderror\undefined \gdef\putworderror{error}\fi
120\ifx\putwordfile\undefined \gdef\putwordfile{file}\fi 121\ifx\putwordfile\undefined \gdef\putwordfile{file}\fi
121\ifx\putwordin\undefined \gdef\putwordin{in}\fi 122\ifx\putwordin\undefined \gdef\putwordin{in}\fi
122\ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi 123\ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi
123\ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi 124\ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi
124\ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi 125\ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi
125\ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi 126\ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi
126\ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi 127\ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi
@@ -159,18 +160,15 @@
159\def\spaceisspace{\catcode`\ =\spacecat} 160\def\spaceisspace{\catcode`\ =\spacecat}
160 161
161% sometimes characters are active, so we need control sequences. 162% sometimes characters are active, so we need control sequences.
162\chardef\ampChar = `\&
163\chardef\colonChar = `\: 163\chardef\colonChar = `\:
164\chardef\commaChar = `\, 164\chardef\commaChar = `\,
165\chardef\dashChar = `\- 165\chardef\dashChar = `\-
166\chardef\dotChar = `\. 166\chardef\dotChar = `\.
167\chardef\exclamChar= `\! 167\chardef\exclamChar= `\!
168\chardef\hashChar = `\#
169\chardef\lquoteChar= `\` 168\chardef\lquoteChar= `\`
170\chardef\questChar = `\? 169\chardef\questChar = `\?
171\chardef\rquoteChar= `\' 170\chardef\rquoteChar= `\'
172\chardef\semiChar = `\; 171\chardef\semiChar = `\;
173\chardef\slashChar = `\/
174\chardef\underChar = `\_ 172\chardef\underChar = `\_
175 173
176% Ignore a token. 174% Ignore a token.
@@ -201,7 +199,36 @@
201% that mark overfull boxes (in case you have decided 199% that mark overfull boxes (in case you have decided
202% that the text looks ok even though it passes the margin). 200% that the text looks ok even though it passes the margin).
203% 201%
204\def\finalout{\overfullrule=0pt } 202\def\finalout{\overfullrule=0pt}
203
204% @| inserts a changebar to the left of the current line. It should
205% surround any changed text. This approach does *not* work if the
206% change spans more than two lines of output. To handle that, we would
207% have adopt a much more difficult approach (putting marks into the main
208% vertical list for the beginning and end of each change).
209%
210\def\|{%
211 % \vadjust can only be used in horizontal mode.
212 \leavevmode
213 %
214 % Append this vertical mode material after the current line in the output.
215 \vadjust{%
216 % We want to insert a rule with the height and depth of the current
217 % leading; that is exactly what \strutbox is supposed to record.
218 \vskip-\baselineskip
219 %
220 % \vadjust-items are inserted at the left edge of the type. So
221 % the \llap here moves out into the left-hand margin.
222 \llap{%
223 %
224 % For a thicker or thinner bar, change the `1pt'.
225 \vrule height\baselineskip width1pt
226 %
227 % This is the space between the bar and the text.
228 \hskip 12pt
229 }%
230 }%
231}
205 232
206% Sometimes it is convenient to have everything in the transcript file 233% Sometimes it is convenient to have everything in the transcript file
207% and nothing on the terminal. We don't just call \tracingall here, 234% and nothing on the terminal. We don't just call \tracingall here,
@@ -219,7 +246,7 @@
219 \tracingmacros2 246 \tracingmacros2
220 \tracingrestores1 247 \tracingrestores1
221 \showboxbreadth\maxdimen \showboxdepth\maxdimen 248 \showboxbreadth\maxdimen \showboxdepth\maxdimen
222 \ifx\eTeXversion\thisisundefined\else % etex gives us more logging 249 \ifx\eTeXversion\undefined\else % etex gives us more logging
223 \tracingscantokens1 250 \tracingscantokens1
224 \tracingifs1 251 \tracingifs1
225 \tracinggroups1 252 \tracinggroups1
@@ -230,13 +257,6 @@
230 \errorcontextlines16 257 \errorcontextlines16
231}% 258}%
232 259
233% @errormsg{MSG}. Do the index-like expansions on MSG, but if things
234% aren't perfect, it's not the end of the world, being an error message,
235% after all.
236%
237\def\errormsg{\begingroup \indexnofonts \doerrormsg}
238\def\doerrormsg#1{\errmessage{#1}}
239
240% add check for \lastpenalty to plain's definitions. If the last thing 260% add check for \lastpenalty to plain's definitions. If the last thing
241% we did was a \nobreak, we don't want to insert more space. 261% we did was a \nobreak, we don't want to insert more space.
242% 262%
@@ -247,6 +267,7 @@
247\def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount 267\def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount
248 \removelastskip\penalty-200\bigskip\fi\fi} 268 \removelastskip\penalty-200\bigskip\fi\fi}
249 269
270% For @cropmarks command.
250% Do @cropmarks to get crop marks. 271% Do @cropmarks to get crop marks.
251% 272%
252\newif\ifcropmarks 273\newif\ifcropmarks
@@ -556,7 +577,7 @@
556} 577}
557\def\inenvironment#1{% 578\def\inenvironment#1{%
558 \ifx#1\empty 579 \ifx#1\empty
559 outside of any environment% 580 out of any environment%
560 \else 581 \else
561 in environment \expandafter\string#1% 582 in environment \expandafter\string#1%
562 \fi 583 \fi
@@ -568,7 +589,7 @@
568\parseargdef\end{% 589\parseargdef\end{%
569 \if 1\csname iscond.#1\endcsname 590 \if 1\csname iscond.#1\endcsname
570 \else 591 \else
571 % The general wording of \badenverr may not be ideal. 592 % The general wording of \badenverr may not be ideal, but... --kasal, 06nov03
572 \expandafter\checkenv\csname#1\endcsname 593 \expandafter\checkenv\csname#1\endcsname
573 \csname E#1\endcsname 594 \csname E#1\endcsname
574 \endgroup 595 \endgroup
@@ -578,6 +599,85 @@
578\newhelp\EMsimple{Press RETURN to continue.} 599\newhelp\EMsimple{Press RETURN to continue.}
579 600
580 601
602%% Simple single-character @ commands
603
604% @@ prints an @
605% Kludge this until the fonts are right (grr).
606\def\@{{\tt\char64}}
607
608% This is turned off because it was never documented
609% and you can use @w{...} around a quote to suppress ligatures.
610%% Define @` and @' to be the same as ` and '
611%% but suppressing ligatures.
612%\def\`{{`}}
613%\def\'{{'}}
614
615% Used to generate quoted braces.
616\def\mylbrace {{\tt\char123}}
617\def\myrbrace {{\tt\char125}}
618\let\{=\mylbrace
619\let\}=\myrbrace
620\begingroup
621 % Definitions to produce \{ and \} commands for indices,
622 % and @{ and @} for the aux/toc files.
623 \catcode`\{ = \other \catcode`\} = \other
624 \catcode`\[ = 1 \catcode`\] = 2
625 \catcode`\! = 0 \catcode`\\ = \other
626 !gdef!lbracecmd[\{]%
627 !gdef!rbracecmd[\}]%
628 !gdef!lbraceatcmd[@{]%
629 !gdef!rbraceatcmd[@}]%
630!endgroup
631
632% @comma{} to avoid , parsing problems.
633\let\comma = ,
634
635% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
636% Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H.
637\let\, = \c
638\let\dotaccent = \.
639\def\ringaccent#1{{\accent23 #1}}
640\let\tieaccent = \t
641\let\ubaraccent = \b
642\let\udotaccent = \d
643
644% Other special characters: @questiondown @exclamdown @ordf @ordm
645% Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
646\def\questiondown{?`}
647\def\exclamdown{!`}
648\def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}}
649\def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}}
650
651% Dotless i and dotless j, used for accents.
652\def\imacro{i}
653\def\jmacro{j}
654\def\dotless#1{%
655 \def\temp{#1}%
656 \ifx\temp\imacro \ifmmode\imath \else\ptexi \fi
657 \else\ifx\temp\jmacro \ifmmode\jmath \else\j \fi
658 \else \errmessage{@dotless can be used only with i or j}%
659 \fi\fi
660}
661
662% The \TeX{} logo, as in plain, but resetting the spacing so that a
663% period following counts as ending a sentence. (Idea found in latex.)
664%
665\edef\TeX{\TeX \spacefactor=1000 }
666
667% @LaTeX{} logo. Not quite the same results as the definition in
668% latex.ltx, since we use a different font for the raised A; it's most
669% convenient for us to use an explicitly smaller font, rather than using
670% the \scriptstyle font (since we don't reset \scriptstyle and
671% \scriptscriptstyle).
672%
673\def\LaTeX{%
674 L\kern-.36em
675 {\setbox0=\hbox{T}%
676 \vbox to \ht0{\hbox{\selectfonts\lllsize A}\vss}}%
677 \kern-.15em
678 \TeX
679}
680
581% Be sure we're in horizontal mode when doing a tie, since we make space 681% Be sure we're in horizontal mode when doing a tie, since we make space
582% equivalent to this in @example-like environments. Otherwise, a space 682% equivalent to this in @example-like environments. Otherwise, a space
583% at the beginning of a line will start with \penalty -- and 683% at the beginning of a line will start with \penalty -- and
@@ -619,7 +719,7 @@
619 \else\ifx\temp\offword \plainnonfrenchspacing 719 \else\ifx\temp\offword \plainnonfrenchspacing
620 \else 720 \else
621 \errhelp = \EMsimple 721 \errhelp = \EMsimple
622 \errmessage{Unknown @frenchspacing option `\temp', must be on|off}% 722 \errmessage{Unknown @frenchspacing option `\temp', must be on/off}%
623 \fi\fi 723 \fi\fi
624} 724}
625 725
@@ -701,6 +801,15 @@ where each line of input produces a line of output.}
701 801
702\newdimen\mil \mil=0.001in 802\newdimen\mil \mil=0.001in
703 803
804% Old definition--didn't work.
805%\parseargdef\need{\par %
806%% This method tries to make TeX break the page naturally
807%% if the depth of the box does not fit.
808%{\baselineskip=0pt%
809%\vtop to #1\mil{\vfil}\kern -#1\mil\nobreak
810%\prevdepth=-1000pt
811%}}
812
704\parseargdef\need{% 813\parseargdef\need{%
705 % Ensure vertical mode, so we don't make a big box in the middle of a 814 % Ensure vertical mode, so we don't make a big box in the middle of a
706 % paragraph. 815 % paragraph.
@@ -764,7 +873,7 @@ where each line of input produces a line of output.}
764 873
765% @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current 874% @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current
766% paragraph. For more general purposes, use the \margin insertion 875% paragraph. For more general purposes, use the \margin insertion
767% class. WHICH is `l' or `r'. Not documented, written for gawk manual. 876% class. WHICH is `l' or `r'.
768% 877%
769\newskip\inmarginspacing \inmarginspacing=1cm 878\newskip\inmarginspacing \inmarginspacing=1cm
770\def\strutdepth{\dp\strutbox} 879\def\strutdepth{\dp\strutbox}
@@ -811,36 +920,6 @@ where each line of input produces a line of output.}
811 \temp 920 \temp
812} 921}
813 922
814% @| inserts a changebar to the left of the current line. It should
815% surround any changed text. This approach does *not* work if the
816% change spans more than two lines of output. To handle that, we would
817% have adopt a much more difficult approach (putting marks into the main
818% vertical list for the beginning and end of each change). This command
819% is not documented, not supported, and doesn't work.
820%
821\def\|{%
822 % \vadjust can only be used in horizontal mode.
823 \leavevmode
824 %
825 % Append this vertical mode material after the current line in the output.
826 \vadjust{%
827 % We want to insert a rule with the height and depth of the current
828 % leading; that is exactly what \strutbox is supposed to record.
829 \vskip-\baselineskip
830 %
831 % \vadjust-items are inserted at the left edge of the type. So
832 % the \llap here moves out into the left-hand margin.
833 \llap{%
834 %
835 % For a thicker or thinner bar, change the `1pt'.
836 \vrule height\baselineskip width1pt
837 %
838 % This is the space between the bar and the text.
839 \hskip 12pt
840 }%
841 }%
842}
843
844% @include FILE -- \input text of FILE. 923% @include FILE -- \input text of FILE.
845% 924%
846\def\include{\parseargusing\filenamecatcodes\includezzz} 925\def\include{\parseargusing\filenamecatcodes\includezzz}
@@ -851,7 +930,6 @@ where each line of input produces a line of output.}
851 \makevalueexpandable % we want to expand any @value in FILE. 930 \makevalueexpandable % we want to expand any @value in FILE.
852 \turnoffactive % and allow special characters in the expansion 931 \turnoffactive % and allow special characters in the expansion
853 \indexnofonts % Allow `@@' and other weird things in file names. 932 \indexnofonts % Allow `@@' and other weird things in file names.
854 \wlog{texinfo.tex: doing @include of #1^^J}%
855 \edef\temp{\noexpand\input #1 }% 933 \edef\temp{\noexpand\input #1 }%
856 % 934 %
857 % This trickery is to read FILE outside of a group, in case it makes 935 % This trickery is to read FILE outside of a group, in case it makes
@@ -1017,6 +1095,109 @@ where each line of input produces a line of output.}
1017} 1095}
1018 1096
1019 1097
1098% @asis just yields its argument. Used with @table, for example.
1099%
1100\def\asis#1{#1}
1101
1102% @math outputs its argument in math mode.
1103%
1104% One complication: _ usually means subscripts, but it could also mean
1105% an actual _ character, as in @math{@var{some_variable} + 1}. So make
1106% _ active, and distinguish by seeing if the current family is \slfam,
1107% which is what @var uses.
1108{
1109 \catcode`\_ = \active
1110 \gdef\mathunderscore{%
1111 \catcode`\_=\active
1112 \def_{\ifnum\fam=\slfam \_\else\sb\fi}%
1113 }
1114}
1115% Another complication: we want \\ (and @\) to output a \ character.
1116% FYI, plain.tex uses \\ as a temporary control sequence (why?), but
1117% this is not advertised and we don't care. Texinfo does not
1118% otherwise define @\.
1119%
1120% The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.
1121\def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi}
1122%
1123\def\math{%
1124 \tex
1125 \mathunderscore
1126 \let\\ = \mathbackslash
1127 \mathactive
1128 % make the texinfo accent commands work in math mode
1129 \let\"=\ddot
1130 \let\'=\acute
1131 \let\==\bar
1132 \let\^=\hat
1133 \let\`=\grave
1134 \let\u=\breve
1135 \let\v=\check
1136 \let\~=\tilde
1137 \let\dotaccent=\dot
1138 $\finishmath
1139}
1140\def\finishmath#1{#1$\endgroup} % Close the group opened by \tex.
1141
1142% Some active characters (such as <) are spaced differently in math.
1143% We have to reset their definitions in case the @math was an argument
1144% to a command which sets the catcodes (such as @item or @section).
1145%
1146{
1147 \catcode`^ = \active
1148 \catcode`< = \active
1149 \catcode`> = \active
1150 \catcode`+ = \active
1151 \catcode`' = \active
1152 \gdef\mathactive{%
1153 \let^ = \ptexhat
1154 \let< = \ptexless
1155 \let> = \ptexgtr
1156 \let+ = \ptexplus
1157 \let' = \ptexquoteright
1158 }
1159}
1160
1161% Some math mode symbols.
1162\def\bullet{$\ptexbullet$}
1163\def\geq{\ifmmode \ge\else $\ge$\fi}
1164\def\leq{\ifmmode \le\else $\le$\fi}
1165\def\minus{\ifmmode -\else $-$\fi}
1166
1167% @dots{} outputs an ellipsis using the current font.
1168% We do .5em per period so that it has the same spacing in the cm
1169% typewriter fonts as three actual period characters; on the other hand,
1170% in other typewriter fonts three periods are wider than 1.5em. So do
1171% whichever is larger.
1172%
1173\def\dots{%
1174 \leavevmode
1175 \setbox0=\hbox{...}% get width of three periods
1176 \ifdim\wd0 > 1.5em
1177 \dimen0 = \wd0
1178 \else
1179 \dimen0 = 1.5em
1180 \fi
1181 \hbox to \dimen0{%
1182 \hskip 0pt plus.25fil
1183 .\hskip 0pt plus1fil
1184 .\hskip 0pt plus1fil
1185 .\hskip 0pt plus.5fil
1186 }%
1187}
1188
1189% @enddots{} is an end-of-sentence ellipsis.
1190%
1191\def\enddots{%
1192 \dots
1193 \spacefactor=\endofsentencespacefactor
1194}
1195
1196% @comma{} is so commas can be inserted into text without messing up
1197% Texinfo's parsing.
1198%
1199\let\comma = ,
1200
1020% @refill is a no-op. 1201% @refill is a no-op.
1021\let\refill=\relax 1202\let\refill=\relax
1022 1203
@@ -1081,8 +1262,9 @@ where each line of input produces a line of output.}
1081\newif\ifpdfmakepagedest 1262\newif\ifpdfmakepagedest
1082 1263
1083% when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1 1264% when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1
1084% can be set). So we test for \relax and 0 as well as being undefined. 1265% can be set). So we test for \relax and 0 as well as \undefined,
1085\ifx\pdfoutput\thisisundefined 1266% borrowed from ifpdf.sty.
1267\ifx\pdfoutput\undefined
1086\else 1268\else
1087 \ifx\pdfoutput\relax 1269 \ifx\pdfoutput\relax
1088 \else 1270 \else
@@ -1097,24 +1279,50 @@ where each line of input produces a line of output.}
1097% for display in the outlines, and in other places. Thus, we have to 1279% for display in the outlines, and in other places. Thus, we have to
1098% double any backslashes. Otherwise, a name like "\node" will be 1280% double any backslashes. Otherwise, a name like "\node" will be
1099% interpreted as a newline (\n), followed by o, d, e. Not good. 1281% interpreted as a newline (\n), followed by o, d, e. Not good.
1100% 1282% http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html
1101% See http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html and 1283% (and related messages, the final outcome is that it is up to the TeX
1102% related messages. The final outcome is that it is up to the TeX user 1284% user to double the backslashes and otherwise make the string valid, so
1103% to double the backslashes and otherwise make the string valid, so 1285% that's what we do).
1104% that's what we do. pdftex 1.30.0 (ca.2005) introduced a primitive to 1286
1105% do this reliably, so we use it. 1287% double active backslashes.
1106 1288%
1107% #1 is a control sequence in which to do the replacements, 1289{\catcode`\@=0 \catcode`\\=\active
1108% which we \xdef. 1290 @gdef@activebackslashdouble{%
1109\def\txiescapepdf#1{% 1291 @catcode`@\=@active
1110 \ifx\pdfescapestring\relax 1292 @let\=@doublebackslash}
1111 % No primitive available; should we give a warning or log? 1293}
1112 % Many times it won't matter. 1294
1113 \else 1295% To handle parens, we must adopt a different approach, since parens are
1114 % The expandable \pdfescapestring primitive escapes parentheses, 1296% not active characters. hyperref.dtx (which has the same problem as
1115 % backslashes, and other special chars. 1297% us) handles it with this amazing macro to replace tokens, with minor
1116 \xdef#1{\pdfescapestring{#1}}% 1298% changes for Texinfo. It is included here under the GPL by permission
1117 \fi 1299% from the author, Heiko Oberdiek.
1300%
1301% #1 is the tokens to replace.
1302% #2 is the replacement.
1303% #3 is the control sequence with the string.
1304%
1305\def\HyPsdSubst#1#2#3{%
1306 \def\HyPsdReplace##1#1##2\END{%
1307 ##1%
1308 \ifx\\##2\\%
1309 \else
1310 #2%
1311 \HyReturnAfterFi{%
1312 \HyPsdReplace##2\END
1313 }%
1314 \fi
1315 }%
1316 \xdef#3{\expandafter\HyPsdReplace#3#1\END}%
1317}
1318\long\def\HyReturnAfterFi#1\fi{\fi#1}
1319
1320% #1 is a control sequence in which to do the replacements.
1321\def\backslashparens#1{%
1322 \xdef#1{#1}% redefine it as its expansion; the definition is simply
1323 % \lastnode when called from \setref -> \pdfmkdest.
1324 \HyPsdSubst{(}{\realbackslash(}{#1}%
1325 \HyPsdSubst{)}{\realbackslash)}{#1}%
1118} 1326}
1119 1327
1120\newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images 1328\newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images
@@ -1176,31 +1384,29 @@ output) for that.)}
1176 \def\imagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}% 1384 \def\imagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}%
1177 \def\imageheight{#3}\setbox2 = \hbox{\ignorespaces #3}% 1385 \def\imageheight{#3}\setbox2 = \hbox{\ignorespaces #3}%
1178 % 1386 %
1179 % pdftex (and the PDF format) support .pdf, .png, .jpg (among 1387 % pdftex (and the PDF format) support .png, .jpg, .pdf (among
1180 % others). Let's try in that order, PDF first since if 1388 % others). Let's try in that order.
1181 % someone has a scalable image, presumably better to use that than a
1182 % bitmap.
1183 \let\pdfimgext=\empty 1389 \let\pdfimgext=\empty
1184 \begingroup 1390 \begingroup
1185 \openin 1 #1.pdf \ifeof 1 1391 \openin 1 #1.png \ifeof 1
1186 \openin 1 #1.PDF \ifeof 1 1392 \openin 1 #1.jpg \ifeof 1
1187 \openin 1 #1.png \ifeof 1 1393 \openin 1 #1.jpeg \ifeof 1
1188 \openin 1 #1.jpg \ifeof 1 1394 \openin 1 #1.JPG \ifeof 1
1189 \openin 1 #1.jpeg \ifeof 1 1395 \openin 1 #1.pdf \ifeof 1
1190 \openin 1 #1.JPG \ifeof 1 1396 \openin 1 #1.PDF \ifeof 1
1191 \errhelp = \nopdfimagehelp 1397 \errhelp = \nopdfimagehelp
1192 \errmessage{Could not find image file #1 for pdf}% 1398 \errmessage{Could not find image file #1 for pdf}%
1193 \else \gdef\pdfimgext{JPG}% 1399 \else \gdef\pdfimgext{PDF}%
1194 \fi 1400 \fi
1195 \else \gdef\pdfimgext{jpeg}% 1401 \else \gdef\pdfimgext{pdf}%
1196 \fi 1402 \fi
1197 \else \gdef\pdfimgext{jpg}% 1403 \else \gdef\pdfimgext{JPG}%
1198 \fi 1404 \fi
1199 \else \gdef\pdfimgext{png}% 1405 \else \gdef\pdfimgext{jpeg}%
1200 \fi 1406 \fi
1201 \else \gdef\pdfimgext{PDF}% 1407 \else \gdef\pdfimgext{jpg}%
1202 \fi 1408 \fi
1203 \else \gdef\pdfimgext{pdf}% 1409 \else \gdef\pdfimgext{png}%
1204 \fi 1410 \fi
1205 \closein 1 1411 \closein 1
1206 \endgroup 1412 \endgroup
@@ -1228,9 +1434,10 @@ output) for that.)}
1228 % such as \, aren't expanded when present in a section title. 1434 % such as \, aren't expanded when present in a section title.
1229 \indexnofonts 1435 \indexnofonts
1230 \turnoffactive 1436 \turnoffactive
1437 \activebackslashdouble
1231 \makevalueexpandable 1438 \makevalueexpandable
1232 \def\pdfdestname{#1}% 1439 \def\pdfdestname{#1}%
1233 \txiescapepdf\pdfdestname 1440 \backslashparens\pdfdestname
1234 \safewhatsit{\pdfdest name{\pdfdestname} xyz}% 1441 \safewhatsit{\pdfdest name{\pdfdestname} xyz}%
1235 }} 1442 }}
1236 % 1443 %
@@ -1262,24 +1469,29 @@ output) for that.)}
1262 % page number. We could generate a destination for the section 1469 % page number. We could generate a destination for the section
1263 % text in the case where a section has no node, but it doesn't 1470 % text in the case where a section has no node, but it doesn't
1264 % seem worth the trouble, since most documents are normally structured. 1471 % seem worth the trouble, since most documents are normally structured.
1265 \edef\pdfoutlinedest{#3}% 1472 \def\pdfoutlinedest{#3}%
1266 \ifx\pdfoutlinedest\empty 1473 \ifx\pdfoutlinedest\empty
1267 \def\pdfoutlinedest{#4}% 1474 \def\pdfoutlinedest{#4}%
1268 \else 1475 \else
1269 \txiescapepdf\pdfoutlinedest 1476 % Doubled backslashes in the name.
1477 {\activebackslashdouble \xdef\pdfoutlinedest{#3}%
1478 \backslashparens\pdfoutlinedest}%
1270 \fi 1479 \fi
1271 % 1480 %
1272 % Also escape PDF chars in the display string. 1481 % Also double the backslashes in the display string.
1273 \edef\pdfoutlinetext{#1}% 1482 {\activebackslashdouble \xdef\pdfoutlinetext{#1}%
1274 \txiescapepdf\pdfoutlinetext 1483 \backslashparens\pdfoutlinetext}%
1275 % 1484 %
1276 \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{\pdfoutlinetext}% 1485 \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{\pdfoutlinetext}%
1277 } 1486 }
1278 % 1487 %
1279 \def\pdfmakeoutlines{% 1488 \def\pdfmakeoutlines{%
1280 \begingroup 1489 \begingroup
1490 % Thanh's hack / proper braces in bookmarks
1491 \edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace
1492 \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace
1493 %
1281 % Read toc silently, to get counts of subentries for \pdfoutline. 1494 % Read toc silently, to get counts of subentries for \pdfoutline.
1282 \def\partentry##1##2##3##4{}% ignore parts in the outlines
1283 \def\numchapentry##1##2##3##4{% 1495 \def\numchapentry##1##2##3##4{%
1284 \def\thischapnum{##2}% 1496 \def\thischapnum{##2}%
1285 \def\thissecnum{0}% 1497 \def\thissecnum{0}%
@@ -1333,26 +1545,15 @@ output) for that.)}
1333 % Latin 2 (0xea) gets translated to a | character. Info from 1545 % Latin 2 (0xea) gets translated to a | character. Info from
1334 % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100. 1546 % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100.
1335 % 1547 %
1336 % TODO this right, we have to translate 8-bit characters to 1548 % xx to do this right, we have to translate 8-bit characters to
1337 % their "best" equivalent, based on the @documentencoding. Too 1549 % their "best" equivalent, based on the @documentencoding. Right
1338 % much work for too little return. Just use the ASCII equivalents 1550 % now, I guess we'll just let the pdf reader have its way.
1339 % we use for the index sort strings.
1340 %
1341 \indexnofonts 1551 \indexnofonts
1342 \setupdatafile 1552 \setupdatafile
1343 % We can have normal brace characters in the PDF outlines, unlike
1344 % Texinfo index files. So set that up.
1345 \def\{{\lbracecharliteral}%
1346 \def\}{\rbracecharliteral}%
1347 \catcode`\\=\active \otherbackslash 1553 \catcode`\\=\active \otherbackslash
1348 \input \tocreadfilename 1554 \input \tocreadfilename
1349 \endgroup 1555 \endgroup
1350 } 1556 }
1351 {\catcode`[=1 \catcode`]=2
1352 \catcode`{=\other \catcode`}=\other
1353 \gdef\lbracecharliteral[{]%
1354 \gdef\rbracecharliteral[}]%
1355 ]
1356 % 1557 %
1357 \def\skipspaces#1{\def\PP{#1}\def\D{|}% 1558 \def\skipspaces#1{\def\PP{#1}\def\D{|}%
1358 \ifx\PP\D\let\nextsp\relax 1559 \ifx\PP\D\let\nextsp\relax
@@ -1494,7 +1695,7 @@ output) for that.)}
1494% if we are producing pdf, and we have \pdffontattr, then define cmaps. 1695% if we are producing pdf, and we have \pdffontattr, then define cmaps.
1495% (\pdffontattr was introduced many years ago, but people still run 1696% (\pdffontattr was introduced many years ago, but people still run
1496% older pdftex's; it's easy to conditionalize, so we do.) 1697% older pdftex's; it's easy to conditionalize, so we do.)
1497\ifpdf \ifx\pdffontattr\thisisundefined \else 1698\ifpdf \ifx\pdffontattr\undefined \else
1498 \begingroup 1699 \begingroup
1499 \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. 1700 \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char.
1500 \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap 1701 \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap
@@ -1761,7 +1962,7 @@ end
1761% Use cm as the default font prefix. 1962% Use cm as the default font prefix.
1762% To specify the font prefix, you must define \fontprefix 1963% To specify the font prefix, you must define \fontprefix
1763% before you read in texinfo.tex. 1964% before you read in texinfo.tex.
1764\ifx\fontprefix\thisisundefined 1965\ifx\fontprefix\undefined
1765\def\fontprefix{cm} 1966\def\fontprefix{cm}
1766\fi 1967\fi
1767% Support font families that don't use the same naming scheme as CM. 1968% Support font families that don't use the same naming scheme as CM.
@@ -1904,8 +2105,8 @@ end
1904\font\reducedsy=cmsy10 2105\font\reducedsy=cmsy10
1905\def\reducedecsize{1000} 2106\def\reducedecsize{1000}
1906 2107
1907\textleading = 13.2pt % line spacing for 11pt CM 2108% reset the current fonts
1908\textfonts % reset the current fonts 2109\textfonts
1909\rm 2110\rm
1910} % end of 11pt text font size definitions 2111} % end of 11pt text font size definitions
1911 2112
@@ -2035,9 +2236,11 @@ end
2035\font\reducedsy=cmsy9 2236\font\reducedsy=cmsy9
2036\def\reducedecsize{0900} 2237\def\reducedecsize{0900}
2037 2238
2038\divide\parskip by 2 % reduce space between paragraphs 2239% reduce space between paragraphs
2039\textleading = 12pt % line spacing for 10pt CM 2240\divide\parskip by 2
2040\textfonts % reset the current fonts 2241
2242% reset the current fonts
2243\textfonts
2041\rm 2244\rm
2042} % end of 10pt text font size definitions 2245} % end of 10pt text font size definitions
2043 2246
@@ -2046,13 +2249,12 @@ end
2046% @fonttextsize 10 2249% @fonttextsize 10
2047% (or 11) to redefine the text font size. pt is assumed. 2250% (or 11) to redefine the text font size. pt is assumed.
2048% 2251%
2049\def\xiword{11}
2050\def\xword{10} 2252\def\xword{10}
2051\def\xwordpt{10pt} 2253\def\xiword{11}
2052% 2254%
2053\parseargdef\fonttextsize{% 2255\parseargdef\fonttextsize{%
2054 \def\textsizearg{#1}% 2256 \def\textsizearg{#1}%
2055 %\wlog{doing @fonttextsize \textsizearg}% 2257 \wlog{doing @fonttextsize \textsizearg}%
2056 % 2258 %
2057 % Set \globaldefs so that documents can use this inside @tex, since 2259 % Set \globaldefs so that documents can use this inside @tex, since
2058 % makeinfo 4.8 does not support it, but we need it nonetheless. 2260 % makeinfo 4.8 does not support it, but we need it nonetheless.
@@ -2106,7 +2308,7 @@ end
2106 \let\tenttsl=\titlettsl 2308 \let\tenttsl=\titlettsl
2107 \def\curfontsize{title}% 2309 \def\curfontsize{title}%
2108 \def\lsize{chap}\def\lllsize{subsec}% 2310 \def\lsize{chap}\def\lllsize{subsec}%
2109 \resetmathfonts \setleading{27pt}} 2311 \resetmathfonts \setleading{25pt}}
2110\def\titlefont#1{{\titlefonts\rmisbold #1}} 2312\def\titlefont#1{{\titlefonts\rmisbold #1}}
2111\def\chapfonts{% 2313\def\chapfonts{%
2112 \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl 2314 \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
@@ -2234,14 +2436,12 @@ end
2234 2436
2235% Markup style setup for left and right quotes. 2437% Markup style setup for left and right quotes.
2236\defmarkupstylesetup\markupsetuplq{% 2438\defmarkupstylesetup\markupsetuplq{%
2237 \expandafter\let\expandafter \temp 2439 \expandafter\let\expandafter \temp \csname markupsetuplq\currentmarkupstyle\endcsname
2238 \csname markupsetuplq\currentmarkupstyle\endcsname
2239 \ifx\temp\relax \markupsetuplqdefault \else \temp \fi 2440 \ifx\temp\relax \markupsetuplqdefault \else \temp \fi
2240} 2441}
2241 2442
2242\defmarkupstylesetup\markupsetuprq{% 2443\defmarkupstylesetup\markupsetuprq{%
2243 \expandafter\let\expandafter \temp 2444 \expandafter\let\expandafter \temp \csname markupsetuprq\currentmarkupstyle\endcsname
2244 \csname markupsetuprq\currentmarkupstyle\endcsname
2245 \ifx\temp\relax \markupsetuprqdefault \else \temp \fi 2445 \ifx\temp\relax \markupsetuprqdefault \else \temp \fi
2246} 2446}
2247 2447
@@ -2260,26 +2460,22 @@ end
2260 2460
2261\let\markupsetuplqcode \markupsetcodequoteleft 2461\let\markupsetuplqcode \markupsetcodequoteleft
2262\let\markupsetuprqcode \markupsetcodequoteright 2462\let\markupsetuprqcode \markupsetcodequoteright
2263%
2264\let\markupsetuplqexample \markupsetcodequoteleft 2463\let\markupsetuplqexample \markupsetcodequoteleft
2265\let\markupsetuprqexample \markupsetcodequoteright 2464\let\markupsetuprqexample \markupsetcodequoteright
2266%
2267\let\markupsetuplqsamp \markupsetcodequoteleft
2268\let\markupsetuprqsamp \markupsetcodequoteright
2269%
2270\let\markupsetuplqverb \markupsetcodequoteleft 2465\let\markupsetuplqverb \markupsetcodequoteleft
2271\let\markupsetuprqverb \markupsetcodequoteright 2466\let\markupsetuprqverb \markupsetcodequoteright
2272%
2273\let\markupsetuplqverbatim \markupsetcodequoteleft 2467\let\markupsetuplqverbatim \markupsetcodequoteleft
2274\let\markupsetuprqverbatim \markupsetcodequoteright 2468\let\markupsetuprqverbatim \markupsetcodequoteright
2275 2469
2470\let\markupsetuplqsamp \markupsetnoligaturesquoteleft
2276\let\markupsetuplqkbd \markupsetnoligaturesquoteleft 2471\let\markupsetuplqkbd \markupsetnoligaturesquoteleft
2277 2472
2278% Allow an option to not use regular directed right quote/apostrophe 2473% Allow an option to not replace quotes with a regular directed right
2279% (char 0x27), but instead the undirected quote from cmtt (char 0x0d). 2474% quote/apostrophe (char 0x27), but instead use the undirected quote
2280% The undirected quote is ugly, so don't make it the default, but it 2475% from cmtt (char 0x0d). The undirected quote is ugly, so don't make it
2281% works for pasting with more pdf viewers (at least evince), the 2476% the default, but it works for pasting with more pdf viewers (at least
2282% lilypond developers report. xpdf does work with the regular 0x27. 2477% evince), the lilypond developers report. xpdf does work with the
2478% regular 0x27.
2283% 2479%
2284\def\codequoteright{% 2480\def\codequoteright{%
2285 \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax 2481 \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax
@@ -2303,84 +2499,33 @@ end
2303 \else \char'22 \fi 2499 \else \char'22 \fi
2304} 2500}
2305 2501
2306% Commands to set the quote options.
2307%
2308\parseargdef\codequoteundirected{%
2309 \def\temp{#1}%
2310 \ifx\temp\onword
2311 \expandafter\let\csname SETtxicodequoteundirected\endcsname
2312 = t%
2313 \else\ifx\temp\offword
2314 \expandafter\let\csname SETtxicodequoteundirected\endcsname
2315 = \relax
2316 \else
2317 \errhelp = \EMsimple
2318 \errmessage{Unknown @codequoteundirected value `\temp', must be on|off}%
2319 \fi\fi
2320}
2321%
2322\parseargdef\codequotebacktick{%
2323 \def\temp{#1}%
2324 \ifx\temp\onword
2325 \expandafter\let\csname SETtxicodequotebacktick\endcsname
2326 = t%
2327 \else\ifx\temp\offword
2328 \expandafter\let\csname SETtxicodequotebacktick\endcsname
2329 = \relax
2330 \else
2331 \errhelp = \EMsimple
2332 \errmessage{Unknown @codequotebacktick value `\temp', must be on|off}%
2333 \fi\fi
2334}
2335
2336% [Knuth] pp. 380,381,391, disable Spanish ligatures ?` and !` of \tt font. 2502% [Knuth] pp. 380,381,391, disable Spanish ligatures ?` and !` of \tt font.
2337\def\noligaturesquoteleft{\relax\lq} 2503\def\noligaturesquoteleft{\relax\lq}
2338 2504
2339% Count depth in font-changes, for error checks 2505% Count depth in font-changes, for error checks
2340\newcount\fontdepth \fontdepth=0 2506\newcount\fontdepth \fontdepth=0
2341 2507
2342% Font commands. 2508%% Add scribe-like font environments, plus @l for inline lisp (usually sans
2509%% serif) and @ii for TeX italic
2343 2510
2344% #1 is the font command (\sl or \it), #2 is the text to slant. 2511% \smartitalic{ARG} outputs arg in italics, followed by an italic correction
2345% If we are in a monospaced environment, however, 1) always use \ttsl, 2512% unless the following character is such as not to need one.
2346% and 2) do not add an italic correction. 2513\def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else
2347\def\dosmartslant#1#2{% 2514 \ptexslash\fi\fi\fi}
2348 \ifusingtt 2515\def\smartslanted#1{{\ifusingtt\ttsl\sl #1}\futurelet\next\smartitalicx}
2349 {{\ttsl #2}\let\next=\relax}% 2516\def\smartitalic#1{{\ifusingtt\ttsl\it #1}\futurelet\next\smartitalicx}
2350 {\def\next{{#1#2}\futurelet\next\smartitaliccorrection}}%
2351 \next
2352}
2353\def\smartslanted{\dosmartslant\sl}
2354\def\smartitalic{\dosmartslant\it}
2355 2517
2356% Output an italic correction unless \next (presumed to be the following 2518% like \smartslanted except unconditionally uses \ttsl.
2357% character) is such as not to need one.
2358\def\smartitaliccorrection{%
2359 \ifx\next,%
2360 \else\ifx\next-%
2361 \else\ifx\next.%
2362 \else\ptexslash
2363 \fi\fi\fi
2364 \aftersmartic
2365}
2366
2367% like \smartslanted except unconditionally uses \ttsl, and no ic.
2368% @var is set to this for defun arguments. 2519% @var is set to this for defun arguments.
2369\def\ttslanted#1{{\ttsl #1}} 2520\def\ttslanted#1{{\ttsl #1}\futurelet\next\smartitalicx}
2370 2521
2371% @cite is like \smartslanted except unconditionally use \sl. We never want 2522% @cite is like \smartslanted except unconditionally use \sl. We never want
2372% ttsl for book titles, do we? 2523% ttsl for book titles, do we?
2373\def\cite#1{{\sl #1}\futurelet\next\smartitaliccorrection} 2524\def\cite#1{{\sl #1}\futurelet\next\smartitalicx}
2374
2375\def\aftersmartic{}
2376\def\var#1{%
2377 \let\saveaftersmartic = \aftersmartic
2378 \def\aftersmartic{\null\let\aftersmartic=\saveaftersmartic}%
2379 \smartslanted{#1}%
2380}
2381 2525
2382\let\i=\smartitalic 2526\let\i=\smartitalic
2383\let\slanted=\smartslanted 2527\let\slanted=\smartslanted
2528\def\var#1{{\setupmarkupstyle{var}\smartslanted{#1}}}
2384\let\dfn=\smartslanted 2529\let\dfn=\smartslanted
2385\let\emph=\smartitalic 2530\let\emph=\smartitalic
2386 2531
@@ -2476,7 +2621,7 @@ end
2476 \plainfrenchspacing 2621 \plainfrenchspacing
2477 #1% 2622 #1%
2478 }% 2623 }%
2479 \null % reset spacefactor to 1000 2624 \null
2480} 2625}
2481 2626
2482% We *must* turn on hyphenation at `-' and `_' in @code. 2627% We *must* turn on hyphenation at `-' and `_' in @code.
@@ -2508,8 +2653,6 @@ end
2508 } 2653 }
2509} 2654}
2510 2655
2511\def\codex #1{\tclose{#1}\endgroup}
2512
2513\def\realdash{-} 2656\def\realdash{-}
2514\def\codedash{-\discretionary{}{}{}} 2657\def\codedash{-\discretionary{}{}{}}
2515\def\codeunder{% 2658\def\codeunder{%
@@ -2523,6 +2666,7 @@ end
2523 \discretionary{}{}{}}% 2666 \discretionary{}{}{}}%
2524 {\_}% 2667 {\_}%
2525} 2668}
2669\def\codex #1{\tclose{#1}\endgroup}
2526 2670
2527% An additional complication: the above will allow breaks after, e.g., 2671% An additional complication: the above will allow breaks after, e.g.,
2528% each of the four underscores in __typeof__. This is undesirable in 2672% each of the four underscores in __typeof__. This is undesirable in
@@ -2542,156 +2686,10 @@ end
2542 \allowcodebreaksfalse 2686 \allowcodebreaksfalse
2543 \else 2687 \else
2544 \errhelp = \EMsimple 2688 \errhelp = \EMsimple
2545 \errmessage{Unknown @allowcodebreaks option `\txiarg', must be true|false}% 2689 \errmessage{Unknown @allowcodebreaks option `\txiarg'}%
2546 \fi\fi 2690 \fi\fi
2547} 2691}
2548 2692
2549% @uref (abbreviation for `urlref') takes an optional (comma-separated)
2550% second argument specifying the text to display and an optional third
2551% arg as text to display instead of (rather than in addition to) the url
2552% itself. First (mandatory) arg is the url.
2553% (This \urefnobreak definition isn't used now, leaving it for a while
2554% for comparison.)
2555\def\urefnobreak#1{\dourefnobreak #1,,,\finish}
2556\def\dourefnobreak#1,#2,#3,#4\finish{\begingroup
2557 \unsepspaces
2558 \pdfurl{#1}%
2559 \setbox0 = \hbox{\ignorespaces #3}%
2560 \ifdim\wd0 > 0pt
2561 \unhbox0 % third arg given, show only that
2562 \else
2563 \setbox0 = \hbox{\ignorespaces #2}%
2564 \ifdim\wd0 > 0pt
2565 \ifpdf
2566 \unhbox0 % PDF: 2nd arg given, show only it
2567 \else
2568 \unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url
2569 \fi
2570 \else
2571 \code{#1}% only url given, so show it
2572 \fi
2573 \fi
2574 \endlink
2575\endgroup}
2576
2577% This \urefbreak definition is the active one.
2578\def\urefbreak{\begingroup \urefcatcodes \dourefbreak}
2579\let\uref=\urefbreak
2580\def\dourefbreak#1{\urefbreakfinish #1,,,\finish}
2581\def\urefbreakfinish#1,#2,#3,#4\finish{% doesn't work in @example
2582 \unsepspaces
2583 \pdfurl{#1}%
2584 \setbox0 = \hbox{\ignorespaces #3}%
2585 \ifdim\wd0 > 0pt
2586 \unhbox0 % third arg given, show only that
2587 \else
2588 \setbox0 = \hbox{\ignorespaces #2}%
2589 \ifdim\wd0 > 0pt
2590 \ifpdf
2591 \unhbox0 % PDF: 2nd arg given, show only it
2592 \else
2593 \unhbox0\ (\urefcode{#1})% DVI: 2nd arg given, show both it and url
2594 \fi
2595 \else
2596 \urefcode{#1}% only url given, so show it
2597 \fi
2598 \fi
2599 \endlink
2600\endgroup}
2601
2602% Allow line breaks around only a few characters (only).
2603\def\urefcatcodes{%
2604 \catcode\ampChar=\active \catcode\dotChar=\active
2605 \catcode\hashChar=\active \catcode\questChar=\active
2606 \catcode\slashChar=\active
2607}
2608{
2609 \urefcatcodes
2610 %
2611 \global\def\urefcode{\begingroup
2612 \setupmarkupstyle{code}%
2613 \urefcatcodes
2614 \let&\urefcodeamp
2615 \let.\urefcodedot
2616 \let#\urefcodehash
2617 \let?\urefcodequest
2618 \let/\urefcodeslash
2619 \codex
2620 }
2621 %
2622 % By default, they are just regular characters.
2623 \global\def&{\normalamp}
2624 \global\def.{\normaldot}
2625 \global\def#{\normalhash}
2626 \global\def?{\normalquest}
2627 \global\def/{\normalslash}
2628}
2629
2630% we put a little stretch before and after the breakable chars, to help
2631% line breaking of long url's. The unequal skips make look better in
2632% cmtt at least, especially for dots.
2633\def\urefprestretch{\urefprebreak \hskip0pt plus.13em }
2634\def\urefpoststretch{\urefpostbreak \hskip0pt plus.1em }
2635%
2636\def\urefcodeamp{\urefprestretch \&\urefpoststretch}
2637\def\urefcodedot{\urefprestretch .\urefpoststretch}
2638\def\urefcodehash{\urefprestretch \#\urefpoststretch}
2639\def\urefcodequest{\urefprestretch ?\urefpoststretch}
2640\def\urefcodeslash{\futurelet\next\urefcodeslashfinish}
2641{
2642 \catcode`\/=\active
2643 \global\def\urefcodeslashfinish{%
2644 \urefprestretch \slashChar
2645 % Allow line break only after the final / in a sequence of
2646 % slashes, to avoid line break between the slashes in http://.
2647 \ifx\next/\else \urefpoststretch \fi
2648 }
2649}
2650
2651% One more complication: by default we'll break after the special
2652% characters, but some people like to break before the special chars, so
2653% allow that. Also allow no breaking at all, for manual control.
2654%
2655\parseargdef\urefbreakstyle{%
2656 \def\txiarg{#1}%
2657 \ifx\txiarg\wordnone
2658 \def\urefprebreak{\nobreak}\def\urefpostbreak{\nobreak}
2659 \else\ifx\txiarg\wordbefore
2660 \def\urefprebreak{\allowbreak}\def\urefpostbreak{\nobreak}
2661 \else\ifx\txiarg\wordafter
2662 \def\urefprebreak{\nobreak}\def\urefpostbreak{\allowbreak}
2663 \else
2664 \errhelp = \EMsimple
2665 \errmessage{Unknown @urefbreakstyle setting `\txiarg'}%
2666 \fi\fi\fi
2667}
2668\def\wordafter{after}
2669\def\wordbefore{before}
2670\def\wordnone{none}
2671
2672\urefbreakstyle after
2673
2674% @url synonym for @uref, since that's how everyone uses it.
2675%
2676\let\url=\uref
2677
2678% rms does not like angle brackets --karl, 17may97.
2679% So now @email is just like @uref, unless we are pdf.
2680%
2681%\def\email#1{\angleleft{\tt #1}\angleright}
2682\ifpdf
2683 \def\email#1{\doemail#1,,\finish}
2684 \def\doemail#1,#2,#3\finish{\begingroup
2685 \unsepspaces
2686 \pdfurl{mailto:#1}%
2687 \setbox0 = \hbox{\ignorespaces #2}%
2688 \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi
2689 \endlink
2690 \endgroup}
2691\else
2692 \let\email=\uref
2693\fi
2694
2695% @kbd is like @code, except that if the argument is just one @key command, 2693% @kbd is like @code, except that if the argument is just one @key command,
2696% then @kbd has no effect. 2694% then @kbd has no effect.
2697\def\kbd#1{{\setupmarkupstyle{kbd}\def\look{#1}\expandafter\kbdfoo\look??\par}} 2695\def\kbd#1{{\setupmarkupstyle{kbd}\def\look{#1}\expandafter\kbdfoo\look??\par}}
@@ -2709,7 +2707,7 @@ end
2709 \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}% 2707 \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
2710 \else 2708 \else
2711 \errhelp = \EMsimple 2709 \errhelp = \EMsimple
2712 \errmessage{Unknown @kbdinputstyle setting `\txiarg'}% 2710 \errmessage{Unknown @kbdinputstyle option `\txiarg'}%
2713 \fi\fi\fi 2711 \fi\fi\fi
2714} 2712}
2715\def\worddistinct{distinct} 2713\def\worddistinct{distinct}
@@ -2737,6 +2735,55 @@ end
2737\parseargdef\clickstyle{\def\click{#1}} 2735\parseargdef\clickstyle{\def\click{#1}}
2738\def\click{\arrow} 2736\def\click{\arrow}
2739 2737
2738% @uref (abbreviation for `urlref') takes an optional (comma-separated)
2739% second argument specifying the text to display and an optional third
2740% arg as text to display instead of (rather than in addition to) the url
2741% itself. First (mandatory) arg is the url. Perhaps eventually put in
2742% a hypertex \special here.
2743%
2744\def\uref#1{\douref #1,,,\finish}
2745\def\douref#1,#2,#3,#4\finish{\begingroup
2746 \unsepspaces
2747 \pdfurl{#1}%
2748 \setbox0 = \hbox{\ignorespaces #3}%
2749 \ifdim\wd0 > 0pt
2750 \unhbox0 % third arg given, show only that
2751 \else
2752 \setbox0 = \hbox{\ignorespaces #2}%
2753 \ifdim\wd0 > 0pt
2754 \ifpdf
2755 \unhbox0 % PDF: 2nd arg given, show only it
2756 \else
2757 \unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url
2758 \fi
2759 \else
2760 \code{#1}% only url given, so show it
2761 \fi
2762 \fi
2763 \endlink
2764\endgroup}
2765
2766% @url synonym for @uref, since that's how everyone uses it.
2767%
2768\let\url=\uref
2769
2770% rms does not like angle brackets --karl, 17may97.
2771% So now @email is just like @uref, unless we are pdf.
2772%
2773%\def\email#1{\angleleft{\tt #1}\angleright}
2774\ifpdf
2775 \def\email#1{\doemail#1,,\finish}
2776 \def\doemail#1,#2,#3\finish{\begingroup
2777 \unsepspaces
2778 \pdfurl{mailto:#1}%
2779 \setbox0 = \hbox{\ignorespaces #2}%
2780 \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi
2781 \endlink
2782 \endgroup}
2783\else
2784 \let\email=\uref
2785\fi
2786
2740% Typeset a dimension, e.g., `in' or `pt'. The only reason for the 2787% Typeset a dimension, e.g., `in' or `pt'. The only reason for the
2741% argument is to make the input look right: @dmn{pt} instead of @dmn{}pt. 2788% argument is to make the input look right: @dmn{pt} instead of @dmn{}pt.
2742% 2789%
@@ -2758,7 +2805,6 @@ end
2758 \ifx\temp\empty \else 2805 \ifx\temp\empty \else
2759 \space ({\unsepspaces \ignorespaces \temp \unskip})% 2806 \space ({\unsepspaces \ignorespaces \temp \unskip})%
2760 \fi 2807 \fi
2761 \null % reset \spacefactor=1000
2762} 2808}
2763 2809
2764% @abbr for "Comput. J." and the like. 2810% @abbr for "Comput. J." and the like.
@@ -2771,219 +2817,10 @@ end
2771 \ifx\temp\empty \else 2817 \ifx\temp\empty \else
2772 \space ({\unsepspaces \ignorespaces \temp \unskip})% 2818 \space ({\unsepspaces \ignorespaces \temp \unskip})%
2773 \fi 2819 \fi
2774 \null % reset \spacefactor=1000
2775}
2776
2777% @asis just yields its argument. Used with @table, for example.
2778%
2779\def\asis#1{#1}
2780
2781% @math outputs its argument in math mode.
2782%
2783% One complication: _ usually means subscripts, but it could also mean
2784% an actual _ character, as in @math{@var{some_variable} + 1}. So make
2785% _ active, and distinguish by seeing if the current family is \slfam,
2786% which is what @var uses.
2787{
2788 \catcode`\_ = \active
2789 \gdef\mathunderscore{%
2790 \catcode`\_=\active
2791 \def_{\ifnum\fam=\slfam \_\else\sb\fi}%
2792 }
2793}
2794% Another complication: we want \\ (and @\) to output a math (or tt) \.
2795% FYI, plain.tex uses \\ as a temporary control sequence (for no
2796% particular reason), but this is not advertised and we don't care.
2797%
2798% The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.
2799\def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi}
2800%
2801\def\math{%
2802 \tex
2803 \mathunderscore
2804 \let\\ = \mathbackslash
2805 \mathactive
2806 % make the texinfo accent commands work in math mode
2807 \let\"=\ddot
2808 \let\'=\acute
2809 \let\==\bar
2810 \let\^=\hat
2811 \let\`=\grave
2812 \let\u=\breve
2813 \let\v=\check
2814 \let\~=\tilde
2815 \let\dotaccent=\dot
2816 $\finishmath
2817}
2818\def\finishmath#1{#1$\endgroup} % Close the group opened by \tex.
2819
2820% Some active characters (such as <) are spaced differently in math.
2821% We have to reset their definitions in case the @math was an argument
2822% to a command which sets the catcodes (such as @item or @section).
2823%
2824{
2825 \catcode`^ = \active
2826 \catcode`< = \active
2827 \catcode`> = \active
2828 \catcode`+ = \active
2829 \catcode`' = \active
2830 \gdef\mathactive{%
2831 \let^ = \ptexhat
2832 \let< = \ptexless
2833 \let> = \ptexgtr
2834 \let+ = \ptexplus
2835 \let' = \ptexquoteright
2836 }
2837}
2838
2839% @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}.
2840% Ignore unless FMTNAME == tex; then it is like @iftex and @tex,
2841% except specified as a normal braced arg, so no newlines to worry about.
2842%
2843\def\outfmtnametex{tex}
2844%
2845\def\inlinefmt#1{\doinlinefmt #1,\finish}
2846\def\doinlinefmt#1,#2,\finish{%
2847 \def\inlinefmtname{#1}%
2848 \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\fi
2849}
2850% For raw, must switch into @tex before parsing the argument, to avoid
2851% setting catcodes prematurely. Doing it this way means that, for
2852% example, @inlineraw{html, foo{bar} gets a parse error instead of being
2853% ignored. But this isn't important because if people want a literal
2854% *right* brace they would have to use a command anyway, so they may as
2855% well use a command to get a left brace too. We could re-use the
2856% delimiter character idea from \verb, but it seems like overkill.
2857%
2858\def\inlineraw{\tex \doinlineraw}
2859\def\doinlineraw#1{\doinlinerawtwo #1,\finish}
2860\def\doinlinerawtwo#1,#2,\finish{%
2861 \def\inlinerawname{#1}%
2862 \ifx\inlinerawname\outfmtnametex \ignorespaces #2\fi
2863 \endgroup % close group opened by \tex.
2864} 2820}
2865 2821
2866 2822
2867\message{glyphs,} 2823\message{glyphs,}
2868% and logos.
2869
2870% @@ prints an @, as does @atchar{}.
2871\def\@{\char64 }
2872\let\atchar=\@
2873
2874% @{ @} @lbracechar{} @rbracechar{} all generate brace characters.
2875% Unless we're in typewriter, use \ecfont because the CM text fonts do
2876% not have braces, and we don't want to switch into math.
2877\def\mylbrace{{\ifmonospace\else\ecfont\fi \char123}}
2878\def\myrbrace{{\ifmonospace\else\ecfont\fi \char125}}
2879\let\{=\mylbrace \let\lbracechar=\{
2880\let\}=\myrbrace \let\rbracechar=\}
2881\begingroup
2882 % Definitions to produce \{ and \} commands for indices,
2883 % and @{ and @} for the aux/toc files.
2884 \catcode`\{ = \other \catcode`\} = \other
2885 \catcode`\[ = 1 \catcode`\] = 2
2886 \catcode`\! = 0 \catcode`\\ = \other
2887 !gdef!lbracecmd[\{]%
2888 !gdef!rbracecmd[\}]%
2889 !gdef!lbraceatcmd[@{]%
2890 !gdef!rbraceatcmd[@}]%
2891!endgroup
2892
2893% @comma{} to avoid , parsing problems.
2894\let\comma = ,
2895
2896% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
2897% Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H.
2898\let\, = \ptexc
2899\let\dotaccent = \ptexdot
2900\def\ringaccent#1{{\accent23 #1}}
2901\let\tieaccent = \ptext
2902\let\ubaraccent = \ptexb
2903\let\udotaccent = \d
2904
2905% Other special characters: @questiondown @exclamdown @ordf @ordm
2906% Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
2907\def\questiondown{?`}
2908\def\exclamdown{!`}
2909\def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}}
2910\def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}}
2911
2912% Dotless i and dotless j, used for accents.
2913\def\imacro{i}
2914\def\jmacro{j}
2915\def\dotless#1{%
2916 \def\temp{#1}%
2917 \ifx\temp\imacro \ifmmode\imath \else\ptexi \fi
2918 \else\ifx\temp\jmacro \ifmmode\jmath \else\j \fi
2919 \else \errmessage{@dotless can be used only with i or j}%
2920 \fi\fi
2921}
2922
2923% The \TeX{} logo, as in plain, but resetting the spacing so that a
2924% period following counts as ending a sentence. (Idea found in latex.)
2925%
2926\edef\TeX{\TeX \spacefactor=1000 }
2927
2928% @LaTeX{} logo. Not quite the same results as the definition in
2929% latex.ltx, since we use a different font for the raised A; it's most
2930% convenient for us to use an explicitly smaller font, rather than using
2931% the \scriptstyle font (since we don't reset \scriptstyle and
2932% \scriptscriptstyle).
2933%
2934\def\LaTeX{%
2935 L\kern-.36em
2936 {\setbox0=\hbox{T}%
2937 \vbox to \ht0{\hbox{%
2938 \ifx\textnominalsize\xwordpt
2939 % for 10pt running text, \lllsize (8pt) is too small for the A in LaTeX.
2940 % Revert to plain's \scriptsize, which is 7pt.
2941 \count255=\the\fam $\fam\count255 \scriptstyle A$%
2942 \else
2943 % For 11pt, we can use our lllsize.
2944 \selectfonts\lllsize A%
2945 \fi
2946 }%
2947 \vss
2948 }}%
2949 \kern-.15em
2950 \TeX
2951}
2952
2953% Some math mode symbols.
2954\def\bullet{$\ptexbullet$}
2955\def\geq{\ifmmode \ge\else $\ge$\fi}
2956\def\leq{\ifmmode \le\else $\le$\fi}
2957\def\minus{\ifmmode -\else $-$\fi}
2958
2959% @dots{} outputs an ellipsis using the current font.
2960% We do .5em per period so that it has the same spacing in the cm
2961% typewriter fonts as three actual period characters; on the other hand,
2962% in other typewriter fonts three periods are wider than 1.5em. So do
2963% whichever is larger.
2964%
2965\def\dots{%
2966 \leavevmode
2967 \setbox0=\hbox{...}% get width of three periods
2968 \ifdim\wd0 > 1.5em
2969 \dimen0 = \wd0
2970 \else
2971 \dimen0 = 1.5em
2972 \fi
2973 \hbox to \dimen0{%
2974 \hskip 0pt plus.25fil
2975 .\hskip 0pt plus1fil
2976 .\hskip 0pt plus1fil
2977 .\hskip 0pt plus.5fil
2978 }%
2979}
2980
2981% @enddots{} is an end-of-sentence ellipsis.
2982%
2983\def\enddots{%
2984 \dots
2985 \spacefactor=\endofsentencespacefactor
2986}
2987 2824
2988% @point{}, @result{}, @expansion{}, @print{}, @equiv{}. 2825% @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
2989% 2826%
@@ -3005,7 +2842,7 @@ end
3005{\tentt \global\dimen0 = 3em}% Width of the box. 2842{\tentt \global\dimen0 = 3em}% Width of the box.
3006\dimen2 = .55pt % Thickness of rules 2843\dimen2 = .55pt % Thickness of rules
3007% The text. (`r' is open on the right, `e' somewhat less so on the left.) 2844% The text. (`r' is open on the right, `e' somewhat less so on the left.)
3008\setbox0 = \hbox{\kern-.75pt \reducedsf \putworderror\kern-1.5pt} 2845\setbox0 = \hbox{\kern-.75pt \reducedsf error\kern-1.5pt}
3009% 2846%
3010\setbox\errorbox=\hbox to \dimen0{\hfil 2847\setbox\errorbox=\hbox to \dimen0{\hfil
3011 \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right. 2848 \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
@@ -3154,7 +2991,7 @@ end
3154% Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38 2991% Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38
3155% so we'll define it if necessary. 2992% so we'll define it if necessary.
3156% 2993%
3157\ifx\Orb\thisisundefined 2994\ifx\Orb\undefined
3158\def\Orb{\mathhexbox20D} 2995\def\Orb{\mathhexbox20D}
3159\fi 2996\fi
3160 2997
@@ -3182,9 +3019,8 @@ end
3182\newif\ifsetshortcontentsaftertitlepage 3019\newif\ifsetshortcontentsaftertitlepage
3183 \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue 3020 \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue
3184 3021
3185\parseargdef\shorttitlepage{% 3022\parseargdef\shorttitlepage{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}%
3186 \begingroup \hbox{}\vskip 1.5in \chaprm \centerline{#1}% 3023 \endgroup\page\hbox{}\page}
3187 \endgroup\page\hbox{}\page}
3188 3024
3189\envdef\titlepage{% 3025\envdef\titlepage{%
3190 % Open one extra group, as we want to close it in the middle of \Etitlepage. 3026 % Open one extra group, as we want to close it in the middle of \Etitlepage.
@@ -3244,7 +3080,7 @@ end
3244 \finishedtitlepagetrue 3080 \finishedtitlepagetrue
3245} 3081}
3246 3082
3247% Macros to be used within @titlepage: 3083%%% Macros to be used within @titlepage:
3248 3084
3249\let\subtitlerm=\tenrm 3085\let\subtitlerm=\tenrm
3250\def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines} 3086\def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}
@@ -3277,7 +3113,7 @@ end
3277} 3113}
3278 3114
3279 3115
3280% Set up page headings and footings. 3116%%% Set up page headings and footings.
3281 3117
3282\let\thispage=\folio 3118\let\thispage=\folio
3283 3119
@@ -3371,14 +3207,10 @@ end
3371 3207
3372\def\headings #1 {\csname HEADINGS#1\endcsname} 3208\def\headings #1 {\csname HEADINGS#1\endcsname}
3373 3209
3374\def\headingsoff{% non-global headings elimination 3210\def\HEADINGSoff{%
3375 \evenheadline={\hfil}\evenfootline={\hfil}% 3211\global\evenheadline={\hfil} \global\evenfootline={\hfil}
3376 \oddheadline={\hfil}\oddfootline={\hfil}% 3212\global\oddheadline={\hfil} \global\oddfootline={\hfil}}
3377} 3213\HEADINGSoff
3378
3379\def\HEADINGSoff{{\globaldefs=1 \headingsoff}} % global setting
3380\HEADINGSoff % it's the default
3381
3382% When we turn headings on, set the page number to 1. 3214% When we turn headings on, set the page number to 1.
3383% For double-sided printing, put current file name in lower left corner, 3215% For double-sided printing, put current file name in lower left corner,
3384% chapter name on inside top of right hand pages, document 3216% chapter name on inside top of right hand pages, document
@@ -3429,7 +3261,7 @@ end
3429% This produces Day Month Year style of output. 3261% This produces Day Month Year style of output.
3430% Only define if not already defined, in case a txi-??.tex file has set 3262% Only define if not already defined, in case a txi-??.tex file has set
3431% up a different format (e.g., txi-cs.tex does this). 3263% up a different format (e.g., txi-cs.tex does this).
3432\ifx\today\thisisundefined 3264\ifx\today\undefined
3433\def\today{% 3265\def\today{%
3434 \number\day\space 3266 \number\day\space
3435 \ifcase\month 3267 \ifcase\month
@@ -3490,7 +3322,7 @@ end
3490 \begingroup 3322 \begingroup
3491 \advance\leftskip by-\tableindent 3323 \advance\leftskip by-\tableindent
3492 \advance\hsize by\tableindent 3324 \advance\hsize by\tableindent
3493 \advance\rightskip by0pt plus1fil\relax 3325 \advance\rightskip by0pt plus1fil
3494 \leavevmode\unhbox0\par 3326 \leavevmode\unhbox0\par
3495 \endgroup 3327 \endgroup
3496 % 3328 %
@@ -3976,18 +3808,18 @@ end
3976\setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip 3808\setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip
3977\global\advance\multitablelinespace by-\ht0 3809\global\advance\multitablelinespace by-\ht0
3978\fi 3810\fi
3979% Test to see if parskip is larger than space between lines of 3811%% Test to see if parskip is larger than space between lines of
3980% table. If not, do nothing. 3812%% table. If not, do nothing.
3981% If so, set to same dimension as multitablelinespace. 3813%% If so, set to same dimension as multitablelinespace.
3982\ifdim\multitableparskip>\multitablelinespace 3814\ifdim\multitableparskip>\multitablelinespace
3983\global\multitableparskip=\multitablelinespace 3815\global\multitableparskip=\multitablelinespace
3984\global\advance\multitableparskip-7pt % to keep parskip somewhat smaller 3816\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
3985 % than skip between lines in the table. 3817 %% than skip between lines in the table.
3986\fi% 3818\fi%
3987\ifdim\multitableparskip=0pt 3819\ifdim\multitableparskip=0pt
3988\global\multitableparskip=\multitablelinespace 3820\global\multitableparskip=\multitablelinespace
3989\global\advance\multitableparskip-7pt % to keep parskip somewhat smaller 3821\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
3990 % than skip between lines in the table. 3822 %% than skip between lines in the table.
3991\fi} 3823\fi}
3992 3824
3993 3825
@@ -4302,14 +4134,11 @@ end
4302 \def\@{@}% change to @@ when we switch to @ as escape char in index files. 4134 \def\@{@}% change to @@ when we switch to @ as escape char in index files.
4303 \def\ {\realbackslash\space }% 4135 \def\ {\realbackslash\space }%
4304 % 4136 %
4305 % Need these unexpandable (because we define \tt as a dummy) 4137 % Need these in case \tex is in effect and \{ is a \delimiter again.
4306 % definitions when @{ or @} appear in index entry text. Also, more 4138 % But can't use \lbracecmd and \rbracecmd because texindex assumes
4307 % complicated, when \tex is in effect and \{ is a \delimiter again. 4139 % braces and backslashes are used only as delimiters.
4308 % We can't use \lbracecmd and \rbracecmd because texindex assumes 4140 \let\{ = \mylbrace
4309 % braces and backslashes are used only as delimiters. Perhaps we 4141 \let\} = \myrbrace
4310 % should define @lbrace and @rbrace commands a la @comma.
4311 \def\{{{\tt\char123}}%
4312 \def\}{{\tt\char125}}%
4313 % 4142 %
4314 % I don't entirely understand this, but when an index entry is 4143 % I don't entirely understand this, but when an index entry is
4315 % generated from a macro call, the \endinput which \scanmacro inserts 4144 % generated from a macro call, the \endinput which \scanmacro inserts
@@ -4362,7 +4191,7 @@ end
4362\def\commondummies{% 4191\def\commondummies{%
4363 % 4192 %
4364 % \definedummyword defines \#1 as \string\#1\space, thus effectively 4193 % \definedummyword defines \#1 as \string\#1\space, thus effectively
4365 % preventing its expansion. This is used only for control words, 4194 % preventing its expansion. This is used only for control% words,
4366 % not control letters, because the \space would be incorrect for 4195 % not control letters, because the \space would be incorrect for
4367 % control characters, but is needed to separate the control word 4196 % control characters, but is needed to separate the control word
4368 % from whatever follows. 4197 % from whatever follows.
@@ -4381,7 +4210,6 @@ end
4381 \commondummiesnofonts 4210 \commondummiesnofonts
4382 % 4211 %
4383 \definedummyletter\_% 4212 \definedummyletter\_%
4384 \definedummyletter\-%
4385 % 4213 %
4386 % Non-English letters. 4214 % Non-English letters.
4387 \definedummyword\AA 4215 \definedummyword\AA
@@ -4418,24 +4246,20 @@ end
4418 \definedummyword\TeX 4246 \definedummyword\TeX
4419 % 4247 %
4420 % Assorted special characters. 4248 % Assorted special characters.
4421 \definedummyword\arrow
4422 \definedummyword\bullet 4249 \definedummyword\bullet
4423 \definedummyword\comma 4250 \definedummyword\comma
4424 \definedummyword\copyright 4251 \definedummyword\copyright
4425 \definedummyword\registeredsymbol 4252 \definedummyword\registeredsymbol
4426 \definedummyword\dots 4253 \definedummyword\dots
4427 \definedummyword\enddots 4254 \definedummyword\enddots
4428 \definedummyword\entrybreak
4429 \definedummyword\equiv 4255 \definedummyword\equiv
4430 \definedummyword\error 4256 \definedummyword\error
4431 \definedummyword\euro 4257 \definedummyword\euro
4432 \definedummyword\expansion
4433 \definedummyword\geq
4434 \definedummyword\guillemetleft 4258 \definedummyword\guillemetleft
4435 \definedummyword\guillemetright 4259 \definedummyword\guillemetright
4436 \definedummyword\guilsinglleft 4260 \definedummyword\guilsinglleft
4437 \definedummyword\guilsinglright 4261 \definedummyword\guilsinglright
4438 \definedummyword\leq 4262 \definedummyword\expansion
4439 \definedummyword\minus 4263 \definedummyword\minus
4440 \definedummyword\ogonek 4264 \definedummyword\ogonek
4441 \definedummyword\pounds 4265 \definedummyword\pounds
@@ -4492,24 +4316,19 @@ end
4492 \definedummyword\b 4316 \definedummyword\b
4493 \definedummyword\i 4317 \definedummyword\i
4494 \definedummyword\r 4318 \definedummyword\r
4495 \definedummyword\sansserif
4496 \definedummyword\sc 4319 \definedummyword\sc
4497 \definedummyword\slanted
4498 \definedummyword\t 4320 \definedummyword\t
4499 % 4321 %
4500 % Commands that take arguments. 4322 % Commands that take arguments.
4501 \definedummyword\acronym 4323 \definedummyword\acronym
4502 \definedummyword\anchor
4503 \definedummyword\cite 4324 \definedummyword\cite
4504 \definedummyword\code 4325 \definedummyword\code
4505 \definedummyword\command 4326 \definedummyword\command
4506 \definedummyword\dfn 4327 \definedummyword\dfn
4507 \definedummyword\dmn
4508 \definedummyword\email 4328 \definedummyword\email
4509 \definedummyword\emph 4329 \definedummyword\emph
4510 \definedummyword\env 4330 \definedummyword\env
4511 \definedummyword\file 4331 \definedummyword\file
4512 \definedummyword\indicateurl
4513 \definedummyword\kbd 4332 \definedummyword\kbd
4514 \definedummyword\key 4333 \definedummyword\key
4515 \definedummyword\math 4334 \definedummyword\math
@@ -4537,7 +4356,7 @@ end
4537 \def\definedummyaccent##1{\let##1\asis}% 4356 \def\definedummyaccent##1{\let##1\asis}%
4538 % We can just ignore other control letters. 4357 % We can just ignore other control letters.
4539 \def\definedummyletter##1{\let##1\empty}% 4358 \def\definedummyletter##1{\let##1\empty}%
4540 % All control words become @asis by default; overrides below. 4359 % Hopefully, all control words can become @asis.
4541 \let\definedummyword\definedummyaccent 4360 \let\definedummyword\definedummyaccent
4542 % 4361 %
4543 \commondummiesnofonts 4362 \commondummiesnofonts
@@ -4549,14 +4368,8 @@ end
4549 % 4368 %
4550 \def\ { }% 4369 \def\ { }%
4551 \def\@{@}% 4370 \def\@{@}%
4371 % how to handle braces?
4552 \def\_{\normalunderscore}% 4372 \def\_{\normalunderscore}%
4553 \def\-{}% @- shouldn't affect sorting
4554 %
4555 % Unfortunately, texindex is not prepared to handle braces in the
4556 % content at all. So for index sorting, we map @{ and @} to strings
4557 % starting with |, since that ASCII character is between ASCII { and }.
4558 \def\{{|a}%
4559 \def\}{|b}%
4560 % 4373 %
4561 % Non-English letters. 4374 % Non-English letters.
4562 \def\AA{AA}% 4375 \def\AA{AA}%
@@ -4584,7 +4397,6 @@ end
4584 % 4397 %
4585 % Assorted special characters. 4398 % Assorted special characters.
4586 % (The following {} will end up in the sort string, but that's ok.) 4399 % (The following {} will end up in the sort string, but that's ok.)
4587 \def\arrow{->}%
4588 \def\bullet{bullet}% 4400 \def\bullet{bullet}%
4589 \def\comma{,}% 4401 \def\comma{,}%
4590 \def\copyright{copyright}% 4402 \def\copyright{copyright}%
@@ -4594,12 +4406,10 @@ end
4594 \def\error{error}% 4406 \def\error{error}%
4595 \def\euro{euro}% 4407 \def\euro{euro}%
4596 \def\expansion{==>}% 4408 \def\expansion{==>}%
4597 \def\geq{>=}%
4598 \def\guillemetleft{<<}% 4409 \def\guillemetleft{<<}%
4599 \def\guillemetright{>>}% 4410 \def\guillemetright{>>}%
4600 \def\guilsinglleft{<}% 4411 \def\guilsinglleft{<}%
4601 \def\guilsinglright{>}% 4412 \def\guilsinglright{>}%
4602 \def\leq{<=}%
4603 \def\minus{-}% 4413 \def\minus{-}%
4604 \def\point{.}% 4414 \def\point{.}%
4605 \def\pounds{pounds}% 4415 \def\pounds{pounds}%
@@ -4614,9 +4424,6 @@ end
4614 \def\result{=>}% 4424 \def\result{=>}%
4615 \def\textdegree{o}% 4425 \def\textdegree{o}%
4616 % 4426 %
4617 \expandafter\ifx\csname SETtxiindexlquoteignore\endcsname\relax
4618 \else \indexlquoteignore \fi
4619 %
4620 % We need to get rid of all macros, leaving only the arguments (if present). 4427 % We need to get rid of all macros, leaving only the arguments (if present).
4621 % Of course this is not nearly correct, but it is the best we can do for now. 4428 % Of course this is not nearly correct, but it is the best we can do for now.
4622 % makeinfo does not expand macros in the argument to @deffn, which ends up 4429 % makeinfo does not expand macros in the argument to @deffn, which ends up
@@ -4630,11 +4437,6 @@ end
4630 \macrolist 4437 \macrolist
4631} 4438}
4632 4439
4633% Undocumented (for FSFS 2nd ed.): @set txiindexlquoteignore makes us
4634% ignore left quotes in the sort term.
4635{\catcode`\`=\active
4636 \gdef\indexlquoteignore{\let`=\empty}}
4637
4638\let\indexbackslash=0 %overridden during \printindex. 4440\let\indexbackslash=0 %overridden during \printindex.
4639\let\SETmarginindex=\relax % put index entries in margin (undocumented)? 4441\let\SETmarginindex=\relax % put index entries in margin (undocumented)?
4640 4442
@@ -4892,6 +4694,7 @@ end
4892% But this freezes the catcodes in the argument, and can cause problems to 4694% But this freezes the catcodes in the argument, and can cause problems to
4893% @code, which sets - active. This problem was fixed by a kludge--- 4695% @code, which sets - active. This problem was fixed by a kludge---
4894% ``-'' was active throughout whole index, but this isn't really right. 4696% ``-'' was active throughout whole index, but this isn't really right.
4697%
4895% The right solution is to prevent \entry from swallowing the whole text. 4698% The right solution is to prevent \entry from swallowing the whole text.
4896% --kasal, 21nov03 4699% --kasal, 21nov03
4897\def\entry{% 4700\def\entry{%
@@ -4928,17 +4731,10 @@ end
4928 % columns. 4731 % columns.
4929 \vskip 0pt plus1pt 4732 \vskip 0pt plus1pt
4930 % 4733 %
4931 % When reading the text of entry, convert explicit line breaks
4932 % from @* into spaces. The user might give these in long section
4933 % titles, for instance.
4934 \def\*{\unskip\space\ignorespaces}%
4935 \def\entrybreak{\hfil\break}%
4936 %
4937 % Swallow the left brace of the text (first parameter): 4734 % Swallow the left brace of the text (first parameter):
4938 \afterassignment\doentry 4735 \afterassignment\doentry
4939 \let\temp = 4736 \let\temp =
4940} 4737}
4941\def\entrybreak{\unskip\space\ignorespaces}%
4942\def\doentry{% 4738\def\doentry{%
4943 \bgroup % Instead of the swallowed brace. 4739 \bgroup % Instead of the swallowed brace.
4944 \noindent 4740 \noindent
@@ -5171,22 +4967,7 @@ end
5171\message{sectioning,} 4967\message{sectioning,}
5172% Chapters, sections, etc. 4968% Chapters, sections, etc.
5173 4969
5174% Let's start with @part. 4970% \unnumberedno is an oxymoron, of course. But we count the unnumbered
5175\outer\parseargdef\part{\partzzz{#1}}
5176\def\partzzz#1{%
5177 \chapoddpage
5178 \null
5179 \vskip.3\vsize % move it down on the page a bit
5180 \begingroup
5181 \noindent \titlefonts\rmisbold #1\par % the text
5182 \let\lastnode=\empty % no node to associate with
5183 \writetocentry{part}{#1}{}% but put it in the toc
5184 \headingsoff % no headline or footline on the part page
5185 \chapoddpage
5186 \endgroup
5187}
5188
5189% \unnumberedno is an oxymoron. But we count the unnumbered
5190% sections so that we can refer to them unambiguously in the pdf 4971% sections so that we can refer to them unambiguously in the pdf
5191% outlines by their "section number". We avoid collisions with chapter 4972% outlines by their "section number". We avoid collisions with chapter
5192% numbers by starting them at 10000. (If a document ever has 10000 4973% numbers by starting them at 10000. (If a document ever has 10000
@@ -5265,8 +5046,8 @@ end
5265\chardef\maxseclevel = 3 5046\chardef\maxseclevel = 3
5266% 5047%
5267% A numbered section within an unnumbered changes to unnumbered too. 5048% A numbered section within an unnumbered changes to unnumbered too.
5268% To achieve this, remember the "biggest" unnum. sec. we are currently in: 5049% To achive this, remember the "biggest" unnum. sec. we are currently in:
5269\chardef\unnlevel = \maxseclevel 5050\chardef\unmlevel = \maxseclevel
5270% 5051%
5271% Trace whether the current chapter is an appendix or not: 5052% Trace whether the current chapter is an appendix or not:
5272% \chapheadtype is "N" or "A", unnumbered chapters are ignored. 5053% \chapheadtype is "N" or "A", unnumbered chapters are ignored.
@@ -5291,8 +5072,8 @@ end
5291 % The heading type: 5072 % The heading type:
5292 \def\headtype{#1}% 5073 \def\headtype{#1}%
5293 \if \headtype U% 5074 \if \headtype U%
5294 \ifnum \absseclevel < \unnlevel 5075 \ifnum \absseclevel < \unmlevel
5295 \chardef\unnlevel = \absseclevel 5076 \chardef\unmlevel = \absseclevel
5296 \fi 5077 \fi
5297 \else 5078 \else
5298 % Check for appendix sections: 5079 % Check for appendix sections:
@@ -5304,10 +5085,10 @@ end
5304 \fi\fi 5085 \fi\fi
5305 \fi 5086 \fi
5306 % Check for numbered within unnumbered: 5087 % Check for numbered within unnumbered:
5307 \ifnum \absseclevel > \unnlevel 5088 \ifnum \absseclevel > \unmlevel
5308 \def\headtype{U}% 5089 \def\headtype{U}%
5309 \else 5090 \else
5310 \chardef\unnlevel = 3 5091 \chardef\unmlevel = 3
5311 \fi 5092 \fi
5312 \fi 5093 \fi
5313 % Now print the heading: 5094 % Now print the heading:
@@ -5393,8 +5174,7 @@ end
5393 \global\let\subsubsection = \appendixsubsubsec 5174 \global\let\subsubsection = \appendixsubsubsec
5394} 5175}
5395 5176
5396% normally unnmhead0 calls unnumberedzzz: 5177\outer\parseargdef\unnumbered{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz
5397\outer\parseargdef\unnumbered{\unnmhead0{#1}}
5398\def\unnumberedzzz#1{% 5178\def\unnumberedzzz#1{%
5399 \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 5179 \global\secno=0 \global\subsecno=0 \global\subsubsecno=0
5400 \global\advance\unnumberedno by 1 5180 \global\advance\unnumberedno by 1
@@ -5438,47 +5218,40 @@ end
5438\let\top\unnumbered 5218\let\top\unnumbered
5439 5219
5440% Sections. 5220% Sections.
5441%
5442\outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz 5221\outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz
5443\def\seczzz#1{% 5222\def\seczzz#1{%
5444 \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 5223 \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
5445 \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}% 5224 \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}%
5446} 5225}
5447 5226
5448% normally calls appendixsectionzzz: 5227\outer\parseargdef\appendixsection{\apphead1{#1}} % normally calls appendixsectionzzz
5449\outer\parseargdef\appendixsection{\apphead1{#1}}
5450\def\appendixsectionzzz#1{% 5228\def\appendixsectionzzz#1{%
5451 \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 5229 \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
5452 \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}% 5230 \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}%
5453} 5231}
5454\let\appendixsec\appendixsection 5232\let\appendixsec\appendixsection
5455 5233
5456% normally calls unnumberedseczzz: 5234\outer\parseargdef\unnumberedsec{\unnmhead1{#1}} % normally calls unnumberedseczzz
5457\outer\parseargdef\unnumberedsec{\unnmhead1{#1}}
5458\def\unnumberedseczzz#1{% 5235\def\unnumberedseczzz#1{%
5459 \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 5236 \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1
5460 \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}% 5237 \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}%
5461} 5238}
5462 5239
5463% Subsections. 5240% Subsections.
5464% 5241\outer\parseargdef\numberedsubsec{\numhead2{#1}} % normally calls numberedsubseczzz
5465% normally calls numberedsubseczzz:
5466\outer\parseargdef\numberedsubsec{\numhead2{#1}}
5467\def\numberedsubseczzz#1{% 5242\def\numberedsubseczzz#1{%
5468 \global\subsubsecno=0 \global\advance\subsecno by 1 5243 \global\subsubsecno=0 \global\advance\subsecno by 1
5469 \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}% 5244 \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}%
5470} 5245}
5471 5246
5472% normally calls appendixsubseczzz: 5247\outer\parseargdef\appendixsubsec{\apphead2{#1}} % normally calls appendixsubseczzz
5473\outer\parseargdef\appendixsubsec{\apphead2{#1}}
5474\def\appendixsubseczzz#1{% 5248\def\appendixsubseczzz#1{%
5475 \global\subsubsecno=0 \global\advance\subsecno by 1 5249 \global\subsubsecno=0 \global\advance\subsecno by 1
5476 \sectionheading{#1}{subsec}{Yappendix}% 5250 \sectionheading{#1}{subsec}{Yappendix}%
5477 {\appendixletter.\the\secno.\the\subsecno}% 5251 {\appendixletter.\the\secno.\the\subsecno}%
5478} 5252}
5479 5253
5480% normally calls unnumberedsubseczzz: 5254\outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}} %normally calls unnumberedsubseczzz
5481\outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}}
5482\def\unnumberedsubseczzz#1{% 5255\def\unnumberedsubseczzz#1{%
5483 \global\subsubsecno=0 \global\advance\subsecno by 1 5256 \global\subsubsecno=0 \global\advance\subsecno by 1
5484 \sectionheading{#1}{subsec}{Ynothing}% 5257 \sectionheading{#1}{subsec}{Ynothing}%
@@ -5486,25 +5259,21 @@ end
5486} 5259}
5487 5260
5488% Subsubsections. 5261% Subsubsections.
5489% 5262\outer\parseargdef\numberedsubsubsec{\numhead3{#1}} % normally numberedsubsubseczzz
5490% normally numberedsubsubseczzz:
5491\outer\parseargdef\numberedsubsubsec{\numhead3{#1}}
5492\def\numberedsubsubseczzz#1{% 5263\def\numberedsubsubseczzz#1{%
5493 \global\advance\subsubsecno by 1 5264 \global\advance\subsubsecno by 1
5494 \sectionheading{#1}{subsubsec}{Ynumbered}% 5265 \sectionheading{#1}{subsubsec}{Ynumbered}%
5495 {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}% 5266 {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}%
5496} 5267}
5497 5268
5498% normally appendixsubsubseczzz: 5269\outer\parseargdef\appendixsubsubsec{\apphead3{#1}} % normally appendixsubsubseczzz
5499\outer\parseargdef\appendixsubsubsec{\apphead3{#1}}
5500\def\appendixsubsubseczzz#1{% 5270\def\appendixsubsubseczzz#1{%
5501 \global\advance\subsubsecno by 1 5271 \global\advance\subsubsecno by 1
5502 \sectionheading{#1}{subsubsec}{Yappendix}% 5272 \sectionheading{#1}{subsubsec}{Yappendix}%
5503 {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}% 5273 {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}%
5504} 5274}
5505 5275
5506% normally unnumberedsubsubseczzz: 5276\outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}} %normally unnumberedsubsubseczzz
5507\outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}}
5508\def\unnumberedsubsubseczzz#1{% 5277\def\unnumberedsubsubseczzz#1{%
5509 \global\advance\subsubsecno by 1 5278 \global\advance\subsubsecno by 1
5510 \sectionheading{#1}{subsubsec}{Ynothing}% 5279 \sectionheading{#1}{subsubsec}{Ynothing}%
@@ -5554,13 +5323,14 @@ end
5554% (including whitespace, linebreaking, etc. around it), 5323% (including whitespace, linebreaking, etc. around it),
5555% given all the information in convenient, parsed form. 5324% given all the information in convenient, parsed form.
5556 5325
5557% Args are the skip and penalty (usually negative) 5326%%% Args are the skip and penalty (usually negative)
5558\def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi} 5327\def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi}
5559 5328
5329%%% Define plain chapter starts, and page on/off switching for it
5560% Parameter controlling skip before chapter headings (if needed) 5330% Parameter controlling skip before chapter headings (if needed)
5331
5561\newskip\chapheadingskip 5332\newskip\chapheadingskip
5562 5333
5563% Define plain chapter starts, and page on/off switching for it.
5564\def\chapbreak{\dobreak \chapheadingskip {-4000}} 5334\def\chapbreak{\dobreak \chapheadingskip {-4000}}
5565\def\chappager{\par\vfill\supereject} 5335\def\chappager{\par\vfill\supereject}
5566% Because \domark is called before \chapoddpage, the filler page will 5336% Because \domark is called before \chapoddpage, the filler page will
@@ -5570,8 +5340,9 @@ end
5570 \chappager 5340 \chappager
5571 \ifodd\pageno \else 5341 \ifodd\pageno \else
5572 \begingroup 5342 \begingroup
5573 \headingsoff 5343 \evenheadline={\hfil}\evenfootline={\hfil}%
5574 \null 5344 \oddheadline={\hfil}\oddfootline={\hfil}%
5345 \hbox to 0pt{}%
5575 \chappager 5346 \chappager
5576 \endgroup 5347 \endgroup
5577 \fi 5348 \fi
@@ -5763,8 +5534,6 @@ end
5763% 5534%
5764\def\sectionheading#1#2#3#4{% 5535\def\sectionheading#1#2#3#4{%
5765 {% 5536 {%
5766 \checkenv{}% should not be in an environment.
5767 %
5768 % Switch to the right set of fonts. 5537 % Switch to the right set of fonts.
5769 \csname #2fonts\endcsname \rmisbold 5538 \csname #2fonts\endcsname \rmisbold
5770 % 5539 %
@@ -5882,6 +5651,7 @@ end
5882 % This is purely so the last item on the list is a known \penalty > 5651 % This is purely so the last item on the list is a known \penalty >
5883 % 10000. This is so \startdefun can avoid allowing breakpoints after 5652 % 10000. This is so \startdefun can avoid allowing breakpoints after
5884 % section headings. Otherwise, it would insert a valid breakpoint between: 5653 % section headings. Otherwise, it would insert a valid breakpoint between:
5654 %
5885 % @section sec-whatever 5655 % @section sec-whatever
5886 % @deffn def-whatever 5656 % @deffn def-whatever
5887 \penalty 10001 5657 \penalty 10001
@@ -6015,7 +5785,6 @@ end
6015\def\summarycontents{% 5785\def\summarycontents{%
6016 \startcontents{\putwordShortTOC}% 5786 \startcontents{\putwordShortTOC}%
6017 % 5787 %
6018 \let\partentry = \shortpartentry
6019 \let\numchapentry = \shortchapentry 5788 \let\numchapentry = \shortchapentry
6020 \let\appentry = \shortchapentry 5789 \let\appentry = \shortchapentry
6021 \let\unnchapentry = \shortunnchapentry 5790 \let\unnchapentry = \shortunnchapentry
@@ -6071,19 +5840,6 @@ end
6071% The last argument is the page number. 5840% The last argument is the page number.
6072% The arguments in between are the chapter number, section number, ... 5841% The arguments in between are the chapter number, section number, ...
6073 5842
6074% Parts, in the main contents. Replace the part number, which doesn't
6075% exist, with an empty box. Let's hope all the numbers have the same width.
6076% Also ignore the page number, which is conventionally not printed.
6077\def\numeralbox{\setbox0=\hbox{8}\hbox to \wd0{\hfil}}
6078\def\partentry#1#2#3#4{\dochapentry{\numeralbox\labelspace#1}{}}
6079%
6080% Parts, in the short toc.
6081\def\shortpartentry#1#2#3#4{%
6082 \penalty-300
6083 \vskip.5\baselineskip plus.15\baselineskip minus.1\baselineskip
6084 \shortchapentry{{\bf #1}}{\numeralbox}{}{}%
6085}
6086
6087% Chapters, in the main contents. 5843% Chapters, in the main contents.
6088\def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}} 5844\def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}}
6089% 5845%
@@ -6173,9 +5929,9 @@ end
6173\message{environments,} 5929\message{environments,}
6174% @foo ... @end foo. 5930% @foo ... @end foo.
6175 5931
6176% @tex ... @end tex escapes into raw TeX temporarily. 5932% @tex ... @end tex escapes into raw Tex temporarily.
6177% One exception: @ is still an escape character, so that @end tex works. 5933% One exception: @ is still an escape character, so that @end tex works.
6178% But \@ or @@ will get a plain @ character. 5934% But \@ or @@ will get a plain tex @ character.
6179 5935
6180\envdef\tex{% 5936\envdef\tex{%
6181 \setupmarkupstyle{tex}% 5937 \setupmarkupstyle{tex}%
@@ -6192,10 +5948,6 @@ end
6192 \catcode`\'=\other 5948 \catcode`\'=\other
6193 \escapechar=`\\ 5949 \escapechar=`\\
6194 % 5950 %
6195 % ' is active in math mode (mathcode"8000). So reset it, and all our
6196 % other math active characters (just in case), to plain's definitions.
6197 \mathactive
6198 %
6199 \let\b=\ptexb 5951 \let\b=\ptexb
6200 \let\bullet=\ptexbullet 5952 \let\bullet=\ptexbullet
6201 \let\c=\ptexc 5953 \let\c=\ptexc
@@ -6299,12 +6051,6 @@ end
6299 \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip 6051 \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip
6300 % Flag to tell @lisp, etc., not to narrow margin. 6052 % Flag to tell @lisp, etc., not to narrow margin.
6301 \let\nonarrowing = t% 6053 \let\nonarrowing = t%
6302 %
6303 % If this cartouche directly follows a sectioning command, we need the
6304 % \parskip glue (backspaced over by default) or the cartouche can
6305 % collide with the section heading.
6306 \ifnum\lastpenalty>10000 \vskip\parskip \fi
6307 %
6308 \vbox\bgroup 6054 \vbox\bgroup
6309 \baselineskip=0pt\parskip=0pt\lineskip=0pt 6055 \baselineskip=0pt\parskip=0pt\lineskip=0pt
6310 \carttop 6056 \carttop
@@ -6318,7 +6064,7 @@ end
6318 \lineskip=\normlskip 6064 \lineskip=\normlskip
6319 \parskip=\normpskip 6065 \parskip=\normpskip
6320 \vskip -\parskip 6066 \vskip -\parskip
6321 \comment % For explanation, see the end of def\group. 6067 \comment % For explanation, see the end of \def\group.
6322} 6068}
6323\def\Ecartouche{% 6069\def\Ecartouche{%
6324 \ifhmode\par\fi 6070 \ifhmode\par\fi
@@ -6404,42 +6150,41 @@ end
6404} 6150}
6405 6151
6406% We often define two environments, @foo and @smallfoo. 6152% We often define two environments, @foo and @smallfoo.
6407% Let's do it in one command. #1 is the env name, #2 the definition. 6153% Let's do it by one command:
6408\def\makedispenvdef#1#2{% 6154\def\makedispenv #1#2{
6409 \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2}% 6155 \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2}
6410 \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2}% 6156 \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2}
6411 \expandafter\let\csname E#1\endcsname \afterenvbreak 6157 \expandafter\let\csname E#1\endcsname \afterenvbreak
6412 \expandafter\let\csname Esmall#1\endcsname \afterenvbreak 6158 \expandafter\let\csname Esmall#1\endcsname \afterenvbreak
6413} 6159}
6414 6160
6415% Define two environment synonyms (#1 and #2) for an environment. 6161% Define two synonyms:
6416\def\maketwodispenvdef#1#2#3{% 6162\def\maketwodispenvs #1#2#3{
6417 \makedispenvdef{#1}{#3}% 6163 \makedispenv{#1}{#3}
6418 \makedispenvdef{#2}{#3}% 6164 \makedispenv{#2}{#3}
6419} 6165}
6420% 6166
6421% @lisp: indented, narrowed, typewriter font; 6167% @lisp: indented, narrowed, typewriter font; @example: same as @lisp.
6422% @example: same as @lisp.
6423% 6168%
6424% @smallexample and @smalllisp: use smaller fonts. 6169% @smallexample and @smalllisp: use smaller fonts.
6425% Originally contributed by Pavel@xerox. 6170% Originally contributed by Pavel@xerox.
6426% 6171%
6427\maketwodispenvdef{lisp}{example}{% 6172\maketwodispenvs {lisp}{example}{%
6428 \nonfillstart 6173 \nonfillstart
6429 \tt\setupmarkupstyle{example}% 6174 \tt\setupmarkupstyle{example}%
6430 \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special. 6175 \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
6431 \gobble % eat return 6176 \gobble % eat return
6432} 6177}
6433% @display/@smalldisplay: same as @lisp except keep current font. 6178% @display/@smalldisplay: same as @lisp except keep current font.
6434% 6179%
6435\makedispenvdef{display}{% 6180\makedispenv {display}{%
6436 \nonfillstart 6181 \nonfillstart
6437 \gobble 6182 \gobble
6438} 6183}
6439 6184
6440% @format/@smallformat: same as @display except don't narrow margins. 6185% @format/@smallformat: same as @display except don't narrow margins.
6441% 6186%
6442\makedispenvdef{format}{% 6187\makedispenv{format}{%
6443 \let\nonarrowing = t% 6188 \let\nonarrowing = t%
6444 \nonfillstart 6189 \nonfillstart
6445 \gobble 6190 \gobble
@@ -6458,7 +6203,7 @@ end
6458\envdef\flushright{% 6203\envdef\flushright{%
6459 \let\nonarrowing = t% 6204 \let\nonarrowing = t%
6460 \nonfillstart 6205 \nonfillstart
6461 \advance\leftskip by 0pt plus 1fill\relax 6206 \advance\leftskip by 0pt plus 1fill
6462 \gobble 6207 \gobble
6463} 6208}
6464\let\Eflushright = \afterenvbreak 6209\let\Eflushright = \afterenvbreak
@@ -6493,8 +6238,6 @@ end
6493% we're doing normal filling. So, when using \aboveenvbreak and 6238% we're doing normal filling. So, when using \aboveenvbreak and
6494% \afterenvbreak, temporarily make \parskip 0. 6239% \afterenvbreak, temporarily make \parskip 0.
6495% 6240%
6496\makedispenvdef{quotation}{\quotationstart}
6497%
6498\def\quotationstart{% 6241\def\quotationstart{%
6499 {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip 6242 {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
6500 \parindent=0pt 6243 \parindent=0pt
@@ -6510,18 +6253,28 @@ end
6510 \parsearg\quotationlabel 6253 \parsearg\quotationlabel
6511} 6254}
6512 6255
6256\envdef\quotation{%
6257 \setnormaldispenv
6258 \quotationstart
6259}
6260
6261\envdef\smallquotation{%
6262 \setsmalldispenv
6263 \quotationstart
6264}
6265\let\Esmallquotation = \Equotation
6266
6513% We have retained a nonzero parskip for the environment, since we're 6267% We have retained a nonzero parskip for the environment, since we're
6514% doing normal filling. 6268% doing normal filling.
6515% 6269%
6516\def\Equotation{% 6270\def\Equotation{%
6517 \par 6271 \par
6518 \ifx\quotationauthor\thisisundefined\else 6272 \ifx\quotationauthor\undefined\else
6519 % indent a bit. 6273 % indent a bit.
6520 \leftline{\kern 2\leftskip \sl ---\quotationauthor}% 6274 \leftline{\kern 2\leftskip \sl ---\quotationauthor}%
6521 \fi 6275 \fi
6522 {\parskip=0pt \afterenvbreak}% 6276 {\parskip=0pt \afterenvbreak}%
6523} 6277}
6524\def\Esmallquotation{\Equotation}
6525 6278
6526% If we're given an argument, typeset it in bold with a colon after. 6279% If we're given an argument, typeset it in bold with a colon after.
6527\def\quotationlabel#1{% 6280\def\quotationlabel#1{%
@@ -6578,28 +6331,21 @@ end
6578 6331
6579% Setup for the @verbatim environment 6332% Setup for the @verbatim environment
6580% 6333%
6581% Real tab expansion. 6334% Real tab expansion
6582\newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount 6335\newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount
6583% 6336%
6584% We typeset each line of the verbatim in an \hbox, so we can handle 6337\def\starttabbox{\setbox0=\hbox\bgroup}
6585% tabs. The \global is in case the verbatim line starts with an accent,
6586% or some other command that starts with a begin-group. Otherwise, the
6587% entire \verbbox would disappear at the corresponding end-group, before
6588% it is typeset. Meanwhile, we can't have nested verbatim commands
6589% (can we?), so the \global won't be overwriting itself.
6590\newbox\verbbox
6591\def\starttabbox{\global\setbox\verbbox=\hbox\bgroup}
6592% 6338%
6593\begingroup 6339\begingroup
6594 \catcode`\^^I=\active 6340 \catcode`\^^I=\active
6595 \gdef\tabexpand{% 6341 \gdef\tabexpand{%
6596 \catcode`\^^I=\active 6342 \catcode`\^^I=\active
6597 \def^^I{\leavevmode\egroup 6343 \def^^I{\leavevmode\egroup
6598 \dimen\verbbox=\wd\verbbox % the width so far, or since the previous tab 6344 \dimen0=\wd0 % the width so far, or since the previous tab
6599 \divide\dimen\verbbox by\tabw 6345 \divide\dimen0 by\tabw
6600 \multiply\dimen\verbbox by\tabw % compute previous multiple of \tabw 6346 \multiply\dimen0 by\tabw % compute previous multiple of \tabw
6601 \advance\dimen\verbbox by\tabw % advance to next multiple of \tabw 6347 \advance\dimen0 by\tabw % advance to next multiple of \tabw
6602 \wd\verbbox=\dimen\verbbox \box\verbbox \starttabbox 6348 \wd0=\dimen0 \box0 \starttabbox
6603 }% 6349 }%
6604 } 6350 }
6605\endgroup 6351\endgroup
@@ -6608,16 +6354,15 @@ end
6608\def\setupverbatim{% 6354\def\setupverbatim{%
6609 \let\nonarrowing = t% 6355 \let\nonarrowing = t%
6610 \nonfillstart 6356 \nonfillstart
6611 \tt % easiest (and conventionally used) font for verbatim 6357 % Easiest (and conventionally used) font for verbatim
6612 % The \leavevmode here is for blank lines. Otherwise, we would 6358 \tt
6613 % never \starttabox and the \egroup would end verbatim mode. 6359 \def\par{\leavevmode\egroup\box0\endgraf}%
6614 \def\par{\leavevmode\egroup\box\verbbox\endgraf}%
6615 \tabexpand 6360 \tabexpand
6616 \setupmarkupstyle{verbatim}% 6361 \setupmarkupstyle{verbatim}%
6617 % Respect line breaks, 6362 % Respect line breaks,
6618 % print special symbols as themselves, and 6363 % print special symbols as themselves, and
6619 % make each space count. 6364 % make each space count
6620 % Must do in this order: 6365 % must do in this order:
6621 \obeylines \uncatcodespecials \sepspaces 6366 \obeylines \uncatcodespecials \sepspaces
6622 \everypar{\starttabbox}% 6367 \everypar{\starttabbox}%
6623} 6368}
@@ -6674,7 +6419,6 @@ end
6674 \makevalueexpandable 6419 \makevalueexpandable
6675 \setupverbatim 6420 \setupverbatim
6676 \indexnofonts % Allow `@@' and other weird things in file names. 6421 \indexnofonts % Allow `@@' and other weird things in file names.
6677 \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}%
6678 \input #1 6422 \input #1
6679 \afterenvbreak 6423 \afterenvbreak
6680 }% 6424 }%
@@ -6724,7 +6468,7 @@ end
6724 % commands also insert a nobreak penalty, and we don't want to allow 6468 % commands also insert a nobreak penalty, and we don't want to allow
6725 % a break between a section heading and a defun. 6469 % a break between a section heading and a defun.
6726 % 6470 %
6727 % As a further refinement, we avoid "club" headers by signalling 6471 % As a minor refinement, we avoid "club" headers by signalling
6728 % with penalty of 10003 after the very first @deffn in the 6472 % with penalty of 10003 after the very first @deffn in the
6729 % sequence (see above), and penalty of 10002 after any following 6473 % sequence (see above), and penalty of 10002 after any following
6730 % @def command. 6474 % @def command.
@@ -6761,7 +6505,7 @@ end
6761 #1#2 \endheader 6505 #1#2 \endheader
6762 % common ending: 6506 % common ending:
6763 \interlinepenalty = 10000 6507 \interlinepenalty = 10000
6764 \advance\rightskip by 0pt plus 1fil\relax 6508 \advance\rightskip by 0pt plus 1fil
6765 \endgraf 6509 \endgraf
6766 \nobreak\vskip -\parskip 6510 \nobreak\vskip -\parskip
6767 \penalty\defunpenalty % signal to \startdefun and \dodefunx 6511 \penalty\defunpenalty % signal to \startdefun and \dodefunx
@@ -6791,36 +6535,13 @@ end
6791\def\domakedefun#1#2#3{% 6535\def\domakedefun#1#2#3{%
6792 \envdef#1{% 6536 \envdef#1{%
6793 \startdefun 6537 \startdefun
6794 \doingtypefnfalse % distinguish typed functions from all else
6795 \parseargusing\activeparens{\printdefunline#3}% 6538 \parseargusing\activeparens{\printdefunline#3}%
6796 }% 6539 }%
6797 \def#2{\dodefunx#1}% 6540 \def#2{\dodefunx#1}%
6798 \def#3% 6541 \def#3%
6799} 6542}
6800 6543
6801\newif\ifdoingtypefn % doing typed function? 6544%%% Untyped functions:
6802\newif\ifrettypeownline % typeset return type on its own line?
6803
6804% @deftypefnnewline on|off says whether the return type of typed functions
6805% are printed on their own line. This affects @deftypefn, @deftypefun,
6806% @deftypeop, and @deftypemethod.
6807%
6808\parseargdef\deftypefnnewline{%
6809 \def\temp{#1}%
6810 \ifx\temp\onword
6811 \expandafter\let\csname SETtxideftypefnnl\endcsname
6812 = \empty
6813 \else\ifx\temp\offword
6814 \expandafter\let\csname SETtxideftypefnnl\endcsname
6815 = \relax
6816 \else
6817 \errhelp = \EMsimple
6818 \errmessage{Unknown @txideftypefnnl value `\temp',
6819 must be on|off}%
6820 \fi\fi
6821}
6822
6823% Untyped functions:
6824 6545
6825% @deffn category name args 6546% @deffn category name args
6826\makedefun{deffn}{\deffngeneral{}} 6547\makedefun{deffn}{\deffngeneral{}}
@@ -6839,7 +6560,7 @@ end
6839 \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}% 6560 \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}%
6840} 6561}
6841 6562
6842% Typed functions: 6563%%% Typed functions:
6843 6564
6844% @deftypefn category type name args 6565% @deftypefn category type name args
6845\makedefun{deftypefn}{\deftypefngeneral{}} 6566\makedefun{deftypefn}{\deftypefngeneral{}}
@@ -6854,11 +6575,10 @@ end
6854% 6575%
6855\def\deftypefngeneral#1#2 #3 #4 #5\endheader{% 6576\def\deftypefngeneral#1#2 #3 #4 #5\endheader{%
6856 \dosubind{fn}{\code{#4}}{#1}% 6577 \dosubind{fn}{\code{#4}}{#1}%
6857 \doingtypefntrue
6858 \defname{#2}{#3}{#4}\defunargs{#5\unskip}% 6578 \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
6859} 6579}
6860 6580
6861% Typed variables: 6581%%% Typed variables:
6862 6582
6863% @deftypevr category type var args 6583% @deftypevr category type var args
6864\makedefun{deftypevr}{\deftypecvgeneral{}} 6584\makedefun{deftypevr}{\deftypecvgeneral{}}
@@ -6876,7 +6596,7 @@ end
6876 \defname{#2}{#3}{#4}\defunargs{#5\unskip}% 6596 \defname{#2}{#3}{#4}\defunargs{#5\unskip}%
6877} 6597}
6878 6598
6879% Untyped variables: 6599%%% Untyped variables:
6880 6600
6881% @defvr category var args 6601% @defvr category var args
6882\makedefun{defvr}#1 {\deftypevrheader{#1} {} } 6602\makedefun{defvr}#1 {\deftypevrheader{#1} {} }
@@ -6887,8 +6607,7 @@ end
6887% \defcvof {category of}class var args 6607% \defcvof {category of}class var args
6888\def\defcvof#1#2 {\deftypecvof{#1}#2 {} } 6608\def\defcvof#1#2 {\deftypecvof{#1}#2 {} }
6889 6609
6890% Types: 6610%%% Type:
6891
6892% @deftp category name args 6611% @deftp category name args
6893\makedefun{deftp}#1 #2 #3\endheader{% 6612\makedefun{deftp}#1 #2 #3\endheader{%
6894 \doind{tp}{\code{#2}}% 6613 \doind{tp}{\code{#2}}%
@@ -6916,49 +6635,25 @@ end
6916% We are followed by (but not passed) the arguments, if any. 6635% We are followed by (but not passed) the arguments, if any.
6917% 6636%
6918\def\defname#1#2#3{% 6637\def\defname#1#2#3{%
6919 \par
6920 % Get the values of \leftskip and \rightskip as they were outside the @def... 6638 % Get the values of \leftskip and \rightskip as they were outside the @def...
6921 \advance\leftskip by -\defbodyindent 6639 \advance\leftskip by -\defbodyindent
6922 % 6640 %
6923 % Determine if we are typesetting the return type of a typed function 6641 % How we'll format the type name. Putting it in brackets helps
6924 % on a line by itself.
6925 \rettypeownlinefalse
6926 \ifdoingtypefn % doing a typed function specifically?
6927 % then check user option for putting return type on its own line:
6928 \expandafter\ifx\csname SETtxideftypefnnl\endcsname\relax \else
6929 \rettypeownlinetrue
6930 \fi
6931 \fi
6932 %
6933 % How we'll format the category name. Putting it in brackets helps
6934 % distinguish it from the body text that may end up on the next line 6642 % distinguish it from the body text that may end up on the next line
6935 % just below it. 6643 % just below it.
6936 \def\temp{#1}% 6644 \def\temp{#1}%
6937 \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi} 6645 \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi}
6938 % 6646 %
6939 % Figure out line sizes for the paragraph shape. We'll always have at 6647 % Figure out line sizes for the paragraph shape.
6940 % least two.
6941 \tempnum = 2
6942 %
6943 % The first line needs space for \box0; but if \rightskip is nonzero, 6648 % The first line needs space for \box0; but if \rightskip is nonzero,
6944 % we need only space for the part of \box0 which exceeds it: 6649 % we need only space for the part of \box0 which exceeds it:
6945 \dimen0=\hsize \advance\dimen0 by -\wd0 \advance\dimen0 by \rightskip 6650 \dimen0=\hsize \advance\dimen0 by -\wd0 \advance\dimen0 by \rightskip
6946 %
6947 % If doing a return type on its own line, we'll have another line.
6948 \ifrettypeownline
6949 \advance\tempnum by 1
6950 \def\maybeshapeline{0in \hsize}%
6951 \else
6952 \def\maybeshapeline{}%
6953 \fi
6954 %
6955 % The continuations: 6651 % The continuations:
6956 \dimen2=\hsize \advance\dimen2 by -\defargsindent 6652 \dimen2=\hsize \advance\dimen2 by -\defargsindent
6653 % (plain.tex says that \dimen1 should be used only as global.)
6654 \parshape 2 0in \dimen0 \defargsindent \dimen2
6957 % 6655 %
6958 % The final paragraph shape: 6656 % Put the type name to the right margin.
6959 \parshape \tempnum 0in \dimen0 \maybeshapeline \defargsindent \dimen2
6960 %
6961 % Put the category name at the right margin.
6962 \noindent 6657 \noindent
6963 \hbox to 0pt{% 6658 \hbox to 0pt{%
6964 \hfil\box0 \kern-\hsize 6659 \hfil\box0 \kern-\hsize
@@ -6980,16 +6675,8 @@ end
6980 % . this still does not fix the ?` and !` ligatures, but so far no 6675 % . this still does not fix the ?` and !` ligatures, but so far no
6981 % one has made identifiers using them :). 6676 % one has made identifiers using them :).
6982 \df \tt 6677 \df \tt
6983 \def\temp{#2}% text of the return type 6678 \def\temp{#2}% return value type
6984 \ifx\temp\empty\else 6679 \ifx\temp\empty\else \tclose{\temp} \fi
6985 \tclose{\temp}% typeset the return type
6986 \ifrettypeownline
6987 % put return type on its own line; prohibit line break following:
6988 \hfil\vadjust{\nobreak}\break
6989 \else
6990 \space % type on same line, so just followed by a space
6991 \fi
6992 \fi % no return type
6993 #3% output function name 6680 #3% output function name
6994 }% 6681 }%
6995 {\rm\enskip}% hskip 0.5 em of \tenrm 6682 {\rm\enskip}% hskip 0.5 em of \tenrm
@@ -7107,7 +6794,7 @@ end
7107 6794
7108% To do this right we need a feature of e-TeX, \scantokens, 6795% To do this right we need a feature of e-TeX, \scantokens,
7109% which we arrange to emulate with a temporary file in ordinary TeX. 6796% which we arrange to emulate with a temporary file in ordinary TeX.
7110\ifx\eTeXversion\thisisundefined 6797\ifx\eTeXversion\undefined
7111 \newwrite\macscribble 6798 \newwrite\macscribble
7112 \def\scantokens#1{% 6799 \def\scantokens#1{%
7113 \toks0={#1}% 6800 \toks0={#1}%
@@ -7118,30 +6805,25 @@ end
7118 } 6805 }
7119\fi 6806\fi
7120 6807
7121\def\scanmacro#1{\begingroup 6808\def\scanmacro#1{%
7122 \newlinechar`\^^M 6809 \begingroup
7123 \let\xeatspaces\eatspaces 6810 \newlinechar`\^^M
7124 % 6811 \let\xeatspaces\eatspaces
7125 % Undo catcode changes of \startcontents and \doprintindex 6812 % Undo catcode changes of \startcontents and \doprintindex
7126 % When called from @insertcopying or (short)caption, we need active 6813 % When called from @insertcopying or (short)caption, we need active
7127 % backslash to get it printed correctly. Previously, we had 6814 % backslash to get it printed correctly. Previously, we had
7128 % \catcode`\\=\other instead. We'll see whether a problem appears 6815 % \catcode`\\=\other instead. We'll see whether a problem appears
7129 % with macro expansion. --kasal, 19aug04 6816 % with macro expansion. --kasal, 19aug04
7130 \catcode`\@=0 \catcode`\\=\active \escapechar=`\@ 6817 \catcode`\@=0 \catcode`\\=\active \escapechar=`\@
7131 % 6818 % ... and \example
7132 % ... and for \example: 6819 \spaceisspace
7133 \spaceisspace 6820 %
7134 % 6821 % Append \endinput to make sure that TeX does not see the ending newline.
7135 % The \empty here causes a following catcode 5 newline to be eaten as 6822 % I've verified that it is necessary both for e-TeX and for ordinary TeX
7136 % part of reading whitespace after a control sequence. It does not 6823 % --kasal, 29nov03
7137 % eat a catcode 13 newline. There's no good way to handle the two 6824 \scantokens{#1\endinput}%
7138 % cases (untried: maybe e-TeX's \everyeof could help, though plain TeX 6825 \endgroup
7139 % would then have different behavior). See the Macro Details node in 6826}
7140 % the manual for the workaround we recommend for macros and
7141 % line-oriented commands.
7142 %
7143 \scantokens{#1\empty}%
7144\endgroup}
7145 6827
7146\def\scanexp#1{% 6828\def\scanexp#1{%
7147 \edef\temp{\noexpand\scanmacro{#1}}% 6829 \edef\temp{\noexpand\scanmacro{#1}}%
@@ -7195,18 +6877,17 @@ end
7195 6877
7196% Macro bodies are absorbed as an argument in a context where 6878% Macro bodies are absorbed as an argument in a context where
7197% all characters are catcode 10, 11 or 12, except \ which is active 6879% all characters are catcode 10, 11 or 12, except \ which is active
7198% (as in normal texinfo). It is necessary to change the definition of \ 6880% (as in normal texinfo). It is necessary to change the definition of \.
7199% to recognize macro arguments; this is the job of \mbodybackslash. 6881
7200%
7201% Non-ASCII encodings make 8-bit characters active, so un-activate 6882% Non-ASCII encodings make 8-bit characters active, so un-activate
7202% them to avoid their expansion. Must do this non-globally, to 6883% them to avoid their expansion. Must do this non-globally, to
7203% confine the change to the current group. 6884% confine the change to the current group.
7204% 6885
7205% It's necessary to have hard CRs when the macro is executed. This is 6886% It's necessary to have hard CRs when the macro is executed. This is
7206% done by making ^^M (\endlinechar) catcode 12 when reading the macro 6887% done by making ^^M (\endlinechar) catcode 12 when reading the macro
7207% body, and then making it the \newlinechar in \scanmacro. 6888% body, and then making it the \newlinechar in \scanmacro.
7208% 6889
7209\def\scanctxt{% used as subroutine 6890\def\scanctxt{%
7210 \catcode`\"=\other 6891 \catcode`\"=\other
7211 \catcode`\+=\other 6892 \catcode`\+=\other
7212 \catcode`\<=\other 6893 \catcode`\<=\other
@@ -7219,13 +6900,13 @@ end
7219 \ifx\declaredencoding\ascii \else \setnonasciicharscatcodenonglobal\other \fi 6900 \ifx\declaredencoding\ascii \else \setnonasciicharscatcodenonglobal\other \fi
7220} 6901}
7221 6902
7222\def\scanargctxt{% used for copying and captions, not macros. 6903\def\scanargctxt{%
7223 \scanctxt 6904 \scanctxt
7224 \catcode`\\=\other 6905 \catcode`\\=\other
7225 \catcode`\^^M=\other 6906 \catcode`\^^M=\other
7226} 6907}
7227 6908
7228\def\macrobodyctxt{% used for @macro definitions 6909\def\macrobodyctxt{%
7229 \scanctxt 6910 \scanctxt
7230 \catcode`\{=\other 6911 \catcode`\{=\other
7231 \catcode`\}=\other 6912 \catcode`\}=\other
@@ -7233,56 +6914,32 @@ end
7233 \usembodybackslash 6914 \usembodybackslash
7234} 6915}
7235 6916
7236\def\macroargctxt{% used when scanning invocations 6917\def\macroargctxt{%
7237 \scanctxt 6918 \scanctxt
7238 \catcode`\\=0 6919 \catcode`\\=\other
7239} 6920}
7240% why catcode 0 for \ in the above? To recognize \\ \{ \} as "escapes"
7241% for the single characters \ { }. Thus, we end up with the "commands"
7242% that would be written @\ @{ @} in a Texinfo document.
7243%
7244% We already have @{ and @}. For @\, we define it here, and only for
7245% this purpose, to produce a typewriter backslash (so, the @\ that we
7246% define for @math can't be used with @macro calls):
7247%
7248\def\\{\normalbackslash}%
7249%
7250% We would like to do this for \, too, since that is what makeinfo does.
7251% But it is not possible, because Texinfo already has a command @, for a
7252% cedilla accent. Documents must use @comma{} instead.
7253%
7254% \anythingelse will almost certainly be an error of some kind.
7255
7256 6921
7257% \mbodybackslash is the definition of \ in @macro bodies. 6922% \mbodybackslash is the definition of \ in @macro bodies.
7258% It maps \foo\ => \csname macarg.foo\endcsname => #N 6923% It maps \foo\ => \csname macarg.foo\endcsname => #N
7259% where N is the macro parameter number. 6924% where N is the macro parameter number.
7260% We define \csname macarg.\endcsname to be \realbackslash, so 6925% We define \csname macarg.\endcsname to be \realbackslash, so
7261% \\ in macro replacement text gets you a backslash. 6926% \\ in macro replacement text gets you a backslash.
7262% 6927
7263{\catcode`@=0 @catcode`@\=@active 6928{\catcode`@=0 @catcode`@\=@active
7264 @gdef@usembodybackslash{@let\=@mbodybackslash} 6929 @gdef@usembodybackslash{@let\=@mbodybackslash}
7265 @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname} 6930 @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname}
7266} 6931}
7267\expandafter\def\csname macarg.\endcsname{\realbackslash} 6932\expandafter\def\csname macarg.\endcsname{\realbackslash}
7268 6933
7269\def\margbackslash#1{\char`\#1 }
7270
7271\def\macro{\recursivefalse\parsearg\macroxxx} 6934\def\macro{\recursivefalse\parsearg\macroxxx}
7272\def\rmacro{\recursivetrue\parsearg\macroxxx} 6935\def\rmacro{\recursivetrue\parsearg\macroxxx}
7273 6936
7274\def\macroxxx#1{% 6937\def\macroxxx#1{%
7275 \getargs{#1}% now \macname is the macname and \argl the arglist 6938 \getargs{#1}% now \macname is the macname and \argl the arglist
7276 \ifx\argl\empty % no arguments 6939 \ifx\argl\empty % no arguments
7277 \paramno=0\relax 6940 \paramno=0%
7278 \else 6941 \else
7279 \expandafter\parsemargdef \argl;% 6942 \expandafter\parsemargdef \argl;%
7280 \if\paramno>256\relax
7281 \ifx\eTeXversion\thisisundefined
7282 \errhelp = \EMsimple
7283 \errmessage{You need eTeX to compile a file with macros with more than 256 arguments}
7284 \fi
7285 \fi
7286 \fi 6943 \fi
7287 \if1\csname ismacro.\the\macname\endcsname 6944 \if1\csname ismacro.\the\macname\endcsname
7288 \message{Warning: redefining \the\macname}% 6945 \message{Warning: redefining \the\macname}%
@@ -7329,269 +6986,46 @@ end
7329% an opening brace, and that opening brace is not consumed. 6986% an opening brace, and that opening brace is not consumed.
7330\def\getargs#1{\getargsxxx#1{}} 6987\def\getargs#1{\getargsxxx#1{}}
7331\def\getargsxxx#1#{\getmacname #1 \relax\getmacargs} 6988\def\getargsxxx#1#{\getmacname #1 \relax\getmacargs}
7332\def\getmacname#1 #2\relax{\macname={#1}} 6989\def\getmacname #1 #2\relax{\macname={#1}}
7333\def\getmacargs#1{\def\argl{#1}} 6990\def\getmacargs#1{\def\argl{#1}}
7334 6991
7335% For macro processing make @ a letter so that we can make Texinfo private macro names.
7336\edef\texiatcatcode{\the\catcode`\@}
7337\catcode `@=11\relax
7338
7339% Parse the optional {params} list. Set up \paramno and \paramlist 6992% Parse the optional {params} list. Set up \paramno and \paramlist
7340% so \defmacro knows what to do. Define \macarg.BLAH for each BLAH 6993% so \defmacro knows what to do. Define \macarg.blah for each blah
7341% in the params list to some hook where the argument si to be expanded. If 6994% in the params list, to be ##N where N is the position in that list.
7342% there are less than 10 arguments that hook is to be replaced by ##N where N
7343% is the position in that list, that is to say the macro arguments are to be
7344% defined `a la TeX in the macro body.
7345%
7346% That gets used by \mbodybackslash (above). 6995% That gets used by \mbodybackslash (above).
7347% 6996
7348% We need to get `macro parameter char #' into several definitions. 6997% We need to get `macro parameter char #' into several definitions.
7349% The technique used is stolen from LaTeX: let \hash be something 6998% The technique used is stolen from LaTeX: let \hash be something
7350% unexpandable, insert that wherever you need a #, and then redefine 6999% unexpandable, insert that wherever you need a #, and then redefine
7351% it to # just before using the token list produced. 7000% it to # just before using the token list produced.
7352% 7001%
7353% The same technique is used to protect \eatspaces till just before 7002% The same technique is used to protect \eatspaces till just before
7354% the macro is used. 7003% the macro is used.
7355% 7004
7356% If there are 10 or more arguments, a different technique is used, where the 7005\def\parsemargdef#1;{\paramno=0\def\paramlist{}%
7357% hook remains in the body, and when macro is to be expanded the body is 7006 \let\hash\relax\let\xeatspaces\relax\parsemargdefxxx#1,;,}
7358% processed again to replace the arguments.
7359%
7360% In that case, the hook is \the\toks N-1, and we simply set \toks N-1 to the
7361% argument N value and then \edef the body (nothing else will expand because of
7362% the catcode regime underwhich the body was input).
7363%
7364% If you compile with TeX (not eTeX), and you have macros with 10 or more
7365% arguments, you need that no macro has more than 256 arguments, otherwise an
7366% error is produced.
7367\def\parsemargdef#1;{%
7368 \paramno=0\def\paramlist{}%
7369 \let\hash\relax
7370 \let\xeatspaces\relax
7371 \parsemargdefxxx#1,;,%
7372 % In case that there are 10 or more arguments we parse again the arguments
7373 % list to set new definitions for the \macarg.BLAH macros corresponding to
7374 % each BLAH argument. It was anyhow needed to parse already once this list
7375 % in order to count the arguments, and as macros with at most 9 arguments
7376 % are by far more frequent than macro with 10 or more arguments, defining
7377 % twice the \macarg.BLAH macros does not cost too much processing power.
7378 \ifnum\paramno<10\relax\else
7379 \paramno0\relax
7380 \parsemmanyargdef@@#1,;,% 10 or more arguments
7381 \fi
7382}
7383\def\parsemargdefxxx#1,{% 7007\def\parsemargdefxxx#1,{%
7384 \if#1;\let\next=\relax 7008 \if#1;\let\next=\relax
7385 \else \let\next=\parsemargdefxxx 7009 \else \let\next=\parsemargdefxxx
7386 \advance\paramno by 1 7010 \advance\paramno by 1%
7387 \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname 7011 \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname
7388 {\xeatspaces{\hash\the\paramno}}% 7012 {\xeatspaces{\hash\the\paramno}}%
7389 \edef\paramlist{\paramlist\hash\the\paramno,}% 7013 \edef\paramlist{\paramlist\hash\the\paramno,}%
7390 \fi\next} 7014 \fi\next}
7391 7015
7392\def\parsemmanyargdef@@#1,{%
7393 \if#1;\let\next=\relax
7394 \else
7395 \let\next=\parsemmanyargdef@@
7396 \edef\tempb{\eatspaces{#1}}%
7397 \expandafter\def\expandafter\tempa
7398 \expandafter{\csname macarg.\tempb\endcsname}%
7399 % Note that we need some extra \noexpand\noexpand, this is because we
7400 % don't want \the to be expanded in the \parsermacbody as it uses an
7401 % \xdef .
7402 \expandafter\edef\tempa
7403 {\noexpand\noexpand\noexpand\the\toks\the\paramno}%
7404 \advance\paramno by 1\relax
7405 \fi\next}
7406
7407% These two commands read recursive and nonrecursive macro bodies. 7016% These two commands read recursive and nonrecursive macro bodies.
7408% (They're different since rec and nonrec macros end differently.) 7017% (They're different since rec and nonrec macros end differently.)
7409%
7410 7018
7411\catcode `\@\texiatcatcode
7412\long\def\parsemacbody#1@end macro% 7019\long\def\parsemacbody#1@end macro%
7413{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% 7020{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
7414\long\def\parsermacbody#1@end rmacro% 7021\long\def\parsermacbody#1@end rmacro%
7415{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% 7022{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
7416\catcode `\@=11\relax
7417
7418\let\endargs@\relax
7419\let\nil@\relax
7420\def\nilm@{\nil@}%
7421\long\def\nillm@{\nil@}%
7422
7423% This macro is expanded during the Texinfo macro expansion, not during its
7424% definition. It gets all the arguments values and assigns them to macros
7425% macarg.ARGNAME
7426%
7427% #1 is the macro name
7428% #2 is the list of argument names
7429% #3 is the list of argument values
7430\def\getargvals@#1#2#3{%
7431 \def\macargdeflist@{}%
7432 \def\saveparamlist@{#2}% Need to keep a copy for parameter expansion.
7433 \def\paramlist{#2,\nil@}%
7434 \def\macroname{#1}%
7435 \begingroup
7436 \macroargctxt
7437 \def\argvaluelist{#3,\nil@}%
7438 \def\@tempa{#3}%
7439 \ifx\@tempa\empty
7440 \setemptyargvalues@
7441 \else
7442 \getargvals@@
7443 \fi
7444}
7445
7446%
7447\def\getargvals@@{%
7448 \ifx\paramlist\nilm@
7449 % Some sanity check needed here that \argvaluelist is also empty.
7450 \ifx\argvaluelist\nillm@
7451 \else
7452 \errhelp = \EMsimple
7453 \errmessage{Too many arguments in macro `\macroname'!}%
7454 \fi
7455 \let\next\macargexpandinbody@
7456 \else
7457 \ifx\argvaluelist\nillm@
7458 % No more arguments values passed to macro. Set remaining named-arg
7459 % macros to empty.
7460 \let\next\setemptyargvalues@
7461 \else
7462 % pop current arg name into \@tempb
7463 \def\@tempa##1{\pop@{\@tempb}{\paramlist}##1\endargs@}%
7464 \expandafter\@tempa\expandafter{\paramlist}%
7465 % pop current argument value into \@tempc
7466 \def\@tempa##1{\longpop@{\@tempc}{\argvaluelist}##1\endargs@}%
7467 \expandafter\@tempa\expandafter{\argvaluelist}%
7468 % Here \@tempb is the current arg name and \@tempc is the current arg value.
7469 % First place the new argument macro definition into \@tempd
7470 \expandafter\macname\expandafter{\@tempc}%
7471 \expandafter\let\csname macarg.\@tempb\endcsname\relax
7472 \expandafter\def\expandafter\@tempe\expandafter{%
7473 \csname macarg.\@tempb\endcsname}%
7474 \edef\@tempd{\long\def\@tempe{\the\macname}}%
7475 \push@\@tempd\macargdeflist@
7476 \let\next\getargvals@@
7477 \fi
7478 \fi
7479 \next
7480}
7481
7482\def\push@#1#2{%
7483 \expandafter\expandafter\expandafter\def
7484 \expandafter\expandafter\expandafter#2%
7485 \expandafter\expandafter\expandafter{%
7486 \expandafter#1#2}%
7487}
7488
7489% Replace arguments by their values in the macro body, and place the result
7490% in macro \@tempa
7491\def\macvalstoargs@{%
7492 % To do this we use the property that token registers that are \the'ed
7493 % within an \edef expand only once. So we are going to place all argument
7494 % values into respective token registers.
7495 %
7496 % First we save the token context, and initialize argument numbering.
7497 \begingroup
7498 \paramno0\relax
7499 % Then, for each argument number #N, we place the corresponding argument
7500 % value into a new token list register \toks#N
7501 \expandafter\putargsintokens@\saveparamlist@,;,%
7502 % Then, we expand the body so that argument are replaced by their
7503 % values. The trick for values not to be expanded themselves is that they
7504 % are within tokens and that tokens expand only once in an \edef .
7505 \edef\@tempc{\csname mac.\macroname .body\endcsname}%
7506 % Now we restore the token stack pointer to free the token list registers
7507 % which we have used, but we make sure that expanded body is saved after
7508 % group.
7509 \expandafter
7510 \endgroup
7511 \expandafter\def\expandafter\@tempa\expandafter{\@tempc}%
7512 }
7513
7514\def\macargexpandinbody@{%
7515 %% Define the named-macro outside of this group and then close this group.
7516 \expandafter
7517 \endgroup
7518 \macargdeflist@
7519 % First the replace in body the macro arguments by their values, the result
7520 % is in \@tempa .
7521 \macvalstoargs@
7522 % Then we point at the \norecurse or \gobble (for recursive) macro value
7523 % with \@tempb .
7524 \expandafter\let\expandafter\@tempb\csname mac.\macroname .recurse\endcsname
7525 % Depending on whether it is recursive or not, we need some tailing
7526 % \egroup .
7527 \ifx\@tempb\gobble
7528 \let\@tempc\relax
7529 \else
7530 \let\@tempc\egroup
7531 \fi
7532 % And now we do the real job:
7533 \edef\@tempd{\noexpand\@tempb{\macroname}\noexpand\scanmacro{\@tempa}\@tempc}%
7534 \@tempd
7535}
7536
7537\def\putargsintokens@#1,{%
7538 \if#1;\let\next\relax
7539 \else
7540 \let\next\putargsintokens@
7541 % First we allocate the new token list register, and give it a temporary
7542 % alias \@tempb .
7543 \toksdef\@tempb\the\paramno
7544 % Then we place the argument value into that token list register.
7545 \expandafter\let\expandafter\@tempa\csname macarg.#1\endcsname
7546 \expandafter\@tempb\expandafter{\@tempa}%
7547 \advance\paramno by 1\relax
7548 \fi
7549 \next
7550}
7551
7552% Save the token stack pointer into macro #1
7553\def\texisavetoksstackpoint#1{\edef#1{\the\@cclvi}}
7554% Restore the token stack pointer from number in macro #1
7555\def\texirestoretoksstackpoint#1{\expandafter\mathchardef\expandafter\@cclvi#1\relax}
7556% newtoks that can be used non \outer .
7557\def\texinonouternewtoks{\alloc@ 5\toks \toksdef \@cclvi}
7558
7559% Tailing missing arguments are set to empty
7560\def\setemptyargvalues@{%
7561 \ifx\paramlist\nilm@
7562 \let\next\macargexpandinbody@
7563 \else
7564 \expandafter\setemptyargvaluesparser@\paramlist\endargs@
7565 \let\next\setemptyargvalues@
7566 \fi
7567 \next
7568}
7569 7023
7570\def\setemptyargvaluesparser@#1,#2\endargs@{% 7024% This defines the macro itself. There are six cases: recursive and
7571 \expandafter\def\expandafter\@tempa\expandafter{% 7025% nonrecursive macros of zero, one, and many arguments.
7572 \expandafter\def\csname macarg.#1\endcsname{}}%
7573 \push@\@tempa\macargdeflist@
7574 \def\paramlist{#2}%
7575}
7576
7577% #1 is the element target macro
7578% #2 is the list macro
7579% #3,#4\endargs@ is the list value
7580\def\pop@#1#2#3,#4\endargs@{%
7581 \def#1{#3}%
7582 \def#2{#4}%
7583}
7584\long\def\longpop@#1#2#3,#4\endargs@{%
7585 \long\def#1{#3}%
7586 \long\def#2{#4}%
7587}
7588
7589% This defines a Texinfo @macro. There are eight cases: recursive and
7590% nonrecursive macros of zero, one, up to nine, and many arguments.
7591% Much magic with \expandafter here. 7026% Much magic with \expandafter here.
7592% \xdef is used so that macro definitions will survive the file 7027% \xdef is used so that macro definitions will survive the file
7593% they're defined in; @include reads the file inside a group. 7028% they're defined in; @include reads the file inside a group.
7594%
7595\def\defmacro{% 7029\def\defmacro{%
7596 \let\hash=##% convert placeholders to macro parameter chars 7030 \let\hash=##% convert placeholders to macro parameter chars
7597 \ifrecursive 7031 \ifrecursive
@@ -7606,25 +7040,17 @@ end
7606 \expandafter\noexpand\csname\the\macname xxx\endcsname}% 7040 \expandafter\noexpand\csname\the\macname xxx\endcsname}%
7607 \expandafter\xdef\csname\the\macname xxx\endcsname##1{% 7041 \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
7608 \egroup\noexpand\scanmacro{\temp}}% 7042 \egroup\noexpand\scanmacro{\temp}}%
7609 \else 7043 \else % many
7610 \ifnum\paramno<10\relax % at most 9 7044 \expandafter\xdef\csname\the\macname\endcsname{%
7611 \expandafter\xdef\csname\the\macname\endcsname{% 7045 \bgroup\noexpand\macroargctxt
7612 \bgroup\noexpand\macroargctxt 7046 \noexpand\csname\the\macname xx\endcsname}%
7613 \noexpand\csname\the\macname xx\endcsname}% 7047 \expandafter\xdef\csname\the\macname xx\endcsname##1{%
7614 \expandafter\xdef\csname\the\macname xx\endcsname##1{% 7048 \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
7615 \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% 7049 \expandafter\expandafter
7616 \expandafter\expandafter 7050 \expandafter\xdef
7617 \expandafter\xdef 7051 \expandafter\expandafter
7618 \expandafter\expandafter 7052 \csname\the\macname xxx\endcsname
7619 \csname\the\macname xxx\endcsname 7053 \paramlist{\egroup\noexpand\scanmacro{\temp}}%
7620 \paramlist{\egroup\noexpand\scanmacro{\temp}}%
7621 \else % 10 or more
7622 \expandafter\xdef\csname\the\macname\endcsname{%
7623 \noexpand\getargvals@{\the\macname}{\argl}%
7624 }%
7625 \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp
7626 \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\gobble
7627 \fi
7628 \fi 7054 \fi
7629 \else 7055 \else
7630 \ifcase\paramno 7056 \ifcase\paramno
@@ -7641,40 +7067,29 @@ end
7641 \egroup 7067 \egroup
7642 \noexpand\norecurse{\the\macname}% 7068 \noexpand\norecurse{\the\macname}%
7643 \noexpand\scanmacro{\temp}\egroup}% 7069 \noexpand\scanmacro{\temp}\egroup}%
7644 \else % at most 9 7070 \else % many
7645 \ifnum\paramno<10\relax 7071 \expandafter\xdef\csname\the\macname\endcsname{%
7646 \expandafter\xdef\csname\the\macname\endcsname{% 7072 \bgroup\noexpand\macroargctxt
7647 \bgroup\noexpand\macroargctxt 7073 \expandafter\noexpand\csname\the\macname xx\endcsname}%
7648 \expandafter\noexpand\csname\the\macname xx\endcsname}% 7074 \expandafter\xdef\csname\the\macname xx\endcsname##1{%
7649 \expandafter\xdef\csname\the\macname xx\endcsname##1{% 7075 \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
7650 \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% 7076 \expandafter\expandafter
7651 \expandafter\expandafter 7077 \expandafter\xdef
7652 \expandafter\xdef 7078 \expandafter\expandafter
7653 \expandafter\expandafter 7079 \csname\the\macname xxx\endcsname
7654 \csname\the\macname xxx\endcsname 7080 \paramlist{%
7655 \paramlist{% 7081 \egroup
7656 \egroup 7082 \noexpand\norecurse{\the\macname}%
7657 \noexpand\norecurse{\the\macname}% 7083 \noexpand\scanmacro{\temp}\egroup}%
7658 \noexpand\scanmacro{\temp}\egroup}%
7659 \else % 10 or more:
7660 \expandafter\xdef\csname\the\macname\endcsname{%
7661 \noexpand\getargvals@{\the\macname}{\argl}%
7662 }%
7663 \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp
7664 \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\norecurse
7665 \fi
7666 \fi 7084 \fi
7667 \fi} 7085 \fi}
7668 7086
7669\catcode `\@\texiatcatcode\relax
7670
7671\def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}} 7087\def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}}
7672 7088
7673% \braceorline decides whether the next nonwhitespace character is a 7089% \braceorline decides whether the next nonwhitespace character is a
7674% {. If so it reads up to the closing }, if not, it reads the whole 7090% {. If so it reads up to the closing }, if not, it reads the whole
7675% line. Whatever was read is then fed to the next control sequence 7091% line. Whatever was read is then fed to the next control sequence
7676% as an argument (by \parsebrace or \parsearg). 7092% as an argument (by \parsebrace or \parsearg)
7677%
7678\def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx} 7093\def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx}
7679\def\braceorlinexxx{% 7094\def\braceorlinexxx{%
7680 \ifx\nchar\bgroup\else 7095 \ifx\nchar\bgroup\else
@@ -7684,8 +7099,7 @@ end
7684 7099
7685% @alias. 7100% @alias.
7686% We need some trickery to remove the optional spaces around the equal 7101% We need some trickery to remove the optional spaces around the equal
7687% sign. Make them active and then expand them all to nothing. 7102% sign. Just make them active and then expand them all to nothing.
7688%
7689\def\alias{\parseargusing\obeyspaces\aliasxxx} 7103\def\alias{\parseargusing\obeyspaces\aliasxxx}
7690\def\aliasxxx #1{\aliasyyy#1\relax} 7104\def\aliasxxx #1{\aliasyyy#1\relax}
7691\def\aliasyyy #1=#2\relax{% 7105\def\aliasyyy #1=#2\relax{%
@@ -7706,8 +7120,7 @@ end
7706 7120
7707% @inforef is relatively simple. 7121% @inforef is relatively simple.
7708\def\inforef #1{\inforefzzz #1,,,,**} 7122\def\inforef #1{\inforefzzz #1,,,,**}
7709\def\inforefzzz #1,#2,#3,#4**{% 7123\def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
7710 \putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}},
7711 node \samp{\ignorespaces#1{}}} 7124 node \samp{\ignorespaces#1{}}}
7712 7125
7713% @node's only job in TeX is to define \lastnode, which is used in 7126% @node's only job in TeX is to define \lastnode, which is used in
@@ -7768,32 +7181,11 @@ end
7768 \toks0 = \expandafter{\lastsection}% 7181 \toks0 = \expandafter{\lastsection}%
7769 \immediate \writexrdef{title}{\the\toks0 }% 7182 \immediate \writexrdef{title}{\the\toks0 }%
7770 \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc. 7183 \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc.
7771 \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, at \shipout 7184 \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, during \shipout
7772 }% 7185 }%
7773 \fi 7186 \fi
7774} 7187}
7775 7188
7776% @xrefautosectiontitle on|off says whether @section(ing) names are used
7777% automatically in xrefs, if the third arg is not explicitly specified.
7778% This was provided as a "secret" @set xref-automatic-section-title
7779% variable, now it's official.
7780%
7781\parseargdef\xrefautomaticsectiontitle{%
7782 \def\temp{#1}%
7783 \ifx\temp\onword
7784 \expandafter\let\csname SETxref-automatic-section-title\endcsname
7785 = \empty
7786 \else\ifx\temp\offword
7787 \expandafter\let\csname SETxref-automatic-section-title\endcsname
7788 = \relax
7789 \else
7790 \errhelp = \EMsimple
7791 \errmessage{Unknown @xrefautomaticsectiontitle value `\temp',
7792 must be on|off}%
7793 \fi\fi
7794}
7795
7796
7797% @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is 7189% @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is
7798% the node name, #2 the name of the Info cross-reference, #3 the printed 7190% the node name, #2 the name of the Info cross-reference, #3 the printed
7799% node name, #4 the name of the Info file, #5 the name of the printed 7191% node name, #4 the name of the Info file, #5 the name of the printed
@@ -7810,7 +7202,7 @@ end
7810 \setbox0=\hbox{\printedrefname\unskip}% 7202 \setbox0=\hbox{\printedrefname\unskip}%
7811 \ifdim \wd0 = 0pt 7203 \ifdim \wd0 = 0pt
7812 % No printed node name was explicitly given. 7204 % No printed node name was explicitly given.
7813 \expandafter\ifx\csname SETxref-automatic-section-title\endcsname \relax 7205 \expandafter\ifx\csname SETxref-automatic-section-title\endcsname\relax
7814 % Use the node name inside the square brackets. 7206 % Use the node name inside the square brackets.
7815 \def\printedrefname{\ignorespaces #1}% 7207 \def\printedrefname{\ignorespaces #1}%
7816 \else 7208 \else
@@ -7839,8 +7231,9 @@ end
7839 % etc. don't get their TeX definitions. 7231 % etc. don't get their TeX definitions.
7840 \getfilename{#4}% 7232 \getfilename{#4}%
7841 % 7233 %
7842 \edef\pdfxrefdest{#1}% 7234 % See comments at \activebackslashdouble.
7843 \txiescapepdf\pdfxrefdest 7235 {\activebackslashdouble \xdef\pdfxrefdest{#1}%
7236 \backslashparens\pdfxrefdest}%
7844 % 7237 %
7845 \leavevmode 7238 \leavevmode
7846 \startlink attr{/Border [0 0 0]}% 7239 \startlink attr{/Border [0 0 0]}%
@@ -7964,8 +7357,7 @@ end
7964 \angleleft un\-de\-fined\angleright 7357 \angleleft un\-de\-fined\angleright
7965 \iflinks 7358 \iflinks
7966 \ifhavexrefs 7359 \ifhavexrefs
7967 {\toks0 = {#1}% avoid expansion of possibly-complex value 7360 \message{\linenumber Undefined cross reference `#1'.}%
7968 \message{\linenumber Undefined cross reference `\the\toks0'.}}%
7969 \else 7361 \else
7970 \ifwarnedxrefs\else 7362 \ifwarnedxrefs\else
7971 \global\warnedxrefstrue 7363 \global\warnedxrefstrue
@@ -8129,7 +7521,7 @@ end
8129% space to prevent strange expansion errors.) 7521% space to prevent strange expansion errors.)
8130\def\supereject{\par\penalty -20000\footnoteno =0 } 7522\def\supereject{\par\penalty -20000\footnoteno =0 }
8131 7523
8132% @footnotestyle is meaningful for Info output only. 7524% @footnotestyle is meaningful for info output only.
8133\let\footnotestyle=\comment 7525\let\footnotestyle=\comment
8134 7526
8135{\catcode `\@=11 7527{\catcode `\@=11
@@ -8192,8 +7584,6 @@ end
8192 % expands into a box, it must come within the paragraph, lest it 7584 % expands into a box, it must come within the paragraph, lest it
8193 % provide a place where TeX can split the footnote. 7585 % provide a place where TeX can split the footnote.
8194 \footstrut 7586 \footstrut
8195 %
8196 % Invoke rest of plain TeX footnote routine.
8197 \futurelet\next\fo@t 7587 \futurelet\next\fo@t
8198} 7588}
8199}%end \catcode `\@=11 7589}%end \catcode `\@=11
@@ -8281,7 +7671,7 @@ end
8281 it from ftp://tug.org/tex/epsf.tex.} 7671 it from ftp://tug.org/tex/epsf.tex.}
8282% 7672%
8283\def\image#1{% 7673\def\image#1{%
8284 \ifx\epsfbox\thisiundefined 7674 \ifx\epsfbox\undefined
8285 \ifwarnednoepsf \else 7675 \ifwarnednoepsf \else
8286 \errhelp = \noepsfhelp 7676 \errhelp = \noepsfhelp
8287 \errmessage{epsf.tex not found, images will be ignored}% 7677 \errmessage{epsf.tex not found, images will be ignored}%
@@ -8297,7 +7687,7 @@ end
8297% #2 is (optional) width, #3 is (optional) height. 7687% #2 is (optional) width, #3 is (optional) height.
8298% #4 is (ignored optional) html alt text. 7688% #4 is (ignored optional) html alt text.
8299% #5 is (ignored optional) extension. 7689% #5 is (ignored optional) extension.
8300% #6 is just the usual extra ignored arg for parsing stuff. 7690% #6 is just the usual extra ignored arg for parsing this stuff.
8301\newif\ifimagevmode 7691\newif\ifimagevmode
8302\def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup 7692\def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup
8303 \catcode`\^^M = 5 % in case we're inside an example 7693 \catcode`\^^M = 5 % in case we're inside an example
@@ -8746,7 +8136,7 @@ directory should work if nowhere else does.}
8746% 8136%
8747% Latin1 (ISO-8859-1) character definitions. 8137% Latin1 (ISO-8859-1) character definitions.
8748\def\latonechardefs{% 8138\def\latonechardefs{%
8749 \gdef^^a0{\tie} 8139 \gdef^^a0{~}
8750 \gdef^^a1{\exclamdown} 8140 \gdef^^a1{\exclamdown}
8751 \gdef^^a2{\missingcharmsg{CENT SIGN}} 8141 \gdef^^a2{\missingcharmsg{CENT SIGN}}
8752 \gdef^^a3{{\pounds}} 8142 \gdef^^a3{{\pounds}}
@@ -8776,7 +8166,7 @@ directory should work if nowhere else does.}
8776 \gdef^^b9{$^1$} 8166 \gdef^^b9{$^1$}
8777 \gdef^^ba{\ordm} 8167 \gdef^^ba{\ordm}
8778 % 8168 %
8779 \gdef^^bb{\guillemetright} 8169 \gdef^^bb{\guilletright}
8780 \gdef^^bc{$1\over4$} 8170 \gdef^^bc{$1\over4$}
8781 \gdef^^bd{$1\over2$} 8171 \gdef^^bd{$1\over2$}
8782 \gdef^^be{$3\over4$} 8172 \gdef^^be{$3\over4$}
@@ -8868,7 +8258,7 @@ directory should work if nowhere else does.}
8868 8258
8869% Latin2 (ISO-8859-2) character definitions. 8259% Latin2 (ISO-8859-2) character definitions.
8870\def\lattwochardefs{% 8260\def\lattwochardefs{%
8871 \gdef^^a0{\tie} 8261 \gdef^^a0{~}
8872 \gdef^^a1{\ogonek{A}} 8262 \gdef^^a1{\ogonek{A}}
8873 \gdef^^a2{\u{}} 8263 \gdef^^a2{\u{}}
8874 \gdef^^a3{\L} 8264 \gdef^^a3{\L}
@@ -8949,8 +8339,8 @@ directory should work if nowhere else does.}
8949 \gdef^^ea{\ogonek{e}} 8339 \gdef^^ea{\ogonek{e}}
8950 \gdef^^eb{\"e} 8340 \gdef^^eb{\"e}
8951 \gdef^^ec{\v e} 8341 \gdef^^ec{\v e}
8952 \gdef^^ed{\'{\dotless{i}}} 8342 \gdef^^ed{\'\i}
8953 \gdef^^ee{\^{\dotless{i}}} 8343 \gdef^^ee{\^\i}
8954 \gdef^^ef{\v d} 8344 \gdef^^ef{\v d}
8955 % 8345 %
8956 \gdef^^f0{\dh} 8346 \gdef^^f0{\dh}
@@ -9041,7 +8431,7 @@ directory should work if nowhere else does.}
9041 8431
9042 \gdef\DeclareUnicodeCharacter#1#2{% 8432 \gdef\DeclareUnicodeCharacter#1#2{%
9043 \countUTFz = "#1\relax 8433 \countUTFz = "#1\relax
9044 %\wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}% 8434 \wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}%
9045 \begingroup 8435 \begingroup
9046 \parseXMLCharref 8436 \parseXMLCharref
9047 \def\UTFviiiTwoOctets##1##2{% 8437 \def\UTFviiiTwoOctets##1##2{%
@@ -9509,8 +8899,8 @@ directory should work if nowhere else does.}
9509% Prevent underfull vbox error messages. 8899% Prevent underfull vbox error messages.
9510\vbadness = 10000 8900\vbadness = 10000
9511 8901
9512% Don't be very finicky about underfull hboxes, either. 8902% Don't be so finicky about underfull hboxes, either.
9513\hbadness = 6666 8903\hbadness = 2000
9514 8904
9515% Following George Bush, get rid of widows and orphans. 8905% Following George Bush, get rid of widows and orphans.
9516\widowpenalty=10000 8906\widowpenalty=10000
@@ -9717,21 +9107,28 @@ directory should work if nowhere else does.}
9717 9107
9718\message{and turning on texinfo input format.} 9108\message{and turning on texinfo input format.}
9719 9109
9720\def^^L{\par} % remove \outer, so ^L can appear in an @comment
9721
9722% DEL is a comment character, in case @c does not suffice. 9110% DEL is a comment character, in case @c does not suffice.
9723\catcode`\^^? = 14 9111\catcode`\^^? = 14
9724 9112
9725% Define macros to output various characters with catcode for normal text. 9113% Define macros to output various characters with catcode for normal text.
9726\catcode`\"=\other \def\normaldoublequote{"} 9114\catcode`\"=\other
9727\catcode`\$=\other \def\normaldollar{$}%$ font-lock fix 9115\catcode`\~=\other
9728\catcode`\+=\other \def\normalplus{+} 9116\catcode`\^=\other
9729\catcode`\<=\other \def\normalless{<} 9117\catcode`\_=\other
9730\catcode`\>=\other \def\normalgreater{>} 9118\catcode`\|=\other
9731\catcode`\^=\other \def\normalcaret{^} 9119\catcode`\<=\other
9732\catcode`\_=\other \def\normalunderscore{_} 9120\catcode`\>=\other
9733\catcode`\|=\other \def\normalverticalbar{|} 9121\catcode`\+=\other
9734\catcode`\~=\other \def\normaltilde{~} 9122\catcode`\$=\other
9123\def\normaldoublequote{"}
9124\def\normaltilde{~}
9125\def\normalcaret{^}
9126\def\normalunderscore{_}
9127\def\normalverticalbar{|}
9128\def\normalless{<}
9129\def\normalgreater{>}
9130\def\normalplus{+}
9131\def\normaldollar{$}%$ font-lock fix
9735 9132
9736% This macro is used to make a character print one way in \tt 9133% This macro is used to make a character print one way in \tt
9737% (where it can probably be output as-is), and another way in other fonts, 9134% (where it can probably be output as-is), and another way in other fonts,
@@ -9809,24 +9206,14 @@ directory should work if nowhere else does.}
9809 9206
9810% In texinfo, backslash is an active character; it prints the backslash 9207% In texinfo, backslash is an active character; it prints the backslash
9811% in fixed width font. 9208% in fixed width font.
9812\catcode`\\=\active % @ for escape char from now on. 9209\catcode`\\=\active
9813 9210@def@normalbackslash{{@tt@backslashcurfont}}
9814% The story here is that in math mode, the \char of \backslashcurfont
9815% ends up printing the roman \ from the math symbol font (because \char
9816% in math mode uses the \mathcode, and plain.tex sets
9817% \mathcode`\\="026E). It seems better for @backslashchar{} to always
9818% print a typewriter backslash, hence we use an explicit \mathchar,
9819% which is the decimal equivalent of "715c (class 7, e.g., use \fam;
9820% ignored family value; char position "5C). We can't use " for the
9821% usual hex value because it has already been made active.
9822@def@normalbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi}}
9823@let@backslashchar = @normalbackslash % @backslashchar{} is for user documents.
9824
9825% On startup, @fixbackslash assigns: 9211% On startup, @fixbackslash assigns:
9826% @let \ = @normalbackslash 9212% @let \ = @normalbackslash
9213
9827% \rawbackslash defines an active \ to do \backslashcurfont. 9214% \rawbackslash defines an active \ to do \backslashcurfont.
9828% \otherbackslash defines an active \ to be a literal `\' character with 9215% \otherbackslash defines an active \ to be a literal `\' character with
9829% catcode other. We switch back and forth between these. 9216% catcode other.
9830@gdef@rawbackslash{@let\=@backslashcurfont} 9217@gdef@rawbackslash{@let\=@backslashcurfont}
9831@gdef@otherbackslash{@let\=@realbackslash} 9218@gdef@otherbackslash{@let\=@realbackslash}
9832 9219
@@ -9834,16 +9221,16 @@ directory should work if nowhere else does.}
9834% the literal character `\'. 9221% the literal character `\'.
9835% 9222%
9836@def@normalturnoffactive{% 9223@def@normalturnoffactive{%
9837 @let"=@normaldoublequote
9838 @let$=@normaldollar %$ font-lock fix
9839 @let+=@normalplus
9840 @let<=@normalless
9841 @let>=@normalgreater
9842 @let\=@normalbackslash 9224 @let\=@normalbackslash
9225 @let"=@normaldoublequote
9226 @let~=@normaltilde
9843 @let^=@normalcaret 9227 @let^=@normalcaret
9844 @let_=@normalunderscore 9228 @let_=@normalunderscore
9845 @let|=@normalverticalbar 9229 @let|=@normalverticalbar
9846 @let~=@normaltilde 9230 @let<=@normalless
9231 @let>=@normalgreater
9232 @let+=@normalplus
9233 @let$=@normaldollar %$ font-lock fix
9847 @markupsetuplqdefault 9234 @markupsetuplqdefault
9848 @markupsetuprqdefault 9235 @markupsetuprqdefault
9849 @unsepspaces 9236 @unsepspaces
@@ -9875,19 +9262,10 @@ directory should work if nowhere else does.}
9875% Say @foo, not \foo, in error messages. 9262% Say @foo, not \foo, in error messages.
9876@escapechar = `@@ 9263@escapechar = `@@
9877 9264
9878% These (along with & and #) are made active for url-breaking, so need
9879% active definitions as the normal characters.
9880@def@normaldot{.}
9881@def@normalquest{?}
9882@def@normalslash{/}
9883
9884% These look ok in all fonts, so just make them not special. 9265% These look ok in all fonts, so just make them not special.
9885% @hashchar{} gets its own user-level command, because of #line. 9266@catcode`@& = @other
9886@catcode`@& = @other @def@normalamp{&} 9267@catcode`@# = @other
9887@catcode`@# = @other @def@normalhash{#} 9268@catcode`@% = @other
9888@catcode`@% = @other @def@normalpercent{%}
9889
9890@let @hashchar = @normalhash
9891 9269
9892@c Finally, make ` and ' active, so that txicodequoteundirected and 9270@c Finally, make ` and ' active, so that txicodequoteundirected and
9893@c txicodequotebacktick work right in, e.g., @w{@code{`foo'}}. If we 9271@c txicodequotebacktick work right in, e.g., @w{@code{`foo'}}. If we