3
3
% Load plain if necessary, i.e., if running under initex.
4
4
\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
6
\def\texinfoversion{2009-08-14.15}
6
\def\texinfoversion{2010-06-17.11}
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.
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
199
197
% that mark overfull boxes (in case you have decided
200
198
% that the text looks ok even though it passes the margin).
202
\def\finalout{\overfullrule=0pt}
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).
211
% \vadjust can only be used in horizontal mode.
214
% Append this vertical mode material after the current line in the output.
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.
220
% \vadjust-items are inserted at the left edge of the type. So
221
% the \llap here moves out into the left-hand margin.
224
% For a thicker or thinner bar, change the `1pt'.
225
\vrule height\baselineskip width1pt
227
% This is the space between the bar and the text.
200
\def\finalout{\overfullrule=0pt }
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,
599
567
\newhelp\EMsimple{Press RETURN to continue.}
602
%% Simple single-character @ commands
605
% Kludge this until the fonts are right (grr).
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.
615
% Used to generate quoted braces.
616
\def\mylbrace {{\tt\char123}}
617
\def\myrbrace {{\tt\char125}}
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
628
!gdef!lbraceatcmd[@{]%
629
!gdef!rbraceatcmd[@}]%
632
% @comma{} to avoid , parsing problems.
635
% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
636
% Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H.
639
\def\ringaccent#1{{\accent23 #1}}
644
% Other special characters: @questiondown @exclamdown @ordf @ordm
645
% Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
646
\def\questiondown{?`}
648
\def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}}
649
\def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}}
651
% Dotless i and dotless j, used for accents.
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}%
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.)
665
\edef\TeX{\TeX \spacefactor=1000 }
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).
676
\vbox to \ht0{\hbox{\selectfonts\lllsize A}\vss}}%
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
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.
820
% \vadjust can only be used in horizontal mode.
823
% Append this vertical mode material after the current line in the output.
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.
829
% \vadjust-items are inserted at the left edge of the type. So
830
% the \llap here moves out into the left-hand margin.
833
% For a thicker or thinner bar, change the `1pt'.
834
\vrule height\baselineskip width1pt
836
% This is the space between the bar and the text.
923
842
% @include FILE -- \input text of FILE.
925
844
\def\include{\parseargusing\filenamecatcodes\includezzz}
1098
% @asis just yields its argument. Used with @table, for example.
1102
% @math outputs its argument in math mode.
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.
1109
\catcode`\_ = \active
1110
\gdef\mathunderscore{%
1112
\def_{\ifnum\fam=\slfam \_\else\sb\fi}%
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 @\.
1120
% The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.
1121
\def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi}
1126
\let\\ = \mathbackslash
1128
% make the texinfo accent commands work in math mode
1140
\def\finishmath#1{#1$\endgroup} % Close the group opened by \tex.
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).
1147
\catcode`^ = \active
1148
\catcode`< = \active
1149
\catcode`> = \active
1150
\catcode`+ = \active
1151
\catcode`' = \active
1157
\let' = \ptexquoteright
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}
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.
1175
\setbox0=\hbox{...}% get width of three periods
1182
\hskip 0pt plus.25fil
1183
.\hskip 0pt plus1fil
1184
.\hskip 0pt plus1fil
1185
.\hskip 0pt plus.5fil
1189
% @enddots{} is an end-of-sentence ellipsis.
1193
\spacefactor=\endofsentencespacefactor
1196
% @comma{} is so commas can be inserted into text without messing up
1197
% Texinfo's parsing.
1201
1017
% @refill is a no-op.
1202
1018
\let\refill=\relax
2461
2277
\let\markupsetuplqcode \markupsetcodequoteleft
2462
2278
\let\markupsetuprqcode \markupsetcodequoteright
2463
2280
\let\markupsetuplqexample \markupsetcodequoteleft
2464
2281
\let\markupsetuprqexample \markupsetcodequoteright
2283
\let\markupsetuplqsamp \markupsetcodequoteleft
2284
\let\markupsetuprqsamp \markupsetcodequoteright
2465
2286
\let\markupsetuplqverb \markupsetcodequoteleft
2466
2287
\let\markupsetuprqverb \markupsetcodequoteright
2467
2289
\let\markupsetuplqverbatim \markupsetcodequoteleft
2468
2290
\let\markupsetuprqverbatim \markupsetcodequoteright
2470
\let\markupsetuplqsamp \markupsetnoligaturesquoteleft
2471
2292
\let\markupsetuplqkbd \markupsetnoligaturesquoteleft
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
2508
%% Add scribe-like font environments, plus @l for inline lisp (usually sans
2509
%% serif) and @ii for TeX italic
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}
2518
% like \smartslanted except unconditionally uses \ttsl.
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{%
2336
{\ttsl #2\let\next=\relax}%
2337
{\def\next{{#1#2}\futurelet\next\smartitaliccorrection}}%
2340
\def\smartslanted{\dosmartslant\sl}
2341
\def\smartitalic{\dosmartslant\it}
2343
% Output an italic correction unless \next (presumed to be the following
2344
% character) is such as not to need one.
2345
\def\smartitaliccorrection{%
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}}
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}
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
2656
% @asis just yields its argument. Used with @table, for example.
2660
% @math outputs its argument in math mode.
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.
2667
\catcode`\_ = \active
2668
\gdef\mathunderscore{%
2670
\def_{\ifnum\fam=\slfam \_\else\sb\fi}%
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.
2677
% The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.
2678
\def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi}
2683
\let\\ = \mathbackslash
2685
% make the texinfo accent commands work in math mode
2697
\def\finishmath#1{#1$\endgroup} % Close the group opened by \tex.
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).
2704
\catcode`^ = \active
2705
\catcode`< = \active
2706
\catcode`> = \active
2707
\catcode`+ = \active
2708
\catcode`' = \active
2714
\let' = \ptexquoteright
2823
2719
\message{glyphs,}
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}}
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[@}]%
2744
% @comma{} to avoid , parsing problems.
2747
% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
2748
% Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H.
2750
\let\dotaccent = \ptexdot
2751
\def\ringaccent#1{{\accent23 #1}}
2752
\let\tieaccent = \ptext
2753
\let\ubaraccent = \ptexb
2754
\let\udotaccent = \d
2756
% Other special characters: @questiondown @exclamdown @ordf @ordm
2757
% Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
2758
\def\questiondown{?`}
2760
\def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}}
2761
\def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}}
2763
% Dotless i and dotless j, used for accents.
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}%
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.)
2777
\edef\TeX{\TeX \spacefactor=1000 }
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).
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$%
2794
% For 11pt, we can use our lllsize.
2795
\selectfonts\lllsize A%
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}
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.
2818
\setbox0=\hbox{...}% get width of three periods
2825
\hskip 0pt plus.25fil
2826
.\hskip 0pt plus1fil
2827
.\hskip 0pt plus1fil
2828
.\hskip 0pt plus.5fil
2832
% @enddots{} is an end-of-sentence ellipsis.
2836
\spacefactor=\endofsentencespacefactor
2825
2839
% @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
3208
3222
\def\headings #1 {\csname HEADINGS#1\endcsname}
3211
\global\evenheadline={\hfil} \global\evenfootline={\hfil}
3212
\global\oddheadline={\hfil} \global\oddfootline={\hfil}}
3224
\def\headingsoff{% non-global headings elimination
3225
\evenheadline={\hfil}\evenfootline={\hfil}%
3226
\oddheadline={\hfil}\oddfootline={\hfil}%
3229
\def\HEADINGSoff{{\globaldefs=1 \headingsoff}} % global setting
3230
\HEADINGSoff % it's the default
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
4134
4152
\def\@{@}% change to @@ when we switch to @ as escape char in index files.
4135
4153
\def\ {\realbackslash\space }%
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.
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}}%
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
4967
5003
\message{sectioning,}
4968
5004
% Chapters, sections, etc.
4970
% \unnumberedno is an oxymoron, of course. But we count the unnumbered
5006
% Let's start with @part.
5007
\outer\parseargdef\part{\partzzz{#1}}
5011
\vskip.3\vsize % move it down on the page a bit
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
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
5840
5891
% The last argument is the page number.
5841
5892
% The arguments in between are the chapter number, section number, ...
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}{}}
5900
% Parts, in the short toc.
5901
\def\shortpartentry#1#2#3#4{%
5903
\vskip.5\baselineskip plus.15\baselineskip minus.1\baselineskip
5904
\shortchapentry{{\bf #1}}{\numeralbox}{}{}%
5843
5907
% Chapters, in the main contents.
5844
5908
\def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}}
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
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}%
6167
% @lisp: indented, narrowed, typewriter font; @example: same as @lisp.
6235
% @lisp: indented, narrowed, typewriter font;
6236
% @example: same as @lisp.
6169
6238
% @smallexample and @smalllisp: use smaller fonts.
6170
6239
% Originally contributed by Pavel@xerox.
6172
\maketwodispenvs {lisp}{example}{%
6241
\maketwodispenvdef{lisp}{example}{%
6174
6243
\tt\setupmarkupstyle{example}%
6175
6244
\let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
6176
\gobble % eat return
6245
\gobble % eat return
6178
6247
% @display/@smalldisplay: same as @lisp except keep current font.
6180
\makedispenv {display}{%
6249
\makedispenvdef{display}{%
6185
6254
% @format/@smallformat: same as @display except don't narrow margins.
6187
\makedispenv{format}{%
6256
\makedispenvdef{format}{%
6188
6257
\let\nonarrowing = t%
6332
6393
% Setup for the @verbatim environment
6334
% Real tab expansion
6395
% Real tab expansion.
6335
6396
\newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount
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.
6405
\def\starttabbox{\global\setbox\verbbox=\hbox\bgroup}
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
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 \.
6949
% (as in normal texinfo). It is necessary to change the definition of \
6950
% to recognize macro arguments; this is the job of \mbodybackslash.
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.
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.
6960
\def\scanctxt{% used as subroutine
6891
6961
\catcode`\"=\other
6892
6962
\catcode`\+=\other
6893
6963
\catcode`\<=\other
6914
6984
\usembodybackslash
6987
\def\macroargctxt{% used when scanning invocations
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.
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):
6999
\def\\{\normalbackslash}%
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.
7005
% \anythingelse will almost certainly be an error of some kind.
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.
6928
7014
{\catcode`@=0 @catcode`@\=@active
6929
7015
@gdef@usembodybackslash{@let\=@mbodybackslash}
6930
7016
@gdef@mbodybackslash#1\{@csname macarg.#1@endcsname}
6932
7018
\expandafter\def\csname macarg.\endcsname{\realbackslash}
7020
\def\margbackslash#1{\char`\#1 }
6934
7022
\def\macro{\recursivefalse\parsearg\macroxxx}
6935
7023
\def\rmacro{\recursivetrue\parsearg\macroxxx}
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
6942
7030
\expandafter\parsemargdef \argl;%
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}}
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).
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.
7002
7090
% The same technique is used to protect \eatspaces till just before
7003
7091
% the macro is used.
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{}%
7096
\let\xeatspaces\relax
7097
\parsemargdefxxx#1,;,%
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,}%