~ubuntu-branches/ubuntu/saucy/autoconf/saucy-proposed

« back to all changes in this revision

Viewing changes to build-aux/texinfo.tex

  • Committer: Bazaar Package Importer
  • Author(s): Ben Pfaff
  • Date: 2010-08-02 13:04:28 UTC
  • mfrom: (1.1.10 upstream)
  • Revision ID: james.westby@ubuntu.com-20100802130428-ywor783c4eglymoq
Tags: 2.67-1
New upstream release.  Closes: #589958.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
% Load plain if necessary, i.e., if running under initex.
4
4
\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
5
5
%
6
 
\def\texinfoversion{2009-08-14.15}
 
6
\def\texinfoversion{2010-06-17.11}
7
7
%
8
8
% Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
9
9
% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
10
 
% 2007, 2008, 2009 Free Software Foundation, Inc.
 
10
% 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
11
11
%
12
12
% This texinfo.tex file is free software: you can redistribute it and/or
13
13
% modify it under the terms of the GNU General Public License as
65
65
\everyjob{\message{[Texinfo version \texinfoversion]}%
66
66
  \catcode`+=\active \catcode`\_=\active}
67
67
 
68
 
 
69
68
\chardef\other=12
70
69
 
71
70
% We never want plain's \outer definition of \+ in Texinfo.
93
92
\let\ptexnewwrite\newwrite
94
93
\let\ptexnoindent=\noindent
95
94
\let\ptexplus=+
 
95
\let\ptexraggedright=\raggedright
96
96
\let\ptexrbrace=\}
97
97
\let\ptexslash=\/
98
98
\let\ptexstar=\*
99
99
\let\ptext=\t
100
100
\let\ptextop=\top
101
 
{\catcode`\'=\active
102
 
\global\let\ptexquoteright'}% Math-mode def from plain.tex.
103
 
\let\ptexraggedright=\raggedright
 
101
{\catcode`\'=\active \global\let\ptexquoteright'}% active in plain's math mode
104
102
 
105
103
% If this character appears in an error message or help string, it
106
104
% starts a new line in the output.
199
197
% that mark overfull boxes (in case you have decided
200
198
% that the text looks ok even though it passes the margin).
201
199
%
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
 
}
 
200
\def\finalout{\overfullrule=0pt }
232
201
 
233
202
% Sometimes it is convenient to have everything in the transcript file
234
203
% and nothing on the terminal.  We don't just call \tracingall here,
267
236
\def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount
268
237
  \removelastskip\penalty-200\bigskip\fi\fi}
269
238
 
270
 
% For @cropmarks command.
271
239
% Do @cropmarks to get crop marks.
272
240
%
273
241
\newif\ifcropmarks
599
567
\newhelp\EMsimple{Press RETURN to continue.}
600
568
 
601
569
 
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
 
 
681
570
% Be sure we're in horizontal mode when doing a tie, since we make space
682
571
% equivalent to this in @example-like environments. Otherwise, a space
683
572
% at the beginning of a line will start with \penalty -- and
873
762
 
874
763
% @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current
875
764
% paragraph.  For more general purposes, use the \margin insertion
876
 
% class.  WHICH is `l' or `r'.
 
765
% class.  WHICH is `l' or `r'.  Not documented, written for gawk manual.
877
766
%
878
767
\newskip\inmarginspacing \inmarginspacing=1cm
879
768
\def\strutdepth{\dp\strutbox}
920
809
  \temp
921
810
}
922
811
 
 
812
% @| inserts a changebar to the left of the current line.  It should
 
813
% surround any changed text.  This approach does *not* work if the
 
814
% change spans more than two lines of output.  To handle that, we would
 
815
% have adopt a much more difficult approach (putting marks into the main
 
816
% vertical list for the beginning and end of each change).  This command
 
817
% is not documented, not supported, and doesn't work.
 
818
%
 
819
\def\|{%
 
820
  % \vadjust can only be used in horizontal mode.
 
821
  \leavevmode
 
822
  %
 
823
  % Append this vertical mode material after the current line in the output.
 
824
  \vadjust{%
 
825
    % We want to insert a rule with the height and depth of the current
 
826
    % leading; that is exactly what \strutbox is supposed to record.
 
827
    \vskip-\baselineskip
 
828
    %
 
829
    % \vadjust-items are inserted at the left edge of the type.  So
 
830
    % the \llap here moves out into the left-hand margin.
 
831
    \llap{%
 
832
      %
 
833
      % For a thicker or thinner bar, change the `1pt'.
 
834
      \vrule height\baselineskip width1pt
 
835
      %
 
836
      % This is the space between the bar and the text.
 
837
      \hskip 12pt
 
838
    }%
 
839
  }%
 
840
}
 
841
 
923
842
% @include FILE -- \input text of FILE.
924
843
%
925
844
\def\include{\parseargusing\filenamecatcodes\includezzz}
1095
1014
}
1096
1015
 
1097
1016
 
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
 
 
1201
1017
% @refill is a no-op.
1202
1018
\let\refill=\relax
1203
1019
 
1492
1308
      \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace
1493
1309
      %
1494
1310
      % Read toc silently, to get counts of subentries for \pdfoutline.
 
1311
      \def\partentry##1##2##3##4{}% ignore parts in the outlines
1495
1312
      \def\numchapentry##1##2##3##4{%
1496
1313
        \def\thischapnum{##2}%
1497
1314
        \def\thissecnum{0}%
2105
1922
\font\reducedsy=cmsy10
2106
1923
\def\reducedecsize{1000}
2107
1924
 
2108
 
% reset the current fonts
2109
 
\textfonts
 
1925
\textleading = 13.2pt % line spacing for 11pt CM
 
1926
\textfonts            % reset the current fonts
2110
1927
\rm
2111
1928
} % end of 11pt text font size definitions
2112
1929
 
2236
2053
\font\reducedsy=cmsy9
2237
2054
\def\reducedecsize{0900}
2238
2055
 
2239
 
% reduce space between paragraphs
2240
 
\divide\parskip by 2
2241
 
 
2242
 
% reset the current fonts
2243
 
\textfonts
 
2056
\divide\parskip by 2  % reduce space between paragraphs
 
2057
\textleading = 12pt   % line spacing for 10pt CM
 
2058
\textfonts            % reset the current fonts
2244
2059
\rm
2245
2060
} % end of 10pt text font size definitions
2246
2061
 
2249
2064
%   @fonttextsize 10
2250
2065
% (or 11) to redefine the text font size.  pt is assumed.
2251
2066
%
 
2067
\def\xiword{11}
2252
2068
\def\xword{10}
2253
 
\def\xiword{11}
 
2069
\def\xwordpt{10pt}
2254
2070
%
2255
2071
\parseargdef\fonttextsize{%
2256
2072
  \def\textsizearg{#1}%
2308
2124
  \let\tenttsl=\titlettsl
2309
2125
  \def\curfontsize{title}%
2310
2126
  \def\lsize{chap}\def\lllsize{subsec}%
2311
 
  \resetmathfonts \setleading{25pt}}
 
2127
  \resetmathfonts \setleading{27pt}}
2312
2128
\def\titlefont#1{{\titlefonts\rmisbold #1}}
2313
2129
\def\chapfonts{%
2314
2130
  \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
2460
2276
 
2461
2277
\let\markupsetuplqcode \markupsetcodequoteleft
2462
2278
\let\markupsetuprqcode \markupsetcodequoteright
 
2279
%
2463
2280
\let\markupsetuplqexample \markupsetcodequoteleft
2464
2281
\let\markupsetuprqexample \markupsetcodequoteright
 
2282
%
 
2283
\let\markupsetuplqsamp \markupsetcodequoteleft
 
2284
\let\markupsetuprqsamp \markupsetcodequoteright
 
2285
%
2465
2286
\let\markupsetuplqverb \markupsetcodequoteleft
2466
2287
\let\markupsetuprqverb \markupsetcodequoteright
 
2288
%
2467
2289
\let\markupsetuplqverbatim \markupsetcodequoteleft
2468
2290
\let\markupsetuprqverbatim \markupsetcodequoteright
2469
2291
 
2470
 
\let\markupsetuplqsamp \markupsetnoligaturesquoteleft
2471
2292
\let\markupsetuplqkbd \markupsetnoligaturesquoteleft
2472
2293
 
2473
2294
% Allow an option to not replace quotes with a regular directed right
2505
2326
% Count depth in font-changes, for error checks
2506
2327
\newcount\fontdepth \fontdepth=0
2507
2328
 
2508
 
%% Add scribe-like font environments, plus @l for inline lisp (usually sans
2509
 
%% serif) and @ii for TeX italic
2510
 
 
2511
 
% \smartitalic{ARG} outputs arg in italics, followed by an italic correction
2512
 
% unless the following character is such as not to need one.
2513
 
\def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else
2514
 
                    \ptexslash\fi\fi\fi}
2515
 
\def\smartslanted#1{{\ifusingtt\ttsl\sl #1}\futurelet\next\smartitalicx}
2516
 
\def\smartitalic#1{{\ifusingtt\ttsl\it #1}\futurelet\next\smartitalicx}
2517
 
 
2518
 
% like \smartslanted except unconditionally uses \ttsl.
 
2329
% Font commands.
 
2330
 
 
2331
% #1 is the font command (\sl or \it), #2 is the text to slant.
 
2332
% If we are in a monospaced environment, however, 1) always use \ttsl,
 
2333
% and 2) do not add an italic correction.
 
2334
\def\dosmartslant#1#2{%
 
2335
  \ifusingtt 
 
2336
    {\ttsl #2\let\next=\relax}%
 
2337
    {\def\next{{#1#2}\futurelet\next\smartitaliccorrection}}%
 
2338
  \next
 
2339
}
 
2340
\def\smartslanted{\dosmartslant\sl}
 
2341
\def\smartitalic{\dosmartslant\it}
 
2342
 
 
2343
% Output an italic correction unless \next (presumed to be the following
 
2344
% character) is such as not to need one.
 
2345
\def\smartitaliccorrection{%
 
2346
  \ifx\next,%
 
2347
  \else\ifx\next-%
 
2348
  \else\ifx\next.%
 
2349
  \else\ptexslash
 
2350
  \fi\fi\fi}
 
2351
 
 
2352
% like \smartslanted except unconditionally uses \ttsl, and no ic.
2519
2353
% @var is set to this for defun arguments.
2520
 
\def\ttslanted#1{{\ttsl #1}\futurelet\next\smartitalicx}
 
2354
\def\ttslanted#1{{\ttsl #1}}
2521
2355
 
2522
2356
% @cite is like \smartslanted except unconditionally use \sl.  We never want
2523
2357
% ttsl for book titles, do we?
2524
 
\def\cite#1{{\sl #1}\futurelet\next\smartitalicx}
 
2358
\def\cite#1{{\sl #1}\futurelet\next\smartitaliccorrection}
2525
2359
 
2526
2360
\let\i=\smartitalic
2527
2361
\let\slanted=\smartslanted
2528
 
\def\var#1{{\setupmarkupstyle{var}\smartslanted{#1}}}
 
2362
\def\var#1{\smartslanted{#1}}
2529
2363
\let\dfn=\smartslanted
2530
2364
\let\emph=\smartitalic
2531
2365
 
2819
2653
  \fi
2820
2654
}
2821
2655
 
 
2656
% @asis just yields its argument.  Used with @table, for example.
 
2657
%
 
2658
\def\asis#1{#1}
 
2659
 
 
2660
% @math outputs its argument in math mode.
 
2661
%
 
2662
% One complication: _ usually means subscripts, but it could also mean
 
2663
% an actual _ character, as in @math{@var{some_variable} + 1}.  So make
 
2664
% _ active, and distinguish by seeing if the current family is \slfam,
 
2665
% which is what @var uses.
 
2666
{
 
2667
  \catcode`\_ = \active
 
2668
  \gdef\mathunderscore{%
 
2669
    \catcode`\_=\active
 
2670
    \def_{\ifnum\fam=\slfam \_\else\sb\fi}%
 
2671
  }
 
2672
}
 
2673
% Another complication: we want \\ (and @\) to output a math (or tt) \.
 
2674
% FYI, plain.tex uses \\ as a temporary control sequence (for no
 
2675
% particular reason), but this is not advertised and we don't care.
 
2676
%
 
2677
% The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.
 
2678
\def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi}
 
2679
%
 
2680
\def\math{%
 
2681
  \tex
 
2682
  \mathunderscore
 
2683
  \let\\ = \mathbackslash
 
2684
  \mathactive
 
2685
  % make the texinfo accent commands work in math mode
 
2686
  \let\"=\ddot
 
2687
  \let\'=\acute
 
2688
  \let\==\bar
 
2689
  \let\^=\hat
 
2690
  \let\`=\grave
 
2691
  \let\u=\breve
 
2692
  \let\v=\check
 
2693
  \let\~=\tilde
 
2694
  \let\dotaccent=\dot
 
2695
  $\finishmath
 
2696
}
 
2697
\def\finishmath#1{#1$\endgroup}  % Close the group opened by \tex.
 
2698
 
 
2699
% Some active characters (such as <) are spaced differently in math.
 
2700
% We have to reset their definitions in case the @math was an argument
 
2701
% to a command which sets the catcodes (such as @item or @section).
 
2702
%
 
2703
{
 
2704
  \catcode`^ = \active
 
2705
  \catcode`< = \active
 
2706
  \catcode`> = \active
 
2707
  \catcode`+ = \active
 
2708
  \catcode`' = \active
 
2709
  \gdef\mathactive{%
 
2710
    \let^ = \ptexhat
 
2711
    \let< = \ptexless
 
2712
    \let> = \ptexgtr
 
2713
    \let+ = \ptexplus
 
2714
    \let' = \ptexquoteright
 
2715
  }
 
2716
}
 
2717
 
2822
2718
 
2823
2719
\message{glyphs,}
 
2720
% and logos.
 
2721
 
 
2722
% @@ prints an @.
 
2723
\def\@{\char64 }
 
2724
 
 
2725
% Used to generate quoted braces.  Unless we're in typewriter, use
 
2726
% \ecfont because the CM text fonts do not have braces, and we don't
 
2727
% want to switch into math.
 
2728
\def\mylbrace{{\ifmonospace\else\ecfont\fi \char123}}
 
2729
\def\myrbrace{{\ifmonospace\else\ecfont\fi \char125}}
 
2730
\let\{=\mylbrace
 
2731
\let\}=\myrbrace
 
2732
\begingroup
 
2733
  % Definitions to produce \{ and \} commands for indices,
 
2734
  % and @{ and @} for the aux/toc files.
 
2735
  \catcode`\{ = \other \catcode`\} = \other
 
2736
  \catcode`\[ = 1 \catcode`\] = 2
 
2737
  \catcode`\! = 0 \catcode`\\ = \other
 
2738
  !gdef!lbracecmd[\{]%
 
2739
  !gdef!rbracecmd[\}]%
 
2740
  !gdef!lbraceatcmd[@{]%
 
2741
  !gdef!rbraceatcmd[@}]%
 
2742
!endgroup
 
2743
 
 
2744
% @comma{} to avoid , parsing problems.
 
2745
\let\comma = ,
 
2746
 
 
2747
% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
 
2748
% Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H.
 
2749
\let\, = \ptexc
 
2750
\let\dotaccent = \ptexdot
 
2751
\def\ringaccent#1{{\accent23 #1}}
 
2752
\let\tieaccent = \ptext
 
2753
\let\ubaraccent = \ptexb
 
2754
\let\udotaccent = \d
 
2755
 
 
2756
% Other special characters: @questiondown @exclamdown @ordf @ordm
 
2757
% Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
 
2758
\def\questiondown{?`}
 
2759
\def\exclamdown{!`}
 
2760
\def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}}
 
2761
\def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}}
 
2762
 
 
2763
% Dotless i and dotless j, used for accents.
 
2764
\def\imacro{i}
 
2765
\def\jmacro{j}
 
2766
\def\dotless#1{%
 
2767
  \def\temp{#1}%
 
2768
  \ifx\temp\imacro \ifmmode\imath \else\ptexi \fi
 
2769
  \else\ifx\temp\jmacro \ifmmode\jmath \else\j \fi
 
2770
  \else \errmessage{@dotless can be used only with i or j}%
 
2771
  \fi\fi
 
2772
}
 
2773
 
 
2774
% The \TeX{} logo, as in plain, but resetting the spacing so that a
 
2775
% period following counts as ending a sentence.  (Idea found in latex.)
 
2776
%
 
2777
\edef\TeX{\TeX \spacefactor=1000 }
 
2778
 
 
2779
% @LaTeX{} logo.  Not quite the same results as the definition in
 
2780
% latex.ltx, since we use a different font for the raised A; it's most
 
2781
% convenient for us to use an explicitly smaller font, rather than using
 
2782
% the \scriptstyle font (since we don't reset \scriptstyle and
 
2783
% \scriptscriptstyle).
 
2784
%
 
2785
\def\LaTeX{%
 
2786
  L\kern-.36em
 
2787
  {\setbox0=\hbox{T}%
 
2788
   \vbox to \ht0{\hbox{%
 
2789
     \ifx\textnominalsize\xwordpt
 
2790
       % for 10pt running text, \lllsize (8pt) is too small for the A in LaTeX.
 
2791
       % Revert to plain's \scriptsize, which is 7pt.
 
2792
       \count255=\the\fam $\fam\count255 \scriptstyle A$%
 
2793
     \else
 
2794
       % For 11pt, we can use our lllsize.
 
2795
       \selectfonts\lllsize A%
 
2796
     \fi
 
2797
     }%
 
2798
     \vss
 
2799
  }}%
 
2800
  \kern-.15em
 
2801
  \TeX
 
2802
}
 
2803
 
 
2804
% Some math mode symbols.
 
2805
\def\bullet{$\ptexbullet$}
 
2806
\def\geq{\ifmmode \ge\else $\ge$\fi}
 
2807
\def\leq{\ifmmode \le\else $\le$\fi}
 
2808
\def\minus{\ifmmode -\else $-$\fi}
 
2809
 
 
2810
% @dots{} outputs an ellipsis using the current font.
 
2811
% We do .5em per period so that it has the same spacing in the cm
 
2812
% typewriter fonts as three actual period characters; on the other hand,
 
2813
% in other typewriter fonts three periods are wider than 1.5em.  So do
 
2814
% whichever is larger.
 
2815
%
 
2816
\def\dots{%
 
2817
  \leavevmode
 
2818
  \setbox0=\hbox{...}% get width of three periods
 
2819
  \ifdim\wd0 > 1.5em
 
2820
    \dimen0 = \wd0
 
2821
  \else
 
2822
    \dimen0 = 1.5em
 
2823
  \fi
 
2824
  \hbox to \dimen0{%
 
2825
    \hskip 0pt plus.25fil
 
2826
    .\hskip 0pt plus1fil
 
2827
    .\hskip 0pt plus1fil
 
2828
    .\hskip 0pt plus.5fil
 
2829
  }%
 
2830
}
 
2831
 
 
2832
% @enddots{} is an end-of-sentence ellipsis.
 
2833
%
 
2834
\def\enddots{%
 
2835
  \dots
 
2836
  \spacefactor=\endofsentencespacefactor
 
2837
}
2824
2838
 
2825
2839
% @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
2826
2840
%
3207
3221
 
3208
3222
\def\headings #1 {\csname HEADINGS#1\endcsname}
3209
3223
 
3210
 
\def\HEADINGSoff{%
3211
 
\global\evenheadline={\hfil} \global\evenfootline={\hfil}
3212
 
\global\oddheadline={\hfil} \global\oddfootline={\hfil}}
3213
 
\HEADINGSoff
 
3224
\def\headingsoff{% non-global headings elimination
 
3225
  \evenheadline={\hfil}\evenfootline={\hfil}%
 
3226
   \oddheadline={\hfil}\oddfootline={\hfil}%
 
3227
}
 
3228
 
 
3229
\def\HEADINGSoff{{\globaldefs=1 \headingsoff}} % global setting
 
3230
\HEADINGSoff  % it's the default
 
3231
 
3214
3232
% When we turn headings on, set the page number to 1.
3215
3233
% For double-sided printing, put current file name in lower left corner,
3216
3234
% chapter name on inside top of right hand pages, document
3322
3340
    \begingroup
3323
3341
      \advance\leftskip by-\tableindent
3324
3342
      \advance\hsize by\tableindent
3325
 
      \advance\rightskip by0pt plus1fil
 
3343
      \advance\rightskip by0pt plus1fil\relax
3326
3344
      \leavevmode\unhbox0\par
3327
3345
    \endgroup
3328
3346
    %
4134
4152
  \def\@{@}% change to @@ when we switch to @ as escape char in index files.
4135
4153
  \def\ {\realbackslash\space }%
4136
4154
  %
4137
 
  % Need these in case \tex is in effect and \{ is a \delimiter again.
4138
 
  % But can't use \lbracecmd and \rbracecmd because texindex assumes
4139
 
  % braces and backslashes are used only as delimiters.
4140
 
  \let\{ = \mylbrace
4141
 
  \let\} = \myrbrace
 
4155
  % Need these unexpandable (because we define \tt as a dummy)
 
4156
  % definitions when @{ or @} appear in index entry text.  Also, more
 
4157
  % complicated, when \tex is in effect and \{ is a \delimiter again.
 
4158
  % We can't use \lbracecmd and \rbracecmd because texindex assumes
 
4159
  % braces and backslashes are used only as delimiters.  Perhaps we
 
4160
  % should define @lbrace and @rbrace commands a la @comma.
 
4161
  \def\{{{\tt\char123}}%
 
4162
  \def\}{{\tt\char125}}%
4142
4163
  %
4143
4164
  % I don't entirely understand this, but when an index entry is
4144
4165
  % generated from a macro call, the \endinput which \scanmacro inserts
4252
4273
  \definedummyword\registeredsymbol
4253
4274
  \definedummyword\dots
4254
4275
  \definedummyword\enddots
 
4276
  \definedummyword\entrybreak
4255
4277
  \definedummyword\equiv
4256
4278
  \definedummyword\error
4257
4279
  \definedummyword\euro
4424
4446
  \def\result{=>}%
4425
4447
  \def\textdegree{o}%
4426
4448
  %
 
4449
  \expandafter\ifx\csname SETtxiindexlquoteignore\endcsname\relax
 
4450
  \else \indexlquoteignore \fi
 
4451
  %
4427
4452
  % We need to get rid of all macros, leaving only the arguments (if present).
4428
4453
  % Of course this is not nearly correct, but it is the best we can do for now.
4429
4454
  % makeinfo does not expand macros in the argument to @deffn, which ends up
4437
4462
  \macrolist
4438
4463
}
4439
4464
 
 
4465
% Undocumented (for FSFS 2nd ed.): @set txiindexlquoteignore makes us
 
4466
% ignore left quotes in the sort term.
 
4467
{\catcode`\`=\active
 
4468
 \gdef\indexlquoteignore{\let`=\empty}}
 
4469
 
4440
4470
\let\indexbackslash=0  %overridden during \printindex.
4441
4471
\let\SETmarginindex=\relax % put index entries in margin (undocumented)?
4442
4472
 
4694
4724
% But this freezes the catcodes in the argument, and can cause problems to
4695
4725
% @code, which sets - active.  This problem was fixed by a kludge---
4696
4726
% ``-'' was active throughout whole index, but this isn't really right.
4697
 
%
4698
4727
% The right solution is to prevent \entry from swallowing the whole text.
4699
4728
%                                 --kasal, 21nov03
4700
4729
\def\entry{%
4731
4760
    % columns.
4732
4761
    \vskip 0pt plus1pt
4733
4762
    %
 
4763
    % When reading the text of entry, convert explicit line breaks
 
4764
    % from @* into spaces.  The user might give these in long section
 
4765
    % titles, for instance.
 
4766
    \def\*{\unskip\space\ignorespaces}%
 
4767
    \def\entrybreak{\hfil\break}%
 
4768
    %
4734
4769
    % Swallow the left brace of the text (first parameter):
4735
4770
    \afterassignment\doentry
4736
4771
    \let\temp =
4737
4772
}
 
4773
\def\entrybreak{\unskip\space\ignorespaces}%
4738
4774
\def\doentry{%
4739
4775
    \bgroup % Instead of the swallowed brace.
4740
4776
      \noindent
4967
5003
\message{sectioning,}
4968
5004
% Chapters, sections, etc.
4969
5005
 
4970
 
% \unnumberedno is an oxymoron, of course.  But we count the unnumbered
 
5006
% Let's start with @part.
 
5007
\outer\parseargdef\part{\partzzz{#1}}
 
5008
\def\partzzz#1{%
 
5009
  \chapoddpage
 
5010
  \null
 
5011
  \vskip.3\vsize  % move it down on the page a bit
 
5012
  \begingroup
 
5013
    \noindent \titlefonts\rmisbold #1\par % the text
 
5014
    \let\lastnode=\empty      % no node to associate with
 
5015
    \writetocentry{part}{#1}{}% but put it in the toc
 
5016
    \headingsoff              % no headline or footline on the part page
 
5017
    \chapoddpage
 
5018
  \endgroup
 
5019
}
 
5020
 
 
5021
% \unnumberedno is an oxymoron.  But we count the unnumbered
4971
5022
% sections so that we can refer to them unambiguously in the pdf
4972
5023
% outlines by their "section number".  We avoid collisions with chapter
4973
5024
% numbers by starting them at 10000.  (If a document ever has 10000
5046
5097
\chardef\maxseclevel = 3
5047
5098
%
5048
5099
% A numbered section within an unnumbered changes to unnumbered too.
5049
 
% To achive this, remember the "biggest" unnum. sec. we are currently in:
5050
 
\chardef\unmlevel = \maxseclevel
 
5100
% To achieve this, remember the "biggest" unnum. sec. we are currently in:
 
5101
\chardef\unnlevel = \maxseclevel
5051
5102
%
5052
5103
% Trace whether the current chapter is an appendix or not:
5053
5104
% \chapheadtype is "N" or "A", unnumbered chapters are ignored.
5072
5123
  % The heading type:
5073
5124
  \def\headtype{#1}%
5074
5125
  \if \headtype U%
5075
 
    \ifnum \absseclevel < \unmlevel
5076
 
      \chardef\unmlevel = \absseclevel
 
5126
    \ifnum \absseclevel < \unnlevel
 
5127
      \chardef\unnlevel = \absseclevel
5077
5128
    \fi
5078
5129
  \else
5079
5130
    % Check for appendix sections:
5085
5136
      \fi\fi
5086
5137
    \fi
5087
5138
    % Check for numbered within unnumbered:
5088
 
    \ifnum \absseclevel > \unmlevel
 
5139
    \ifnum \absseclevel > \unnlevel
5089
5140
      \def\headtype{U}%
5090
5141
    \else
5091
 
      \chardef\unmlevel = 3
 
5142
      \chardef\unnlevel = 3
5092
5143
    \fi
5093
5144
  \fi
5094
5145
  % Now print the heading:
5340
5391
  \chappager
5341
5392
  \ifodd\pageno \else
5342
5393
    \begingroup
5343
 
      \evenheadline={\hfil}\evenfootline={\hfil}%
5344
 
      \oddheadline={\hfil}\oddfootline={\hfil}%
5345
 
      \hbox to 0pt{}%
 
5394
      \headingsoff
 
5395
      \null
5346
5396
      \chappager
5347
5397
    \endgroup
5348
5398
  \fi
5785
5835
\def\summarycontents{%
5786
5836
  \startcontents{\putwordShortTOC}%
5787
5837
    %
 
5838
    \let\partentry = \shortpartentry
5788
5839
    \let\numchapentry = \shortchapentry
5789
5840
    \let\appentry = \shortchapentry
5790
5841
    \let\unnchapentry = \shortunnchapentry
5840
5891
% The last argument is the page number.
5841
5892
% The arguments in between are the chapter number, section number, ...
5842
5893
 
 
5894
% Parts, in the main contents.  Replace the part number, which doesn't
 
5895
% exist, with an empty box.  Let's hope all the numbers have the same width.
 
5896
% Also ignore the page number, which is conventionally not printed.
 
5897
\def\numeralbox{\setbox0=\hbox{8}\hbox to \wd0{\hfil}}
 
5898
\def\partentry#1#2#3#4{\dochapentry{\numeralbox\labelspace#1}{}}
 
5899
%
 
5900
% Parts, in the short toc.
 
5901
\def\shortpartentry#1#2#3#4{%
 
5902
  \penalty-300
 
5903
  \vskip.5\baselineskip plus.15\baselineskip minus.1\baselineskip
 
5904
  \shortchapentry{{\bf #1}}{\numeralbox}{}{}%
 
5905
}
 
5906
 
5843
5907
% Chapters, in the main contents.
5844
5908
\def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}}
5845
5909
%
5929
5993
\message{environments,}
5930
5994
% @foo ... @end foo.
5931
5995
 
5932
 
% @tex ... @end tex    escapes into raw Tex temporarily.
 
5996
% @tex ... @end tex    escapes into raw TeX temporarily.
5933
5997
% One exception: @ is still an escape character, so that @end tex works.
5934
 
% But \@ or @@ will get a plain tex @ character.
 
5998
% But \@ or @@ will get a plain @ character.
5935
5999
 
5936
6000
\envdef\tex{%
5937
6001
  \setupmarkupstyle{tex}%
5948
6012
  \catcode`\'=\other
5949
6013
  \escapechar=`\\
5950
6014
  %
 
6015
  % ' is active in math mode (mathcode"8000).  So reset it, and all our
 
6016
  % other math active characters (just in case), to plain's definitions.
 
6017
  \mathactive
 
6018
  %
5951
6019
  \let\b=\ptexb
5952
6020
  \let\bullet=\ptexbullet
5953
6021
  \let\c=\ptexc
6150
6218
}
6151
6219
 
6152
6220
% We often define two environments, @foo and @smallfoo.
6153
 
% Let's do it by one command:
6154
 
\def\makedispenv #1#2{
6155
 
  \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2}
6156
 
  \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2}
 
6221
% Let's do it in one command.  #1 is the env name, #2 the definition.
 
6222
\def\makedispenvdef#1#2{%
 
6223
  \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2}%
 
6224
  \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2}%
6157
6225
  \expandafter\let\csname E#1\endcsname \afterenvbreak
6158
6226
  \expandafter\let\csname Esmall#1\endcsname \afterenvbreak
6159
6227
}
6160
6228
 
6161
 
% Define two synonyms:
6162
 
\def\maketwodispenvs #1#2#3{
6163
 
  \makedispenv{#1}{#3}
6164
 
  \makedispenv{#2}{#3}
 
6229
% Define two environment synonyms (#1 and #2) for an environment.
 
6230
\def\maketwodispenvdef#1#2#3{%
 
6231
  \makedispenvdef{#1}{#3}%
 
6232
  \makedispenvdef{#2}{#3}%
6165
6233
}
6166
 
 
6167
 
% @lisp: indented, narrowed, typewriter font; @example: same as @lisp.
 
6234
%
 
6235
% @lisp: indented, narrowed, typewriter font;
 
6236
% @example: same as @lisp.
6168
6237
%
6169
6238
% @smallexample and @smalllisp: use smaller fonts.
6170
6239
% Originally contributed by Pavel@xerox.
6171
6240
%
6172
 
\maketwodispenvs {lisp}{example}{%
 
6241
\maketwodispenvdef{lisp}{example}{%
6173
6242
  \nonfillstart
6174
6243
  \tt\setupmarkupstyle{example}%
6175
6244
  \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
6176
 
  \gobble       % eat return
 
6245
  \gobble % eat return
6177
6246
}
6178
6247
% @display/@smalldisplay: same as @lisp except keep current font.
6179
6248
%
6180
 
\makedispenv {display}{%
 
6249
\makedispenvdef{display}{%
6181
6250
  \nonfillstart
6182
6251
  \gobble
6183
6252
}
6184
6253
 
6185
6254
% @format/@smallformat: same as @display except don't narrow margins.
6186
6255
%
6187
 
\makedispenv{format}{%
 
6256
\makedispenvdef{format}{%
6188
6257
  \let\nonarrowing = t%
6189
6258
  \nonfillstart
6190
6259
  \gobble
6203
6272
\envdef\flushright{%
6204
6273
  \let\nonarrowing = t%
6205
6274
  \nonfillstart
6206
 
  \advance\leftskip by 0pt plus 1fill
 
6275
  \advance\leftskip by 0pt plus 1fill\relax
6207
6276
  \gobble
6208
6277
}
6209
6278
\let\Eflushright = \afterenvbreak
6238
6307
% we're doing normal filling.  So, when using \aboveenvbreak and
6239
6308
% \afterenvbreak, temporarily make \parskip 0.
6240
6309
%
 
6310
\makedispenvdef{quotation}{\quotationstart}
 
6311
%
6241
6312
\def\quotationstart{%
6242
6313
  {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
6243
6314
  \parindent=0pt
6253
6324
  \parsearg\quotationlabel
6254
6325
}
6255
6326
 
6256
 
\envdef\quotation{%
6257
 
  \setnormaldispenv
6258
 
  \quotationstart
6259
 
}
6260
 
 
6261
 
\envdef\smallquotation{%
6262
 
  \setsmalldispenv
6263
 
  \quotationstart
6264
 
}
6265
 
\let\Esmallquotation = \Equotation
6266
 
 
6267
6327
% We have retained a nonzero parskip for the environment, since we're
6268
6328
% doing normal filling.
6269
6329
%
6275
6335
  \fi
6276
6336
  {\parskip=0pt \afterenvbreak}%
6277
6337
}
 
6338
\def\Esmallquotation{\Equotation}
6278
6339
 
6279
6340
% If we're given an argument, typeset it in bold with a colon after.
6280
6341
\def\quotationlabel#1{%
6331
6392
 
6332
6393
% Setup for the @verbatim environment
6333
6394
%
6334
 
% Real tab expansion
 
6395
% Real tab expansion.
6335
6396
\newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount
6336
6397
%
6337
 
\def\starttabbox{\setbox0=\hbox\bgroup}
 
6398
% We typeset each line of the verbatim in an \hbox, so we can handle
 
6399
% tabs.  The \global is in case the verbatim line starts with an accent,
 
6400
% or some other command that starts with a begin-group.  Otherwise, the
 
6401
% entire \verbbox would disappear at the corresponding end-group, before
 
6402
% it is typeset.  Meanwhile, we can't have nested verbatim commands
 
6403
% (can we?), so the \global won't be overwriting itself.
 
6404
\newbox\verbbox
 
6405
\def\starttabbox{\global\setbox\verbbox=\hbox\bgroup}
6338
6406
%
6339
6407
\begingroup
6340
6408
  \catcode`\^^I=\active
6341
6409
  \gdef\tabexpand{%
6342
6410
    \catcode`\^^I=\active
6343
6411
    \def^^I{\leavevmode\egroup
6344
 
      \dimen0=\wd0 % the width so far, or since the previous tab
6345
 
      \divide\dimen0 by\tabw
6346
 
      \multiply\dimen0 by\tabw % compute previous multiple of \tabw
6347
 
      \advance\dimen0 by\tabw  % advance to next multiple of \tabw
6348
 
      \wd0=\dimen0 \box0 \starttabbox
 
6412
      \dimen\verbbox=\wd\verbbox % the width so far, or since the previous tab
 
6413
      \divide\dimen\verbbox by\tabw
 
6414
      \multiply\dimen\verbbox by\tabw % compute previous multiple of \tabw
 
6415
      \advance\dimen\verbbox by\tabw  % advance to next multiple of \tabw
 
6416
      \wd\verbbox=\dimen\verbbox \box\verbbox \starttabbox
6349
6417
    }%
6350
6418
  }
6351
6419
\endgroup
6354
6422
\def\setupverbatim{%
6355
6423
  \let\nonarrowing = t%
6356
6424
  \nonfillstart
6357
 
  % Easiest (and conventionally used) font for verbatim
6358
 
  \tt
6359
 
  \def\par{\leavevmode\egroup\box0\endgraf}%
 
6425
  \tt % easiest (and conventionally used) font for verbatim
 
6426
  % The \leavevmode here is for blank lines.  Otherwise, we would
 
6427
  % never \starttabox and the \egroup would end verbatim mode.
 
6428
  \def\par{\leavevmode\egroup\box\verbbox\endgraf}%
6360
6429
  \tabexpand
6361
6430
  \setupmarkupstyle{verbatim}%
6362
6431
  % Respect line breaks,
6363
6432
  % print special symbols as themselves, and
6364
 
  % make each space count
6365
 
  % must do in this order:
 
6433
  % make each space count.
 
6434
  % Must do in this order:
6366
6435
  \obeylines \uncatcodespecials \sepspaces
6367
6436
  \everypar{\starttabbox}%
6368
6437
}
6505
6574
    #1#2 \endheader
6506
6575
    % common ending:
6507
6576
    \interlinepenalty = 10000
6508
 
    \advance\rightskip by 0pt plus 1fil
 
6577
    \advance\rightskip by 0pt plus 1fil\relax
6509
6578
    \endgraf
6510
6579
    \nobreak\vskip -\parskip
6511
6580
    \penalty\defunpenalty  % signal to \startdefun and \dodefunx
6877
6946
 
6878
6947
% Macro bodies are absorbed as an argument in a context where
6879
6948
% all characters are catcode 10, 11 or 12, except \ which is active
6880
 
% (as in normal texinfo). It is necessary to change the definition of \.
6881
 
 
 
6949
% (as in normal texinfo). It is necessary to change the definition of \
 
6950
% to recognize macro arguments; this is the job of \mbodybackslash.
 
6951
%
6882
6952
% Non-ASCII encodings make 8-bit characters active, so un-activate
6883
6953
% them to avoid their expansion.  Must do this non-globally, to
6884
6954
% confine the change to the current group.
6885
 
 
 
6955
%
6886
6956
% It's necessary to have hard CRs when the macro is executed. This is
6887
 
% done by  making ^^M (\endlinechar) catcode 12 when reading the macro
 
6957
% done by making ^^M (\endlinechar) catcode 12 when reading the macro
6888
6958
% body, and then making it the \newlinechar in \scanmacro.
6889
 
 
6890
 
\def\scanctxt{%
 
6959
%
 
6960
\def\scanctxt{% used as subroutine
6891
6961
  \catcode`\"=\other
6892
6962
  \catcode`\+=\other
6893
6963
  \catcode`\<=\other
6900
6970
  \ifx\declaredencoding\ascii \else \setnonasciicharscatcodenonglobal\other \fi
6901
6971
}
6902
6972
 
6903
 
\def\scanargctxt{%
 
6973
\def\scanargctxt{% used for copying and captions, not macros.
6904
6974
  \scanctxt
6905
6975
  \catcode`\\=\other
6906
6976
  \catcode`\^^M=\other
6907
6977
}
6908
6978
 
6909
 
\def\macrobodyctxt{%
 
6979
\def\macrobodyctxt{% used for @macro definitions
6910
6980
  \scanctxt
6911
6981
  \catcode`\{=\other
6912
6982
  \catcode`\}=\other
6914
6984
  \usembodybackslash
6915
6985
}
6916
6986
 
6917
 
\def\macroargctxt{%
 
6987
\def\macroargctxt{% used when scanning invocations
6918
6988
  \scanctxt
6919
 
  \catcode`\\=\other
 
6989
  \catcode`\\=0
6920
6990
}
 
6991
% why catcode 0 for \ in the above?  To recognize \\ \{ \} as "escapes"
 
6992
% for the single characters \ { }.  Thus, we end up with the "commands"
 
6993
% that would be written @\ @{ @} in a Texinfo document.
 
6994
 
6995
% We already have @{ and @}.  For @\, we define it here, and only for
 
6996
% this purpose, to produce a typewriter backslash (so, the @\ that we
 
6997
% define for @math can't be used with @macro calls):
 
6998
%
 
6999
\def\\{\normalbackslash}%
 
7000
 
7001
% We would like to do this for \, too, since that is what makeinfo does.
 
7002
% But it is not possible, because Texinfo already has a command @, for a
 
7003
% cedilla accent.  Documents must use @comma{} instead.
 
7004
%
 
7005
% \anythingelse will almost certainly be an error of some kind.
 
7006
 
6921
7007
 
6922
7008
% \mbodybackslash is the definition of \ in @macro bodies.
6923
7009
% It maps \foo\ => \csname macarg.foo\endcsname => #N
6924
7010
% where N is the macro parameter number.
6925
7011
% We define \csname macarg.\endcsname to be \realbackslash, so
6926
7012
% \\ in macro replacement text gets you a backslash.
6927
 
 
 
7013
%
6928
7014
{\catcode`@=0 @catcode`@\=@active
6929
7015
 @gdef@usembodybackslash{@let\=@mbodybackslash}
6930
7016
 @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname}
6931
7017
}
6932
7018
\expandafter\def\csname macarg.\endcsname{\realbackslash}
6933
7019
 
 
7020
\def\margbackslash#1{\char`\#1 }
 
7021
 
6934
7022
\def\macro{\recursivefalse\parsearg\macroxxx}
6935
7023
\def\rmacro{\recursivetrue\parsearg\macroxxx}
6936
7024
 
6937
7025
\def\macroxxx#1{%
6938
 
  \getargs{#1}%           now \macname is the macname and \argl the arglist
 
7026
  \getargs{#1}% now \macname is the macname and \argl the arglist
6939
7027
  \ifx\argl\empty       % no arguments
6940
 
     \paramno=0%
 
7028
     \paramno=0
6941
7029
  \else
6942
7030
     \expandafter\parsemargdef \argl;%
6943
7031
  \fi
6986
7074
% an opening brace, and that opening brace is not consumed.
6987
7075
\def\getargs#1{\getargsxxx#1{}}
6988
7076
\def\getargsxxx#1#{\getmacname #1 \relax\getmacargs}
6989
 
\def\getmacname #1 #2\relax{\macname={#1}}
 
7077
\def\getmacname#1 #2\relax{\macname={#1}}
6990
7078
\def\getmacargs#1{\def\argl{#1}}
6991
7079
 
6992
7080
% Parse the optional {params} list.  Set up \paramno and \paramlist
6993
7081
% so \defmacro knows what to do.  Define \macarg.blah for each blah
6994
 
% in the params list, to be ##N where N is the position in that list.
 
7082
% in the params list to be ##N where N is the position in that list.
6995
7083
% That gets used by \mbodybackslash (above).
6996
 
 
 
7084
%
6997
7085
% We need to get `macro parameter char #' into several definitions.
6998
 
% The technique used is stolen from LaTeX:  let \hash be something
 
7086
% The technique used is stolen from LaTeX: let \hash be something
6999
7087
% unexpandable, insert that wherever you need a #, and then redefine
7000
7088
% it to # just before using the token list produced.
7001
7089
%
7002
7090
% The same technique is used to protect \eatspaces till just before
7003
7091
% the macro is used.
7004
7092
 
7005
 
\def\parsemargdef#1;{\paramno=0\def\paramlist{}%
7006
 
        \let\hash\relax\let\xeatspaces\relax\parsemargdefxxx#1,;,}
 
7093
\def\parsemargdef#1;{%
 
7094
  \paramno=0\def\paramlist{}%
 
7095
  \let\hash\relax
 
7096
  \let\xeatspaces\relax
 
7097
  \parsemargdefxxx#1,;,%
 
7098
}
7007
7099
\def\parsemargdefxxx#1,{%
7008
7100
  \if#1;\let\next=\relax
7009
7101
  \else \let\next=\parsemargdefxxx
7010
 
    \advance\paramno by 1%
 
7102
    \advance\paramno by 1
7011
7103
    \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname
7012
7104
        {\xeatspaces{\hash\the\paramno}}%
7013
7105
    \edef\paramlist{\paramlist\hash\the\paramno,}%
7015
7107
 
7016
7108
% These two commands read recursive and nonrecursive macro bodies.
7017
7109
% (They're different since rec and nonrec macros end differently.)
7018
 
 
 
7110
%
7019
7111
\long\def\parsemacbody#1@end macro%
7020
7112
{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
7021
7113
\long\def\parsermacbody#1@end rmacro%
7026
7118
% Much magic with \expandafter here.
7027
7119
% \xdef is used so that macro definitions will survive the file
7028
7120
% they're defined in; @include reads the file inside a group.
 
7121
%
7029
7122
\def\defmacro{%
7030
7123
  \let\hash=##% convert placeholders to macro parameter chars
7031
7124
  \ifrecursive
7089
7182
% \braceorline decides whether the next nonwhitespace character is a
7090
7183
% {.  If so it reads up to the closing }, if not, it reads the whole
7091
7184
% line.  Whatever was read is then fed to the next control sequence
7092
 
% as an argument (by \parsebrace or \parsearg)
 
7185
% as an argument (by \parsebrace or \parsearg).
 
7186
7093
7187
\def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx}
7094
7188
\def\braceorlinexxx{%
7095
7189
  \ifx\nchar\bgroup\else
7099
7193
 
7100
7194
% @alias.
7101
7195
% We need some trickery to remove the optional spaces around the equal
7102
 
% sign.  Just make them active and then expand them all to nothing.
 
7196
% sign.  Make them active and then expand them all to nothing.
 
7197
%
7103
7198
\def\alias{\parseargusing\obeyspaces\aliasxxx}
7104
7199
\def\aliasxxx #1{\aliasyyy#1\relax}
7105
7200
\def\aliasyyy #1=#2\relax{%
7687
7782
% #2 is (optional) width, #3 is (optional) height.
7688
7783
% #4 is (ignored optional) html alt text.
7689
7784
% #5 is (ignored optional) extension.
7690
 
% #6 is just the usual extra ignored arg for parsing this stuff.
 
7785
% #6 is just the usual extra ignored arg for parsing stuff.
7691
7786
\newif\ifimagevmode
7692
7787
\def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup
7693
7788
  \catcode`\^^M = 5     % in case we're inside an example
8899
8994
% Prevent underfull vbox error messages.
8900
8995
\vbadness = 10000
8901
8996
 
8902
 
% Don't be so finicky about underfull hboxes, either.
8903
 
\hbadness = 2000
 
8997
% Don't be very finicky about underfull hboxes, either.
 
8998
\hbadness = 6666
8904
8999
 
8905
9000
% Following George Bush, get rid of widows and orphans.
8906
9001
\widowpenalty=10000