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{1999-10-01.07}
6
\def\texinfoversion{2001-03-28.08}
8
% Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99
9
% Free Software Foundation, Inc.
8
% Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99,
9
% 2000, 01 Free Software Foundation, Inc.
11
11
% This texinfo.tex file is free software; you can redistribute it and/or
12
12
% modify it under the terms of the GNU General Public License as
687
688
\def\nofillexdentyyy #1{{\advance \leftskip by -\exdentamount
688
689
\leftline{\hskip\leftskip{\rm#1}}}}
690
% @inmargin{TEXT} puts TEXT in the margin next to the current paragraph.
693
\strut\vadjust{\nobreak\kern-\strutdepth
694
\vtop to \strutdepth{\baselineskip\strutdepth\vss
695
\llap{\rightskip=\inmarginspacing \vbox{\noindent #1}}\null}}}
691
% @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current
692
% paragraph. For more general purposes, use the \margin insertion
693
% class. WHICH is `l' or `r'.
696
695
\newskip\inmarginspacing \inmarginspacing=1cm
697
696
\def\strutdepth{\dp\strutbox}
699
%\hbox{{\rm#1}}\hfil\break}}
698
\def\doinmargin#1#2{\strut\vadjust{%
701
\vtop to \strutdepth{%
702
\baselineskip=\strutdepth
704
% if you have multiple lines of stuff to put here, you'll need to
705
% make the vbox yourself of the appropriate size.
707
\llap{\ignorespaces #2\hskip\inmarginspacing}%
709
\rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}%
714
\def\inleftmargin{\doinmargin l}
715
\def\inrightmargin{\doinmargin r}
717
% @inmargin{TEXT [, RIGHT-TEXT]}
718
% (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right;
719
% else use TEXT for both).
721
\def\inmargin#1{\parseinmargin #1,,\finish}
722
\def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing.
723
\setbox0 = \hbox{\ignorespaces #2}%
725
\def\lefttext{#1}% have both texts
728
\def\lefttext{#1}% have only one text
733
\def\temp{\inrightmargin\righttext}% odd page -> outside is right margin
735
\def\temp{\inleftmargin\lefttext}%
701
740
% @include file insert text of that file as input.
702
741
% Allow normal characters that we make active in the argument (a file name).
2589
2637
% @defindex foo == \newindex{foo}
2591
2639
\def\defindex{\parsearg\newindex}
2593
2641
% Define @defcodeindex, like @defindex except put all entries in @code.
2643
\def\defcodeindex{\parsearg\newcodeindex}
2595
2645
\def\newcodeindex#1{%
2597
2647
\expandafter\newwrite \csname#1indfile\endcsname
2598
2648
\openout \csname#1indfile\endcsname \jobname.#1
2600
2650
\expandafter\xdef\csname#1index\endcsname{%
2601
\noexpand\docodeindex{#1}}
2651
\noexpand\docodeindex{#1}}%
2604
\def\defcodeindex{\parsearg\newcodeindex}
2606
2655
% @synindex foo bar makes index foo feed into index bar.
2607
2656
% Do this instead of @defindex foo if you don't want it as a separate index.
2608
% The \closeout helps reduce unnecessary open files; the limit on the
2609
% Acorn RISC OS is a mere 16 files.
2610
\def\synindex#1 #2 {%
2611
\expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
2612
\expandafter\closeout\csname#1indfile\endcsname
2613
\expandafter\let\csname#1indfile\endcsname=\synindexfoo
2614
\expandafter\xdef\csname#1index\endcsname{% define \xxxindex
2615
\noexpand\doindex{#2}}%
2618
2658
% @syncodeindex foo bar similar, but put all entries made for index foo
2619
2659
% inside @code.
2620
\def\syncodeindex#1 #2 {%
2621
\expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
2622
\expandafter\closeout\csname#1indfile\endcsname
2623
\expandafter\let\csname#1indfile\endcsname=\synindexfoo
2624
\expandafter\xdef\csname#1index\endcsname{% define \xxxindex
2625
\noexpand\docodeindex{#2}}%
2661
\def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}}
2662
\def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}}
2664
% #1 is \doindex or \docodeindex, #2 the index getting redefined (foo),
2665
% #3 the target index (bar).
2666
\def\dosynindex#1#2#3{%
2667
% Only do \closeout if we haven't already done it, else we'll end up
2668
% closing the target index.
2669
\expandafter \ifx\csname donesynindex#2\endcsname \undefined
2670
% The \closeout helps reduce unnecessary open files; the limit on the
2671
% Acorn RISC OS is a mere 16 files.
2672
\expandafter\closeout\csname#2indfile\endcsname
2673
\expandafter\let\csname\donesynindex#2\endcsname = 1
2675
% redefine \fooindfile:
2676
\expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname
2677
\expandafter\let\csname#2indfile\endcsname=\temp
2678
% redefine \fooindex:
2679
\expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}%
2628
2682
% Define \doindex, the driver for all \fooindex macros.
2854
2908
% Now the real index entry with the fonts.
2857
% If third (subentry) arg is present, add it to the index
2858
% string. And include a space.
2911
% If the third (subentry) arg is present, add it to the index
2859
2913
\ifx\thirdarg\emptymacro \else
2860
\toks0 = \expandafter{\the\toks0 \space #3}%
2914
\toks0 = \expandafter{\the\toks0{#3}}%
2863
% Set up the complete index entry, with both the sort key
2864
% and the original text, including any font commands. We write
2865
% three arguments to \entry to the .?? file, texindex reduces to
2866
% two when writing the .??s sorted result.
2917
% Set up the complete index entry, with both the sort key and
2918
% the original text, including any font commands. We write
2919
% three arguments to \entry to the .?? file (four in the
2920
% subentry case), texindex reduces to two when writing the .??s
2868
2923
\write\csname#1indfile\endcsname{%
2869
2924
\realbackslash entry{\indexsorttmp}{\folio}{\the\toks0}}%
4357
% LaTeX-like @verbatim...@end verbatim and @verb{<char>...<char>}
4358
% If we want to allow any <char> as delimiter,
4359
% we need the curly braces so that makeinfo sees the @verb command, eg:
4360
% `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org
4362
% [Knuth]: Donald Ervin Knuth, 1996. The TeXbook.
4364
% [Knuth] p. 344; only we need to do '@' too
4366
\do\ \do\\\do\@\do\{\do\}\do\$\do\&%
4367
\do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~}
4370
\def\uncatcodespecials{%
4371
\def\do##1{\catcode`##1=12}\dospecials}
4373
% [Knuth] pp. 380,381,391
4374
% Disable Spanish ligatures ?` and !` of \tt font
4376
\catcode`\`=\active\gdef`{\relax\lq}
4379
% Setup for the @verb command.
4381
% Eight spaces for a tab
4383
\catcode`\^^I=\active
4384
\gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }}
4388
\tt % easiest (and conventionally used) font for verbatim
4389
\def\par{\leavevmode\endgraf}%
4392
% Respect line breaks,
4393
% print special symbols as themselves, and
4394
% make each space count
4395
% must do in this order:
4396
\obeylines \uncatcodespecials \sepspaces
4399
% Setup for the @verbatim environment
4401
% Real tab expansion
4402
\newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount
4404
\def\starttabbox{\setbox0=\hbox\bgroup}
4406
\catcode`\^^I=\active
4408
\catcode`\^^I=\active
4409
\def^^I{\leavevmode\egroup
4410
\dimen0=\wd0 % the width so far, or since the previous tab
4411
\divide\dimen0 by\tabw
4412
\multiply\dimen0 by\tabw % compute previous multiple of \tabw
4413
\advance\dimen0 by\tabw % advance to next multiple of \tabw
4414
\wd0=\dimen0 \box0 \starttabbox
4418
\def\setupverbatim{%
4419
% Easiest (and conventionally used) font for verbatim
4421
\def\par{\leavevmode\egroup\box0\endgraf}%
4424
% Respect line breaks,
4425
% print special symbols as themselves, and
4426
% make each space count
4427
% must do in this order:
4428
\obeylines \uncatcodespecials \sepspaces
4429
\everypar{\starttabbox}%
4432
% Do the @verb magic: verbatim text is quoted by unique
4433
% delimiter characters. Before first delimiter expect a
4434
% right brace, after last delimiter expect closing brace:
4436
% \def\doverb'{'<char>#1<char>'}'{#1}
4438
% [Knuth] p. 382; only eat outer {}
4440
\catcode`[=1\catcode`]=2\catcode`\{=12\catcode`\}=12
4441
\gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next]
4444
\def\verb{\begingroup\setupverb\doverb}
4447
% Do the @verbatim magic: define the macro \doverbatim so that
4448
% the (first) argument ends when '@end verbatim' is reached, ie:
4450
% \def\doverbatim#1@end verbatim{#1}
4452
% For Texinfo it's a lot easier than for LaTeX,
4453
% because texinfo's \verbatim doesn't stop at '\end{verbatim}':
4454
% we need not redefine '\', '{' and '}'
4456
% Inspired by LaTeX's verbatim command set [latex.ltx]
4457
%% Include LaTeX hack for completeness -- never know
4459
%% \catcode`|=0 \catcode`[=1
4460
%% \catcode`]=2\catcode`\{=12\catcode`\}=12\catcode`\ =\active
4461
%% \catcode`\\=12|gdef|doverbatim#1@end verbatim[
4462
%% #1|endgroup|def|Everbatim[]|end[verbatim]]
4466
\gdef\doverbatim#1@end verbatim{#1\end{verbatim}}
4470
\def\Everbatim{\nonfillfinish\endgroup}%
4473
\advance\leftskip by -\defbodyindent
4474
\begingroup\setupverbatim\doverbatim
4477
% @verbatiminclude FILE - insert text of file in verbatim environment.
4479
% Allow normal characters that we make active in the argument (a file name).
4480
\def\verbatiminclude{%
4490
\parsearg\doverbatiminclude
4492
\def\setupverbatiminclude{%
4495
\advance\leftskip by -\defbodyindent
4496
\begingroup\setupverbatim
4499
\def\doverbatiminclude#1{%
4500
% Restore active chars for included file.
4504
\expandafter\expandafter\setupverbatiminclude\input\thisfile
4505
\endgroup\nonfillfinish\endgroup
4290
4509
\message{defuns,}
6009
% Use @afivepaper to print on European A5 paper.
6010
% From romildo@urano.iceb.ufop.br, 2 July 2000.
6011
% He also recommends making @example and @lisp be small.
6012
\def\afivepaper{{\globaldefs = 1
6013
\setleading{12.5pt}%
6014
\parskip = 2pt plus 1pt minus 0.1pt
6016
\internalpagesizes{166mm}{120mm}{\voffset}{-8mm}{\bindingoffset}{8pt}%
6018
\lispnarrowing = 0.2in
6021
\contentsrightmargin = 0mm
6022
\deftypemargin = 0pt
6023
\defbodyindent = 2mm
5783
6029
% A specific text layout, 24x15cm overall, intended for A4 paper. Top margin
5784
6030
% 29mm, hence bottom margin 28mm, nominal side margin 3cm.
5785
6031
\def\afourlatex{{\globaldefs = 1