~ubuntu-branches/ubuntu/quantal/fftw/quantal

« back to all changes in this revision

Viewing changes to doc/texinfo.tex

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2011-11-29 01:48:33 UTC
  • mfrom: (5.1.1 sid)
  • Revision ID: package-import@ubuntu.com-20111129014833-3leawsns2nghyaoj
Tags: 2.1.5-1
* Team upload.
* New upstream release
* Package moved into the Debian Science team (no answer from the previous
  maintainer) and package not maintained.
* Standards-Version updated to version 3.9.2
* Vcs-Browser & Vcs-Svn updated
* Switch to mpi-default-dev (Closes: #571446)
* Get ride of .la files (Closes: #633175)
* Fix lintian warning debhelper-but-no-misc-depends
* Fix lintian warning patch-system-but-direct-changes-in-diff 
* Switch to dpkg-source 3.0 (quilt) format

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{1999-01-05}%
 
6
\def\texinfoversion{2001-05-24.08}
7
7
%
8
 
% Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98
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.
10
10
%
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
29
29
%
30
30
% Please try the latest version of texinfo.tex before submitting bug
31
31
% reports; you can get the latest version from:
32
 
%   ftp://ftp.gnu.org/pub/gnu/texinfo.tex
 
32
%   ftp://ftp.gnu.org/gnu/texinfo.tex
 
33
%   (and all GNU mirrors, see http://www.gnu.org/order/ftp.html)
 
34
%   ftp://texinfo.org/tex/texinfo.tex
 
35
%   ftp://us.ctan.org/macros/texinfo/texinfo.tex
 
36
%   (and all CTAN mirrors, finger ctan@us.ctan.org for a list).
33
37
%   /home/gd/gnu/doc/texinfo.tex on the GNU machines.
34
 
%   (and all GNU mirrors, see http://www.gnu.org/order/ftp.html)
35
 
%   ftp://tug.org/tex/texinfo.tex
36
 
%   ftp://ctan.org/macros/texinfo/texinfo.tex
37
 
%   (and all CTAN mirrors, finger ctan@ctan.org for a list).
38
 
% The texinfo.tex in the texinfo distribution itself could well be out
 
38
% The texinfo.tex in any given Texinfo distribution could well be out
39
39
% of date, so if that's what you're using, please check.
40
 
41
 
% Send bug reports to bug-texinfo@gnu.org.
42
 
% Please include a precise test case in each bug report,
43
 
% including a complete document with which we can reproduce the problem.
44
 
 
40
% Texinfo has a small home page at http://texinfo.org/.
 
41
%
 
42
% Send bug reports to bug-texinfo@gnu.org.  Please include including a
 
43
% complete document in each bug report with which we can reproduce the
 
44
% problem.  Patches are, of course, greatly appreciated.
 
45
%
45
46
% To process a Texinfo manual with TeX, it's most reliable to use the
46
 
% texi2dvi shell script that comes with the distribution.  For simple
47
 
% manuals, however, you can get away with:
 
47
% texi2dvi shell script that comes with the distribution.  For a simple
 
48
% manual foo.texi, however, you can get away with this:
48
49
%   tex foo.texi
49
50
%   texindex foo.??
50
51
%   tex foo.texi
51
52
%   tex foo.texi
52
 
%   dvips foo.dvi -o # or whatever, to process the dvi file.
 
53
%   dvips foo.dvi -o # or whatever, to process the dvi file; this makes foo.ps.
53
54
% The extra runs of TeX get the cross-reference information correct.
54
55
% Sometimes one run after texindex suffices, and sometimes you need more
55
56
% than two; texi2dvi does it as many times as necessary.
 
57
%
 
58
% It is possible to adapt texinfo.tex for other languages.  You can get
 
59
% the existing language-specific files from ftp://ftp.gnu.org/gnu/texinfo/.
56
60
 
57
61
\message{Loading texinfo [version \texinfoversion]:}
58
62
 
63
67
  \catcode`+=\active \catcode`\_=\active}
64
68
 
65
69
% Save some parts of plain tex whose names we will redefine.
66
 
 
67
70
\let\ptexb=\b
68
71
\let\ptexbullet=\bullet
69
72
\let\ptexc=\c
83
86
% For @tex, we can use \tabalign.
84
87
\let\+ = \relax
85
88
 
86
 
 
87
89
\message{Basics,}
88
90
\chardef\other=12
89
91
 
92
94
\newlinechar = `^^J
93
95
 
94
96
% Set up fixed words for English if not already set.
95
 
\ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi
96
 
\ifx\putwordChapter\undefined  \gdef\putwordChapter{Chapter}\fi
97
 
\ifx\putwordfile\undefined     \gdef\putwordfile{file}\fi
98
 
\ifx\putwordInfo\undefined     \gdef\putwordInfo{Info}\fi
99
 
\ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi
100
 
\ifx\putwordon\undefined       \gdef\putwordon{on}\fi
101
 
\ifx\putwordpage\undefined     \gdef\putwordpage{page}\fi
102
 
\ifx\putwordsection\undefined  \gdef\putwordsection{section}\fi
103
 
\ifx\putwordSection\undefined  \gdef\putwordSection{Section}\fi
104
 
\ifx\putwordsee\undefined      \gdef\putwordsee{see}\fi
105
 
\ifx\putwordSee\undefined      \gdef\putwordSee{See}\fi
106
 
\ifx\putwordShortContents\undefined  \gdef\putwordShortContents{Short Contents}\fi
107
 
\ifx\putwordTableofContents\undefined\gdef\putwordTableofContents{Table of Contents}\fi
 
97
\ifx\putwordAppendix\undefined  \gdef\putwordAppendix{Appendix}\fi
 
98
\ifx\putwordChapter\undefined   \gdef\putwordChapter{Chapter}\fi
 
99
\ifx\putwordfile\undefined      \gdef\putwordfile{file}\fi
 
100
\ifx\putwordin\undefined        \gdef\putwordin{in}\fi
 
101
\ifx\putwordIndexIsEmpty\undefined     \gdef\putwordIndexIsEmpty{(Index is empty)}\fi
 
102
\ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi
 
103
\ifx\putwordInfo\undefined      \gdef\putwordInfo{Info}\fi
 
104
\ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi
 
105
\ifx\putwordMethodon\undefined  \gdef\putwordMethodon{Method on}\fi
 
106
\ifx\putwordNoTitle\undefined   \gdef\putwordNoTitle{No Title}\fi
 
107
\ifx\putwordof\undefined        \gdef\putwordof{of}\fi
 
108
\ifx\putwordon\undefined        \gdef\putwordon{on}\fi
 
109
\ifx\putwordpage\undefined      \gdef\putwordpage{page}\fi
 
110
\ifx\putwordsection\undefined   \gdef\putwordsection{section}\fi
 
111
\ifx\putwordSection\undefined   \gdef\putwordSection{Section}\fi
 
112
\ifx\putwordsee\undefined       \gdef\putwordsee{see}\fi
 
113
\ifx\putwordSee\undefined       \gdef\putwordSee{See}\fi
 
114
\ifx\putwordShortTOC\undefined  \gdef\putwordShortTOC{Short Contents}\fi
 
115
\ifx\putwordTOC\undefined       \gdef\putwordTOC{Table of Contents}\fi
 
116
%
 
117
\ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi
 
118
\ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi
 
119
\ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi
 
120
\ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi
 
121
\ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi
 
122
\ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi
 
123
\ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi
 
124
\ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi
 
125
\ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi
 
126
\ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi
 
127
\ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi
 
128
\ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi
 
129
%
 
130
\ifx\putwordDefmac\undefined    \gdef\putwordDefmac{Macro}\fi
 
131
\ifx\putwordDefspec\undefined   \gdef\putwordDefspec{Special Form}\fi
 
132
\ifx\putwordDefvar\undefined    \gdef\putwordDefvar{Variable}\fi
 
133
\ifx\putwordDefopt\undefined    \gdef\putwordDefopt{User Option}\fi
 
134
\ifx\putwordDeftypevar\undefined\gdef\putwordDeftypevar{Variable}\fi
 
135
\ifx\putwordDeffunc\undefined   \gdef\putwordDeffunc{Function}\fi
 
136
\ifx\putwordDeftypefun\undefined\gdef\putwordDeftypefun{Function}\fi
108
137
 
109
138
% Ignore a token.
110
139
%
141
170
}%
142
171
\fi
143
172
 
 
173
% add check for \lastpenalty to plain's definitions.  If the last thing
 
174
% we did was a \nobreak, we don't want to insert more space.
 
175
 
176
\def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount
 
177
  \removelastskip\penalty-50\smallskip\fi\fi}
 
178
\def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount
 
179
  \removelastskip\penalty-100\medskip\fi\fi}
 
180
\def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount
 
181
  \removelastskip\penalty-200\bigskip\fi\fi}
 
182
 
144
183
% For @cropmarks command.
145
184
% Do @cropmarks to get crop marks.
146
 
 
185
%
147
186
\newif\ifcropmarks
148
187
\let\cropmarks = \cropmarkstrue
149
188
%
185
224
    \normalturnoffactive  % \ in index entries must not stay \, e.g., if
186
225
                   % the page break happens to be in the middle of an example.
187
226
    \shipout\vbox{%
 
227
      % Do this early so pdf references go to the beginning of the page.
 
228
      \ifpdfmakepagedest \pdfmkdest{\the\pageno} \fi
 
229
      %
188
230
      \ifcropmarks \vbox to \outervsize\bgroup
189
231
        \hsize = \outerhsize
190
232
        \vskip-\topandbottommargin
568
610
%}}
569
611
 
570
612
\def\needx#1{%
571
 
  % Go into vertical mode, so we don't make a big box in the middle of a
 
613
  % Ensure vertical mode, so we don't make a big box in the middle of a
572
614
  % paragraph.
573
615
  \par
574
616
  %
575
 
  % Don't add any leading before our big empty box, but allow a page
576
 
  % break, since the best break might be right here.
577
 
  \allowbreak
578
 
  \nointerlineskip
579
 
  \vtop to #1\mil{\vfil}%
580
 
  %
581
 
  % TeX does not even consider page breaks if a penalty added to the
582
 
  % main vertical list is 10000 or more.  But in order to see if the
583
 
  % empty box we just added fits on the page, we must make it consider
584
 
  % page breaks.  On the other hand, we don't want to actually break the
585
 
  % page after the empty box.  So we use a penalty of 9999.
586
 
  %
587
 
  % There is an extremely small chance that TeX will actually break the
588
 
  % page at this \penalty, if there are no other feasible breakpoints in
589
 
  % sight.  (If the user is using lots of big @group commands, which
590
 
  % almost-but-not-quite fill up a page, TeX will have a hard time doing
591
 
  % good page breaking, for example.)  However, I could not construct an
592
 
  % example where a page broke at this \penalty; if it happens in a real
593
 
  % document, then we can reconsider our strategy.
594
 
  \penalty9999
595
 
  %
596
 
  % Back up by the size of the box, whether we did a page break or not.
597
 
  \kern -#1\mil
598
 
  %
599
 
  % Do not allow a page break right after this kern.
600
 
  \nobreak
 
617
  % If the @need value is less than one line space, it's useless.
 
618
  \dimen0 = #1\mil
 
619
  \dimen2 = \ht\strutbox
 
620
  \advance\dimen2 by \dp\strutbox
 
621
  \ifdim\dimen0 > \dimen2
 
622
    %
 
623
    % Do a \strut just to make the height of this box be normal, so the
 
624
    % normal leading is inserted relative to the preceding line.
 
625
    % And a page break here is fine.
 
626
    \vtop to #1\mil{\strut\vfil}%
 
627
    %
 
628
    % TeX does not even consider page breaks if a penalty added to the
 
629
    % main vertical list is 10000 or more.  But in order to see if the
 
630
    % empty box we just added fits on the page, we must make it consider
 
631
    % page breaks.  On the other hand, we don't want to actually break the
 
632
    % page after the empty box.  So we use a penalty of 9999.
 
633
    %
 
634
    % There is an extremely small chance that TeX will actually break the
 
635
    % page at this \penalty, if there are no other feasible breakpoints in
 
636
    % sight.  (If the user is using lots of big @group commands, which
 
637
    % almost-but-not-quite fill up a page, TeX will have a hard time doing
 
638
    % good page breaking, for example.)  However, I could not construct an
 
639
    % example where a page broke at this \penalty; if it happens in a real
 
640
    % document, then we can reconsider our strategy.
 
641
    \penalty9999
 
642
    %
 
643
    % Back up by the size of the box, whether we did a page break or not.
 
644
    \kern -#1\mil
 
645
    %
 
646
    % Do not allow a page break right after this kern.
 
647
    \nobreak
 
648
  \fi
601
649
}
602
650
 
603
651
% @br   forces paragraph break
618
666
}
619
667
 
620
668
% @enddots{} is an end-of-sentence ellipsis.
621
 
 
669
%
622
670
\def\enddots{%
623
671
  \leavevmode
624
672
  \hbox to 2em{%
650
698
\def\nofillexdentyyy #1{{\advance \leftskip by -\exdentamount
651
699
\leftline{\hskip\leftskip{\rm#1}}}}
652
700
 
653
 
% @inmargin{TEXT} puts TEXT in the margin next to the current paragraph.
654
 
 
655
 
\def\inmargin#1{%
656
 
\strut\vadjust{\nobreak\kern-\strutdepth
657
 
  \vtop to \strutdepth{\baselineskip\strutdepth\vss
658
 
  \llap{\rightskip=\inmarginspacing \vbox{\noindent #1}}\null}}}
 
701
% @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current
 
702
% paragraph.  For more general purposes, use the \margin insertion
 
703
% class.  WHICH is `l' or `r'.
 
704
%
659
705
\newskip\inmarginspacing \inmarginspacing=1cm
660
706
\def\strutdepth{\dp\strutbox}
661
 
 
662
 
%\hbox{{\rm#1}}\hfil\break}}
 
707
%
 
708
\def\doinmargin#1#2{\strut\vadjust{%
 
709
  \nobreak
 
710
  \kern-\strutdepth
 
711
  \vtop to \strutdepth{%
 
712
    \baselineskip=\strutdepth
 
713
    \vss
 
714
    % if you have multiple lines of stuff to put here, you'll need to
 
715
    % make the vbox yourself of the appropriate size.
 
716
    \ifx#1l%
 
717
      \llap{\ignorespaces #2\hskip\inmarginspacing}%
 
718
    \else
 
719
      \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}%
 
720
    \fi
 
721
    \null
 
722
  }%
 
723
}}
 
724
\def\inleftmargin{\doinmargin l}
 
725
\def\inrightmargin{\doinmargin r}
 
726
%
 
727
% @inmargin{TEXT [, RIGHT-TEXT]}
 
728
% (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right;
 
729
% else use TEXT for both).
 
730
 
731
\def\inmargin#1{\parseinmargin #1,,\finish}
 
732
\def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing.
 
733
  \setbox0 = \hbox{\ignorespaces #2}% 
 
734
  \ifdim\wd0 > 0pt
 
735
    \def\lefttext{#1}%  have both texts
 
736
    \def\righttext{#2}%
 
737
  \else
 
738
    \def\lefttext{#1}%  have only one text
 
739
    \def\righttext{#1}%
 
740
  \fi
 
741
  %
 
742
  \ifodd\pageno
 
743
    \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin
 
744
  \else
 
745
    \def\temp{\inleftmargin\lefttext}%
 
746
  \fi
 
747
  \temp
 
748
}
663
749
 
664
750
% @include file    insert text of that file as input.
665
751
% Allow normal characters that  we make active in the argument (a file name).
705
791
 
706
792
\let\c=\comment
707
793
 
708
 
% @paragraphindent  is defined for the Info formatting commands only.
709
 
\let\paragraphindent=\comment
710
 
 
711
 
% Prevent errors for section commands.
712
 
% Used in @ignore and in failing conditionals.
713
 
\def\ignoresections{%
714
 
\let\chapter=\relax
715
 
\let\unnumbered=\relax
716
 
\let\top=\relax
717
 
\let\unnumberedsec=\relax
718
 
\let\unnumberedsection=\relax
719
 
\let\unnumberedsubsec=\relax
720
 
\let\unnumberedsubsection=\relax
721
 
\let\unnumberedsubsubsec=\relax
722
 
\let\unnumberedsubsubsection=\relax
723
 
\let\section=\relax
724
 
\let\subsec=\relax
725
 
\let\subsubsec=\relax
726
 
\let\subsection=\relax
727
 
\let\subsubsection=\relax
728
 
\let\appendix=\relax
729
 
\let\appendixsec=\relax
730
 
\let\appendixsection=\relax
731
 
\let\appendixsubsec=\relax
732
 
\let\appendixsubsection=\relax
733
 
\let\appendixsubsubsec=\relax
734
 
\let\appendixsubsubsection=\relax
735
 
\let\contents=\relax
736
 
\let\smallbook=\relax
737
 
\let\titlepage=\relax
738
 
}
739
 
 
740
 
% Used in nested conditionals, where we have to parse the Texinfo source
741
 
% and so want to turn off most commands, in case they are used
742
 
% incorrectly.
743
 
%
744
 
\def\ignoremorecommands{%
745
 
  \let\defcodeindex = \relax
746
 
  \let\defcv = \relax
747
 
  \let\deffn = \relax
748
 
  \let\deffnx = \relax
749
 
  \let\defindex = \relax
750
 
  \let\defivar = \relax
751
 
  \let\defmac = \relax
752
 
  \let\defmethod = \relax
753
 
  \let\defop = \relax
754
 
  \let\defopt = \relax
755
 
  \let\defspec = \relax
756
 
  \let\deftp = \relax
757
 
  \let\deftypefn = \relax
758
 
  \let\deftypefun = \relax
759
 
  \let\deftypevar = \relax
760
 
  \let\deftypevr = \relax
761
 
  \let\defun = \relax
762
 
  \let\defvar = \relax
763
 
  \let\defvr = \relax
764
 
  \let\ref = \relax
765
 
  \let\xref = \relax
766
 
  \let\printindex = \relax
767
 
  \let\pxref = \relax
768
 
  \let\settitle = \relax
769
 
  \let\setchapternewpage = \relax
770
 
  \let\setchapterstyle = \relax
771
 
  \let\everyheading = \relax
772
 
  \let\evenheading = \relax
773
 
  \let\oddheading = \relax
774
 
  \let\everyfooting = \relax
775
 
  \let\evenfooting = \relax
776
 
  \let\oddfooting = \relax
777
 
  \let\headings = \relax
778
 
  \let\include = \relax
779
 
  \let\lowersections = \relax
780
 
  \let\down = \relax
781
 
  \let\raisesections = \relax
782
 
  \let\up = \relax
783
 
  \let\set = \relax
784
 
  \let\clear = \relax
785
 
  \let\item = \relax
786
 
}
787
 
 
788
 
% Ignore @ignore ... @end ignore.
789
 
%
790
 
\def\ignore{\doignore{ignore}}
791
 
 
792
 
% Ignore @ifinfo, @ifhtml, @ifnottex, @html, @menu, and @direntry text.
793
 
%
794
 
\def\ifinfo{\doignore{ifinfo}}
795
 
\def\ifhtml{\doignore{ifhtml}}
796
 
\def\ifnottex{\doignore{ifnottex}}
797
 
\def\html{\doignore{html}}
798
 
\def\menu{\doignore{menu}}
799
 
\def\direntry{\doignore{direntry}}
800
 
 
801
 
% @dircategory CATEGORY  -- specify a category of the dir file
802
 
% which this file should belong to.  Ignore this in TeX.
803
 
\let\dircategory = \comment
804
 
 
805
 
% Ignore text until a line `@end #1'.
806
 
%
807
 
\def\doignore#1{\begingroup
808
 
  % Don't complain about control sequences we have declared \outer.
809
 
  \ignoresections
810
 
  %
811
 
  % Define a command to swallow text until we reach `@end #1'.
812
 
  % This @ is a catcode 12 token (that is the normal catcode of @ in
813
 
  % this texinfo.tex file).  We change the catcode of @ below to match.
814
 
  \long\def\doignoretext##1@end #1{\enddoignore}%
815
 
  %
816
 
  % Make sure that spaces turn into tokens that match what \doignoretext wants.
817
 
  \catcode32 = 10
818
 
  %
819
 
  % Ignore braces, too, so mismatched braces don't cause trouble.
820
 
  \catcode`\{ = 9
821
 
  \catcode`\} = 9
822
 
  %
823
 
  % We must not have @c interpreted as a control sequence.
824
 
  \catcode`\@ = 12
825
 
  %
826
 
  % Make the letter c a comment character so that the rest of the line
827
 
  % will be ignored. This way, the document can have (for example)
828
 
  %   @c @end ifinfo
829
 
  % and the @end ifinfo will be properly ignored.
830
 
  % (We've just changed @ to catcode 12.)
831
 
  \catcode`\c = 14
832
 
  %
833
 
  % And now expand that command.
834
 
  \doignoretext
835
 
}
836
 
 
837
 
% What we do to finish off ignored text.
838
 
%
839
 
\def\enddoignore{\endgroup\ignorespaces}%
840
 
 
841
 
\newif\ifwarnedobs\warnedobsfalse
842
 
\def\obstexwarn{%
843
 
  \ifwarnedobs\relax\else
844
 
  % We need to warn folks that they may have trouble with TeX 3.0.
845
 
  % This uses \immediate\write16 rather than \message to get newlines.
846
 
    \immediate\write16{}
847
 
    \immediate\write16{***WARNING*** for users of Unix TeX 3.0!}
848
 
    \immediate\write16{This manual trips a bug in TeX version 3.0 (tex hangs).}
849
 
    \immediate\write16{If you are running another version of TeX, relax.}
850
 
    \immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.}
851
 
    \immediate\write16{  Then upgrade your TeX installation if you can.}
852
 
    \immediate\write16{  (See ftp://ftp.gnu.org/pub/gnu/TeX.README.)}
853
 
    \immediate\write16{If you are stuck with version 3.0, run the}
854
 
    \immediate\write16{  script ``tex3patch'' from the Texinfo distribution}
855
 
    \immediate\write16{  to use a workaround.}
856
 
    \immediate\write16{}
857
 
    \global\warnedobstrue
858
 
    \fi
859
 
}
860
 
 
861
 
% **In TeX 3.0, setting text in \nullfont hangs tex.  For a
862
 
% workaround (which requires the file ``dummy.tfm'' to be installed),
863
 
% uncomment the following line:
864
 
%%%%%\font\nullfont=dummy\let\obstexwarn=\relax
865
 
 
866
 
% Ignore text, except that we keep track of conditional commands for
867
 
% purposes of nesting, up to an `@end #1' command.
868
 
%
869
 
\def\nestedignore#1{%
870
 
  \obstexwarn
871
 
  % We must actually expand the ignored text to look for the @end
872
 
  % command, so that nested ignore constructs work.  Thus, we put the
873
 
  % text into a \vbox and then do nothing with the result.  To minimize
874
 
  % the change of memory overflow, we follow the approach outlined on
875
 
  % page 401 of the TeXbook: make the current font be a dummy font.
876
 
  %
877
 
  \setbox0 = \vbox\bgroup
878
 
    % Don't complain about control sequences we have declared \outer.
879
 
    \ignoresections
880
 
    %
881
 
    % Define `@end #1' to end the box, which will in turn undefine the
882
 
    % @end command again.
883
 
    \expandafter\def\csname E#1\endcsname{\egroup\ignorespaces}%
884
 
    %
885
 
    % We are going to be parsing Texinfo commands.  Most cause no
886
 
    % trouble when they are used incorrectly, but some commands do
887
 
    % complicated argument parsing or otherwise get confused, so we
888
 
    % undefine them.
889
 
    %
890
 
    % We can't do anything about stray @-signs, unfortunately;
891
 
    % they'll produce `undefined control sequence' errors.
892
 
    \ignoremorecommands
893
 
    %
894
 
    % Set the current font to be \nullfont, a TeX primitive, and define
895
 
    % all the font commands to also use \nullfont.  We don't use
896
 
    % dummy.tfm, as suggested in the TeXbook, because not all sites
897
 
    % might have that installed.  Therefore, math mode will still
898
 
    % produce output, but that should be an extremely small amount of
899
 
    % stuff compared to the main input.
900
 
    %
901
 
    \nullfont
902
 
    \let\tenrm = \nullfont  \let\tenit = \nullfont  \let\tensl = \nullfont
903
 
    \let\tenbf = \nullfont  \let\tentt = \nullfont  \let\smallcaps = \nullfont
904
 
    \let\tensf = \nullfont
905
 
    % Similarly for index fonts (mostly for their use in
906
 
    % smallexample)
907
 
    \let\indrm = \nullfont  \let\indit = \nullfont  \let\indsl = \nullfont
908
 
    \let\indbf = \nullfont  \let\indtt = \nullfont  \let\indsc = \nullfont
909
 
    \let\indsf = \nullfont
910
 
    %
911
 
    % Don't complain when characters are missing from the fonts.
912
 
    \tracinglostchars = 0
913
 
    %
914
 
    % Don't bother to do space factor calculations.
915
 
    \frenchspacing
916
 
    %
917
 
    % Don't report underfull hboxes.
918
 
    \hbadness = 10000
919
 
    %
920
 
    % Do minimal line-breaking.
921
 
    \pretolerance = 10000
922
 
    %
923
 
    % Do not execute instructions in @tex
924
 
    \def\tex{\doignore{tex}}%
925
 
    % Do not execute macro definitions.
926
 
    % `c' is a comment character, so the word `macro' will get cut off.
927
 
    \def\macro{\doignore{ma}}%
928
 
}
929
 
 
930
 
% @set VAR sets the variable VAR to an empty value.
931
 
% @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
932
 
%
933
 
% Since we want to separate VAR from REST-OF-LINE (which might be
934
 
% empty), we can't just use \parsearg; we have to insert a space of our
935
 
% own to delimit the rest of the line, and then take it out again if we
936
 
% didn't need it.  Make sure the catcode of space is correct to avoid
937
 
% losing inside @example, for instance.
938
 
%
939
 
\def\set{\begingroup\catcode` =10
940
 
  \catcode`\-=12 \catcode`\_=12 % Allow - and _ in VAR.
941
 
  \parsearg\setxxx}
942
 
\def\setxxx#1{\setyyy#1 \endsetyyy}
943
 
\def\setyyy#1 #2\endsetyyy{%
944
 
  \def\temp{#2}%
945
 
  \ifx\temp\empty \global\expandafter\let\csname SET#1\endcsname = \empty
946
 
  \else \setzzz{#1}#2\endsetzzz % Remove the trailing space \setxxx inserted.
947
 
  \fi
948
 
  \endgroup
949
 
}
950
 
% Can't use \xdef to pre-expand #2 and save some time, since \temp or
951
 
% \next or other control sequences that we've defined might get us into
952
 
% an infinite loop. Consider `@set foo @cite{bar}'.
953
 
\def\setzzz#1#2 \endsetzzz{\expandafter\gdef\csname SET#1\endcsname{#2}}
954
 
 
955
 
% @clear VAR clears (i.e., unsets) the variable VAR.
956
 
%
957
 
\def\clear{\parsearg\clearxxx}
958
 
\def\clearxxx#1{\global\expandafter\let\csname SET#1\endcsname=\relax}
959
 
 
960
 
% @value{foo} gets the text saved in variable foo.
961
 
%
962
 
{
963
 
  \catcode`\_ = \active
964
 
  %
965
 
  % We might end up with active _ or - characters in the argument if
966
 
  % we're called from @code, as @code{@value{foo-bar_}}.  So \let any
967
 
  % such active characters to their normal equivalents.
968
 
  \gdef\value{\begingroup
969
 
    \catcode`\-=12 \catcode`\_=12
970
 
    \indexbreaks \let_\normalunderscore
971
 
    \valuexxx}
972
 
}
973
 
\def\valuexxx#1{\expandablevalue{#1}\endgroup}
974
 
 
975
 
% We have this subroutine so that we can handle at least some @value's
976
 
% properly in indexes (we \let\value to this in \indexdummies).  Ones
977
 
% whose names contain - or _ still won't work, but we can't do anything
978
 
% about that.  The command has to be fully expandable, since the result
979
 
% winds up in the index file.  This means that if the variable's value
980
 
% contains other Texinfo commands, it's almost certain it will fail
981
 
% (although perhaps we could fix that with sufficient work to do a
982
 
% one-level expansion on the result, instead of complete).
 
794
% @paragraphindent NCHARS
 
795
% We'll use ems for NCHARS, close enough.
 
796
% We cannot implement @paragraphindent asis, though.
983
797
984
 
\def\expandablevalue#1{%
985
 
  \expandafter\ifx\csname SET#1\endcsname\relax
986
 
    {[No value for ``#1'']}%
987
 
  \else
988
 
    \csname SET#1\endcsname
989
 
  \fi
990
 
}
991
 
 
992
 
% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
993
 
% with @set.
994
 
%
995
 
\def\ifset{\parsearg\ifsetxxx}
996
 
\def\ifsetxxx #1{%
997
 
  \expandafter\ifx\csname SET#1\endcsname\relax
998
 
    \expandafter\ifsetfail
999
 
  \else
1000
 
    \expandafter\ifsetsucceed
1001
 
  \fi
1002
 
}
1003
 
\def\ifsetsucceed{\conditionalsucceed{ifset}}
1004
 
\def\ifsetfail{\nestedignore{ifset}}
1005
 
\defineunmatchedend{ifset}
1006
 
 
1007
 
% @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been
1008
 
% defined with @set, or has been undefined with @clear.
1009
 
%
1010
 
\def\ifclear{\parsearg\ifclearxxx}
1011
 
\def\ifclearxxx #1{%
1012
 
  \expandafter\ifx\csname SET#1\endcsname\relax
1013
 
    \expandafter\ifclearsucceed
1014
 
  \else
1015
 
    \expandafter\ifclearfail
1016
 
  \fi
1017
 
}
1018
 
\def\ifclearsucceed{\conditionalsucceed{ifclear}}
1019
 
\def\ifclearfail{\nestedignore{ifclear}}
1020
 
\defineunmatchedend{ifclear}
1021
 
 
1022
 
% @iftex, @ifnothtml, @ifnotinfo always succeed; we read the text
1023
 
% following, through the first @end iftex (etc.).  Make `@end iftex'
1024
 
% (etc.) valid only after an @iftex.
1025
 
%
1026
 
\def\iftex{\conditionalsucceed{iftex}}
1027
 
\def\ifnothtml{\conditionalsucceed{ifnothtml}}
1028
 
\def\ifnotinfo{\conditionalsucceed{ifnotinfo}}
1029
 
\defineunmatchedend{iftex}
1030
 
\defineunmatchedend{ifnothtml}
1031
 
\defineunmatchedend{ifnotinfo}
1032
 
 
1033
 
% We can't just want to start a group at @iftex (for example) and end it
1034
 
% at @end iftex, since then @set commands inside the conditional have no
1035
 
% effect (they'd get reverted at the end of the group).  So we must
1036
 
% define \Eiftex to redefine itself to be its previous value.  (We can't
1037
 
% just define it to fail again with an ``unmatched end'' error, since
1038
 
% the @ifset might be nested.)
1039
 
%
1040
 
\def\conditionalsucceed#1{%
1041
 
  \edef\temp{%
1042
 
    % Remember the current value of \E#1.
1043
 
    \let\nece{prevE#1} = \nece{E#1}%
1044
 
    %
1045
 
    % At the `@end #1', redefine \E#1 to be its previous value.
1046
 
    \def\nece{E#1}{\let\nece{E#1} = \nece{prevE#1}}%
1047
 
  }%
1048
 
  \temp
1049
 
}
1050
 
 
1051
 
% We need to expand lots of \csname's, but we don't want to expand the
1052
 
% control sequences after we've constructed them.
1053
 
%
1054
 
\def\nece#1{\expandafter\noexpand\csname#1\endcsname}
 
798
\def\asisword{asis} % no translation, these are keywords
 
799
\def\noneword{none}
 
800
%
 
801
\def\paragraphindent{\parsearg\doparagraphindent}
 
802
\def\doparagraphindent#1{%
 
803
  \def\temp{#1}%
 
804
  \ifx\temp\asisword
 
805
  \else
 
806
    \ifx\temp\noneword
 
807
      \defaultparindent = 0pt
 
808
    \else
 
809
      \defaultparindent = #1em
 
810
    \fi
 
811
  \fi
 
812
  \parindent = \defaultparindent
 
813
}
 
814
 
 
815
% @exampleindent NCHARS
 
816
% We'll use ems for NCHARS like @paragraphindent.
 
817
% It seems @exampleindent asis isn't necessary, but
 
818
% I preserve it to make it similar to @paragraphindent.
 
819
\def\exampleindent{\parsearg\doexampleindent}
 
820
\def\doexampleindent#1{%
 
821
  \def\temp{#1}%
 
822
  \ifx\temp\asisword
 
823
  \else
 
824
    \ifx\temp\noneword
 
825
      \lispnarrowing = 0pt
 
826
    \else
 
827
      \lispnarrowing = #1em
 
828
    \fi
 
829
  \fi
 
830
}
1055
831
 
1056
832
% @asis just yields its argument.  Used with @table, for example.
1057
833
%
1088
864
% So open here the files we need to have open while reading the input.
1089
865
% This makes it possible to make a .fmt file for texinfo.
1090
866
\def\setfilename{%
1091
 
   \iflinks 
 
867
   \iflinks
1092
868
     \readauxfile
1093
869
   \fi % \openindices needs to do some work in any case.
1094
870
   \openindices
1107
883
}
1108
884
 
1109
885
% Called from \setfilename.
1110
 
 
886
%
1111
887
\def\openindices{%
1112
888
  \newindex{cp}%
1113
889
  \newcodeindex{fn}%
1121
897
\outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
1122
898
 
1123
899
 
 
900
\message{pdf,}
 
901
% adobe `portable' document format
 
902
\newcount\tempnum
 
903
\newcount\lnkcount
 
904
\newtoks\filename
 
905
\newcount\filenamelength
 
906
\newcount\pgn
 
907
\newtoks\toksA
 
908
\newtoks\toksB
 
909
\newtoks\toksC
 
910
\newtoks\toksD
 
911
\newbox\boxA
 
912
\newcount\countA
 
913
\newif\ifpdf
 
914
\newif\ifpdfmakepagedest
 
915
 
 
916
\ifx\pdfoutput\undefined
 
917
  \pdffalse
 
918
  \let\pdfmkdest = \gobble
 
919
  \let\pdfurl = \gobble
 
920
  \let\endlink = \relax
 
921
  \let\linkcolor = \relax
 
922
  \let\pdfmakeoutlines = \relax
 
923
\else
 
924
  \pdftrue
 
925
  \pdfoutput = 1
 
926
  \input pdfcolor
 
927
  \def\dopdfimage#1#2#3{%
 
928
    \def\imagewidth{#2}%
 
929
    \def\imageheight{#3}%
 
930
    \ifnum\pdftexversion < 14
 
931
      \pdfimage
 
932
    \else
 
933
      \pdfximage
 
934
    \fi
 
935
      \ifx\empty\imagewidth\else width \imagewidth \fi
 
936
      \ifx\empty\imageheight\else height \imageheight \fi
 
937
      \ifnum\pdftexversion<13
 
938
         #1.pdf%
 
939
       \else
 
940
         {#1.pdf}%
 
941
       \fi
 
942
    \ifnum\pdftexversion < 14 \else
 
943
      \pdfrefximage \pdflastximage
 
944
    \fi}
 
945
  \def\pdfmkdest#1{\pdfdest name{#1} xyz}
 
946
  \def\pdfmkpgn#1{#1@}
 
947
  \let\linkcolor = \Blue  % was Cyan, but that seems light?
 
948
  \def\endlink{\Black\pdfendlink}
 
949
  % Adding outlines to PDF; macros for calculating structure of outlines
 
950
  % come from Petr Olsak
 
951
  \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0%
 
952
    \else \csname#1\endcsname \fi}
 
953
  \def\advancenumber#1{\tempnum=\expnumber{#1}\relax
 
954
    \advance\tempnum by1
 
955
    \expandafter\xdef\csname#1\endcsname{\the\tempnum}}
 
956
  \def\pdfmakeoutlines{{%
 
957
    \openin 1 \jobname.toc
 
958
    \ifeof 1\else\bgroup
 
959
      \closein 1 
 
960
      \indexnofonts
 
961
      \def\tt{}
 
962
      \let\_ = \normalunderscore
 
963
      % Thanh's hack / proper braces in bookmarks  
 
964
      \edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace
 
965
      \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace
 
966
      %
 
967
      \def\chapentry ##1##2##3{}
 
968
      \def\unnumbchapentry ##1##2{}
 
969
      \def\secentry ##1##2##3##4{\advancenumber{chap##2}}
 
970
      \def\unnumbsecentry ##1##2{}
 
971
      \def\subsecentry ##1##2##3##4##5{\advancenumber{sec##2.##3}}
 
972
      \def\unnumbsubsecentry ##1##2{}
 
973
      \def\subsubsecentry ##1##2##3##4##5##6{\advancenumber{subsec##2.##3.##4}}
 
974
      \def\unnumbsubsubsecentry ##1##2{}
 
975
      \input \jobname.toc
 
976
      \def\chapentry ##1##2##3{%
 
977
        \pdfoutline goto name{\pdfmkpgn{##3}}count-\expnumber{chap##2}{##1}}
 
978
      \def\unnumbchapentry ##1##2{%
 
979
        \pdfoutline goto name{\pdfmkpgn{##2}}{##1}}
 
980
      \def\secentry ##1##2##3##4{%
 
981
        \pdfoutline goto name{\pdfmkpgn{##4}}count-\expnumber{sec##2.##3}{##1}}
 
982
      \def\unnumbsecentry ##1##2{%
 
983
        \pdfoutline goto name{\pdfmkpgn{##2}}{##1}}
 
984
      \def\subsecentry ##1##2##3##4##5{%
 
985
        \pdfoutline goto name{\pdfmkpgn{##5}}count-\expnumber{subsec##2.##3.##4}{##1}}
 
986
      \def\unnumbsubsecentry ##1##2{%
 
987
        \pdfoutline goto name{\pdfmkpgn{##2}}{##1}}
 
988
      \def\subsubsecentry ##1##2##3##4##5##6{%
 
989
        \pdfoutline goto name{\pdfmkpgn{##6}}{##1}}
 
990
      \def\unnumbsubsubsecentry ##1##2{%
 
991
        \pdfoutline goto name{\pdfmkpgn{##2}}{##1}}
 
992
      \input \jobname.toc
 
993
    \egroup\fi
 
994
  }}
 
995
  \def\makelinks #1,{%
 
996
    \def\params{#1}\def\E{END}%
 
997
    \ifx\params\E
 
998
      \let\nextmakelinks=\relax
 
999
    \else
 
1000
      \let\nextmakelinks=\makelinks
 
1001
      \ifnum\lnkcount>0,\fi
 
1002
      \picknum{#1}%
 
1003
      \startlink attr{/Border [0 0 0]} 
 
1004
        goto name{\pdfmkpgn{\the\pgn}}%
 
1005
      \linkcolor #1%
 
1006
      \advance\lnkcount by 1%
 
1007
      \endlink
 
1008
    \fi
 
1009
    \nextmakelinks
 
1010
  }
 
1011
  \def\picknum#1{\expandafter\pn#1}
 
1012
  \def\pn#1{%
 
1013
    \def\p{#1}%
 
1014
    \ifx\p\lbrace
 
1015
      \let\nextpn=\ppn
 
1016
    \else
 
1017
      \let\nextpn=\ppnn
 
1018
      \def\first{#1}
 
1019
    \fi
 
1020
    \nextpn
 
1021
  }
 
1022
  \def\ppn#1{\pgn=#1\gobble}
 
1023
  \def\ppnn{\pgn=\first}
 
1024
  \def\pdfmklnk#1{\lnkcount=0\makelinks #1,END,}
 
1025
  \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
 
1026
  \def\skipspaces#1{\def\PP{#1}\def\D{|}%
 
1027
    \ifx\PP\D\let\nextsp\relax
 
1028
    \else\let\nextsp\skipspaces
 
1029
      \ifx\p\space\else\addtokens{\filename}{\PP}%
 
1030
        \advance\filenamelength by 1
 
1031
      \fi
 
1032
    \fi
 
1033
    \nextsp}
 
1034
  \def\getfilename#1{\filenamelength=0\expandafter\skipspaces#1|\relax}
 
1035
  \ifnum\pdftexversion < 14
 
1036
    \let \startlink \pdfannotlink
 
1037
  \else
 
1038
    \let \startlink \pdfstartlink
 
1039
  \fi
 
1040
  \def\pdfurl#1{%
 
1041
    \begingroup
 
1042
      \normalturnoffactive\def\@{@}%
 
1043
      \let\value=\expandablevalue
 
1044
      \leavevmode\Red
 
1045
      \startlink attr{/Border [0 0 0]}%
 
1046
        user{/Subtype /Link /A << /S /URI /URI (#1) >>}%
 
1047
        % #1
 
1048
    \endgroup}
 
1049
  \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}}
 
1050
  \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
 
1051
  \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks}
 
1052
  \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}}
 
1053
  \def\maketoks{%
 
1054
    \expandafter\poptoks\the\toksA|ENDTOKS|
 
1055
    \ifx\first0\adn0
 
1056
    \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3
 
1057
    \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6
 
1058
    \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9 
 
1059
    \else
 
1060
      \ifnum0=\countA\else\makelink\fi
 
1061
      \ifx\first.\let\next=\done\else
 
1062
        \let\next=\maketoks
 
1063
        \addtokens{\toksB}{\the\toksD}
 
1064
        \ifx\first,\addtokens{\toksB}{\space}\fi
 
1065
      \fi
 
1066
    \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
 
1067
    \next}
 
1068
  \def\makelink{\addtokens{\toksB}%
 
1069
    {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0}
 
1070
  \def\pdflink#1{%
 
1071
    \startlink attr{/Border [0 0 0]} goto name{\mkpgn{#1}}
 
1072
    \linkcolor #1\endlink}
 
1073
  \def\mkpgn#1{#1@} 
 
1074
  \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
 
1075
\fi % \ifx\pdfoutput
 
1076
 
 
1077
 
1124
1078
\message{fonts,}
1125
1079
% Font-change commands.
1126
1080
 
1190
1144
\setfont\deftt\ttshape{10}{\magstep1}
1191
1145
\def\df{\let\tentt=\deftt \let\tenbf = \defbf \bf}
1192
1146
 
1193
 
% Fonts for indices and small examples (9pt).
1194
 
% We actually use the slanted font rather than the italic,
1195
 
% because texinfo normally uses the slanted fonts for that.
1196
 
% Do not make many font distinctions in general in the index, since they
1197
 
% aren't very useful.
1198
 
\setfont\ninett\ttshape{9}{1000}
1199
 
\setfont\ninettsl\ttslshape{10}{900}
1200
 
\setfont\indrm\rmshape{9}{1000}
1201
 
\setfont\indit\itshape{9}{1000}
1202
 
\setfont\indsl\slshape{9}{1000}
1203
 
\let\indtt=\ninett
1204
 
\let\indttsl=\ninettsl
1205
 
\let\indsf=\indrm
1206
 
\let\indbf=\indrm
1207
 
\setfont\indsc\scshape{10}{900}
1208
 
\font\indi=cmmi9
1209
 
\font\indsy=cmsy9
 
1147
% Fonts for indices, footnotes, small examples (9pt).
 
1148
\setfont\smallrm\rmshape{9}{1000}
 
1149
\setfont\smalltt\ttshape{9}{1000}
 
1150
\setfont\smallbf\bfshape{10}{900}
 
1151
\setfont\smallit\itshape{9}{1000}
 
1152
\setfont\smallsl\slshape{9}{1000}
 
1153
\setfont\smallsf\sfshape{9}{1000}
 
1154
\setfont\smallsc\scshape{10}{900}
 
1155
\setfont\smallttsl\ttslshape{10}{900}
 
1156
\font\smalli=cmmi9
 
1157
\font\smallsy=cmsy9
1210
1158
 
1211
1159
% Fonts for title page:
1212
1160
\setfont\titlerm\rmbshape{12}{\magstep3}
1320
1268
  \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy \let\tenttsl=\ssecttsl
1321
1269
  \resetmathfonts \setleading{15pt}}
1322
1270
\let\subsubsecfonts = \subsecfonts % Maybe make sssec fonts scaled magstephalf?
1323
 
\def\indexfonts{%
1324
 
  \let\tenrm=\indrm \let\tenit=\indit \let\tensl=\indsl
1325
 
  \let\tenbf=\indbf \let\tentt=\indtt \let\smallcaps=\indsc
1326
 
  \let\tensf=\indsf \let\teni=\indi \let\tensy=\indsy \let\tenttsl=\indttsl
1327
 
  \resetmathfonts \setleading{12pt}}
 
1271
\def\smallfonts{%
 
1272
  \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl
 
1273
  \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc
 
1274
  \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy
 
1275
  \let\tenttsl=\smallttsl
 
1276
  \resetmathfonts \setleading{11pt}}
1328
1277
 
1329
1278
% Set up the default fonts, so we can use them for creating boxes.
1330
1279
%
1373
1322
}
1374
1323
\let\ttfont=\t
1375
1324
\def\samp#1{`\tclose{#1}'\null}
1376
 
\setfont\smallrm\rmshape{8}{1000}
1377
 
\font\smallsy=cmsy9
1378
 
\def\key#1{{\smallrm\textfont2=\smallsy \leavevmode\hbox{%
 
1325
\setfont\keyrm\rmshape{8}{1000}
 
1326
\font\keysy=cmsy9
 
1327
\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{%
1379
1328
  \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
1380
1329
    \vbox{\hrule\kern-0.4pt
1381
1330
     \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
1479
1428
\let\env=\code
1480
1429
\let\command=\code
1481
1430
 
1482
 
% @uref (abbreviation for `urlref') takes an optional second argument
1483
 
% specifying the text to display.  First (mandatory) arg is the url.
1484
 
% Perhaps eventually put in a hypertex \special here.
1485
 
1486
 
\def\uref#1{\urefxxx #1,,\finish}
1487
 
\def\urefxxx#1,#2,#3\finish{%
1488
 
  \setbox0 = \hbox{\ignorespaces #2}%
 
1431
% @uref (abbreviation for `urlref') takes an optional (comma-separated)
 
1432
% second argument specifying the text to display and an optional third
 
1433
% arg as text to display instead of (rather than in addition to) the url
 
1434
% itself.  First (mandatory) arg is the url.  Perhaps eventually put in
 
1435
% a hypertex \special here.
 
1436
%
 
1437
\def\uref#1{\douref #1,,,\finish}
 
1438
\def\douref#1,#2,#3,#4\finish{\begingroup
 
1439
  \unsepspaces
 
1440
  \pdfurl{#1}%
 
1441
  \setbox0 = \hbox{\ignorespaces #3}%
1489
1442
  \ifdim\wd0 > 0pt
1490
 
    \unhbox0\ (\code{#1})%
 
1443
    \unhbox0 % third arg given, show only that
1491
1444
  \else
1492
 
    \code{#1}%
 
1445
    \setbox0 = \hbox{\ignorespaces #2}%
 
1446
    \ifdim\wd0 > 0pt
 
1447
      \ifpdf
 
1448
        \unhbox0             % PDF: 2nd arg given, show only it
 
1449
      \else
 
1450
        \unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url
 
1451
      \fi
 
1452
    \else
 
1453
      \code{#1}% only url given, so show it
 
1454
    \fi
1493
1455
  \fi
1494
 
}
 
1456
  \endlink
 
1457
\endgroup}
1495
1458
 
1496
 
% rms does not like the angle brackets --karl, 17may97.
1497
 
% So now @email is just like @uref.
 
1459
% rms does not like angle brackets --karl, 17may97.
 
1460
% So now @email is just like @uref, unless we are pdf.
 
1461
1498
1462
%\def\email#1{\angleleft{\tt #1}\angleright}
1499
 
\let\email=\uref
 
1463
\ifpdf
 
1464
  \def\email#1{\doemail#1,,\finish}
 
1465
  \def\doemail#1,#2,#3\finish{\begingroup
 
1466
    \unsepspaces
 
1467
    \pdfurl{mailto:#1}%
 
1468
    \setbox0 = \hbox{\ignorespaces #2}%
 
1469
    \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi
 
1470
    \endlink
 
1471
  \endgroup}
 
1472
\else
 
1473
  \let\email=\uref
 
1474
\fi
1500
1475
 
1501
1476
% Check if we are currently using a typewriter font.  Since all the
1502
1477
% Computer Modern typewriter fonts have zero interword stretch (and
1540
1515
 
1541
1516
% Do an implicit @contents or @shortcontents after @end titlepage if the
1542
1517
% user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage.
1543
 
 
1518
%
1544
1519
\newif\ifsetcontentsaftertitlepage
1545
1520
 \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue
1546
1521
\newif\ifsetshortcontentsaftertitlepage
1615
1590
     \global\let\shortcontents = \relax
1616
1591
   \fi
1617
1592
   %
 
1593
   \ifpdf \pdfmakepagedesttrue \fi
 
1594
   %
1618
1595
   \HEADINGSon
1619
1596
}
1620
1597
 
1748
1725
}
1749
1726
 
1750
1727
% Subroutines used in generating headings
1751
 
% Produces Day Month Year style of output.
1752
 
\def\today{\number\day\space
1753
 
\ifcase\month\or
1754
 
January\or February\or March\or April\or May\or June\or
1755
 
July\or August\or September\or October\or November\or December\fi
1756
 
\space\number\year}
1757
 
 
1758
 
% Use this if you want the Month Day, Year style of output.
1759
 
%\def\today{\ifcase\month\or
1760
 
%January\or February\or March\or April\or May\or June\or
1761
 
%July\or August\or September\or October\or November\or December\fi
1762
 
%\space\number\day, \number\year}
1763
 
 
1764
 
% @settitle line...  specifies the title of the document, for headings
1765
 
% It generates no output of its own
1766
 
 
1767
 
\def\thistitle{No Title}
 
1728
% This produces Day Month Year style of output.
 
1729
% Only define if not already defined, in case a txi-??.tex file has set
 
1730
% up a different format (e.g., txi-cs.tex does this).
 
1731
\ifx\today\undefined
 
1732
\def\today{%
 
1733
  \number\day\space
 
1734
  \ifcase\month
 
1735
  \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr
 
1736
  \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug
 
1737
  \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec
 
1738
  \fi
 
1739
  \space\number\year}
 
1740
\fi
 
1741
 
 
1742
% @settitle line...  specifies the title of the document, for headings.
 
1743
% It generates no output of its own.
 
1744
\def\thistitle{\putwordNoTitle}
1768
1745
\def\settitle{\parsearg\settitlezzz}
1769
1746
\def\settitlezzz #1{\gdef\thistitle{#1}}
1770
1747
 
1841
1818
    \itemxneedsnegativevskipfalse
1842
1819
  \else
1843
1820
    % The item text fits into the space.  Start a paragraph, so that the
1844
 
    % following text (if any) will end up on the same line.  
 
1821
    % following text (if any) will end up on the same line.
1845
1822
    \noindent
1846
1823
    % Do this with kerns and \unhbox so that if there is a footnote in
1847
1824
    % the item text, it can migrate to the main vertical list and
2138
2115
\multitablelinespace=0pt
2139
2116
 
2140
2117
% Macros used to set up halign preamble:
2141
 
 
2118
%
2142
2119
\let\endsetuptable\relax
2143
2120
\def\xendsetuptable{\endsetuptable}
2144
2121
\let\columnfractions\relax
2184
2161
  \go
2185
2162
}
2186
2163
 
2187
 
% multitable syntax
2188
 
\def\tab{&\hskip1sp\relax} % 2/2/96
2189
 
                           % tiny skip here makes sure this column space is
2190
 
                           % maintained, even if it is never used.
 
2164
% This used to have \hskip1sp.  But then the space in a template line is
 
2165
% not enough.  That is bad.  So let's go back to just & until we
 
2166
% encounter the problem it was intended to solve again.
 
2167
% --karl, nathan@acm.org, 20apr99.
 
2168
\def\tab{&}
2191
2169
 
2192
2170
% @multitable ... @end multitable definitions:
2193
2171
%
2229
2207
  % In order to keep entries from bumping into each other
2230
2208
  % we will add a \leftskip of \multitablecolspace to all columns after
2231
2209
  % the first one.
2232
 
  % 
 
2210
  %
2233
2211
  % If a template has been used, we will add \multitablecolspace
2234
2212
  % to the width of each template entry.
2235
 
  % 
 
2213
  %
2236
2214
  % If the user has set preamble in terms of percent of \hsize we will
2237
2215
  % use that dimension as the width of the column, and the \leftskip
2238
2216
  % will keep entries from bumping into each other.  Table will start at
2239
2217
  % left margin and final column will justify at right margin.
2240
 
  % 
 
2218
  %
2241
2219
  % Make sure we don't inherit \rightskip from the outer environment.
2242
2220
  \rightskip=0pt
2243
2221
  \ifnum\colcount=1
2268
2246
% If so, do nothing. If not, give it an appropriate dimension based on
2269
2247
% current baselineskip.
2270
2248
\ifdim\multitablelinespace=0pt
 
2249
\setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip
 
2250
\global\advance\multitablelinespace by-\ht0
2271
2251
%% strut to put in table in case some entry doesn't have descenders,
2272
2252
%% to keep lines equally spaced
2273
2253
\let\multistrut = \strut
 
2254
\else
 
2255
%% FIXME: what is \box0 supposed to be?
 
2256
\gdef\multistrut{\vrule height\multitablelinespace depth\dp0
 
2257
width0pt\relax} \fi
2274
2258
%% Test to see if parskip is larger than space between lines of
2275
2259
%% table. If not, do nothing.
2276
2260
%%        If so, set to same dimension as multitablelinespace.
2277
 
\else
2278
 
\gdef\multistrut{\vrule height\multitablelinespace depth\dp0
2279
 
width0pt\relax} \fi
2280
2261
\ifdim\multitableparskip>\multitablelinespace
2281
2262
\global\multitableparskip=\multitablelinespace
2282
2263
\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller
2289
2270
\fi}
2290
2271
 
2291
2272
 
 
2273
\message{conditionals,}
 
2274
% Prevent errors for section commands.
 
2275
% Used in @ignore and in failing conditionals.
 
2276
\def\ignoresections{%
 
2277
  \let\chapter=\relax
 
2278
  \let\unnumbered=\relax
 
2279
  \let\top=\relax
 
2280
  \let\unnumberedsec=\relax
 
2281
  \let\unnumberedsection=\relax
 
2282
  \let\unnumberedsubsec=\relax
 
2283
  \let\unnumberedsubsection=\relax
 
2284
  \let\unnumberedsubsubsec=\relax
 
2285
  \let\unnumberedsubsubsection=\relax
 
2286
  \let\section=\relax
 
2287
  \let\subsec=\relax
 
2288
  \let\subsubsec=\relax
 
2289
  \let\subsection=\relax
 
2290
  \let\subsubsection=\relax
 
2291
  \let\appendix=\relax
 
2292
  \let\appendixsec=\relax
 
2293
  \let\appendixsection=\relax
 
2294
  \let\appendixsubsec=\relax
 
2295
  \let\appendixsubsection=\relax
 
2296
  \let\appendixsubsubsec=\relax
 
2297
  \let\appendixsubsubsection=\relax
 
2298
  \let\contents=\relax
 
2299
  \let\smallbook=\relax
 
2300
  \let\titlepage=\relax
 
2301
}
 
2302
 
 
2303
% Used in nested conditionals, where we have to parse the Texinfo source
 
2304
% and so want to turn off most commands, in case they are used
 
2305
% incorrectly.
 
2306
%
 
2307
\def\ignoremorecommands{%
 
2308
  \let\defcodeindex = \relax
 
2309
  \let\defcv = \relax
 
2310
  \let\deffn = \relax
 
2311
  \let\deffnx = \relax
 
2312
  \let\defindex = \relax
 
2313
  \let\defivar = \relax
 
2314
  \let\defmac = \relax
 
2315
  \let\defmethod = \relax
 
2316
  \let\defop = \relax
 
2317
  \let\defopt = \relax
 
2318
  \let\defspec = \relax
 
2319
  \let\deftp = \relax
 
2320
  \let\deftypefn = \relax
 
2321
  \let\deftypefun = \relax
 
2322
  \let\deftypeivar = \relax
 
2323
  \let\deftypeop = \relax
 
2324
  \let\deftypevar = \relax
 
2325
  \let\deftypevr = \relax
 
2326
  \let\defun = \relax
 
2327
  \let\defvar = \relax
 
2328
  \let\defvr = \relax
 
2329
  \let\ref = \relax
 
2330
  \let\xref = \relax
 
2331
  \let\printindex = \relax
 
2332
  \let\pxref = \relax
 
2333
  \let\settitle = \relax
 
2334
  \let\setchapternewpage = \relax
 
2335
  \let\setchapterstyle = \relax
 
2336
  \let\everyheading = \relax
 
2337
  \let\evenheading = \relax
 
2338
  \let\oddheading = \relax
 
2339
  \let\everyfooting = \relax
 
2340
  \let\evenfooting = \relax
 
2341
  \let\oddfooting = \relax
 
2342
  \let\headings = \relax
 
2343
  \let\include = \relax
 
2344
  \let\lowersections = \relax
 
2345
  \let\down = \relax
 
2346
  \let\raisesections = \relax
 
2347
  \let\up = \relax
 
2348
  \let\set = \relax
 
2349
  \let\clear = \relax
 
2350
  \let\item = \relax
 
2351
}
 
2352
 
 
2353
% Ignore @ignore ... @end ignore.
 
2354
%
 
2355
\def\ignore{\doignore{ignore}}
 
2356
 
 
2357
% Ignore @ifinfo, @ifhtml, @ifnottex, @html, @menu, and @direntry text.
 
2358
%
 
2359
\def\ifinfo{\doignore{ifinfo}}
 
2360
\def\ifhtml{\doignore{ifhtml}}
 
2361
\def\ifnottex{\doignore{ifnottex}}
 
2362
\def\html{\doignore{html}}
 
2363
\def\menu{\doignore{menu}}
 
2364
\def\direntry{\doignore{direntry}}
 
2365
 
 
2366
% @dircategory CATEGORY  -- specify a category of the dir file
 
2367
% which this file should belong to.  Ignore this in TeX.
 
2368
\let\dircategory = \comment
 
2369
 
 
2370
% Ignore text until a line `@end #1'.
 
2371
%
 
2372
\def\doignore#1{\begingroup
 
2373
  % Don't complain about control sequences we have declared \outer.
 
2374
  \ignoresections
 
2375
  %
 
2376
  % Define a command to swallow text until we reach `@end #1'.
 
2377
  % This @ is a catcode 12 token (that is the normal catcode of @ in
 
2378
  % this texinfo.tex file).  We change the catcode of @ below to match.
 
2379
  \long\def\doignoretext##1@end #1{\enddoignore}%
 
2380
  %
 
2381
  % Make sure that spaces turn into tokens that match what \doignoretext wants.
 
2382
  \catcode32 = 10
 
2383
  %
 
2384
  % Ignore braces, too, so mismatched braces don't cause trouble.
 
2385
  \catcode`\{ = 9
 
2386
  \catcode`\} = 9
 
2387
  %
 
2388
  % We must not have @c interpreted as a control sequence.
 
2389
  \catcode`\@ = 12
 
2390
  %
 
2391
  % Make the letter c a comment character so that the rest of the line
 
2392
  % will be ignored. This way, the document can have (for example)
 
2393
  %   @c @end ifinfo
 
2394
  % and the @end ifinfo will be properly ignored.
 
2395
  % (We've just changed @ to catcode 12.)
 
2396
  \catcode`\c = 14
 
2397
  %
 
2398
  % And now expand that command.
 
2399
  \doignoretext
 
2400
}
 
2401
 
 
2402
% What we do to finish off ignored text.
 
2403
%
 
2404
\def\enddoignore{\endgroup\ignorespaces}%
 
2405
 
 
2406
\newif\ifwarnedobs\warnedobsfalse
 
2407
\def\obstexwarn{%
 
2408
  \ifwarnedobs\relax\else
 
2409
  % We need to warn folks that they may have trouble with TeX 3.0.
 
2410
  % This uses \immediate\write16 rather than \message to get newlines.
 
2411
    \immediate\write16{}
 
2412
    \immediate\write16{WARNING: for users of Unix TeX 3.0!}
 
2413
    \immediate\write16{This manual trips a bug in TeX version 3.0 (tex hangs).}
 
2414
    \immediate\write16{If you are running another version of TeX, relax.}
 
2415
    \immediate\write16{If you are running Unix TeX 3.0, kill this TeX process.}
 
2416
    \immediate\write16{  Then upgrade your TeX installation if you can.}
 
2417
    \immediate\write16{  (See ftp://ftp.gnu.org/pub/gnu/TeX.README.)}
 
2418
    \immediate\write16{If you are stuck with version 3.0, run the}
 
2419
    \immediate\write16{  script ``tex3patch'' from the Texinfo distribution}
 
2420
    \immediate\write16{  to use a workaround.}
 
2421
    \immediate\write16{}
 
2422
    \global\warnedobstrue
 
2423
    \fi
 
2424
}
 
2425
 
 
2426
% **In TeX 3.0, setting text in \nullfont hangs tex.  For a
 
2427
% workaround (which requires the file ``dummy.tfm'' to be installed),
 
2428
% uncomment the following line:
 
2429
%%%%%\font\nullfont=dummy\let\obstexwarn=\relax
 
2430
 
 
2431
% Ignore text, except that we keep track of conditional commands for
 
2432
% purposes of nesting, up to an `@end #1' command.
 
2433
%
 
2434
\def\nestedignore#1{%
 
2435
  \obstexwarn
 
2436
  % We must actually expand the ignored text to look for the @end
 
2437
  % command, so that nested ignore constructs work.  Thus, we put the
 
2438
  % text into a \vbox and then do nothing with the result.  To minimize
 
2439
  % the change of memory overflow, we follow the approach outlined on
 
2440
  % page 401 of the TeXbook: make the current font be a dummy font.
 
2441
  %
 
2442
  \setbox0 = \vbox\bgroup
 
2443
    % Don't complain about control sequences we have declared \outer.
 
2444
    \ignoresections
 
2445
    %
 
2446
    % Define `@end #1' to end the box, which will in turn undefine the
 
2447
    % @end command again.
 
2448
    \expandafter\def\csname E#1\endcsname{\egroup\ignorespaces}%
 
2449
    %
 
2450
    % We are going to be parsing Texinfo commands.  Most cause no
 
2451
    % trouble when they are used incorrectly, but some commands do
 
2452
    % complicated argument parsing or otherwise get confused, so we
 
2453
    % undefine them.
 
2454
    %
 
2455
    % We can't do anything about stray @-signs, unfortunately;
 
2456
    % they'll produce `undefined control sequence' errors.
 
2457
    \ignoremorecommands
 
2458
    %
 
2459
    % Set the current font to be \nullfont, a TeX primitive, and define
 
2460
    % all the font commands to also use \nullfont.  We don't use
 
2461
    % dummy.tfm, as suggested in the TeXbook, because not all sites
 
2462
    % might have that installed.  Therefore, math mode will still
 
2463
    % produce output, but that should be an extremely small amount of
 
2464
    % stuff compared to the main input.
 
2465
    %
 
2466
    \nullfont
 
2467
    \let\tenrm=\nullfont \let\tenit=\nullfont \let\tensl=\nullfont
 
2468
    \let\tenbf=\nullfont \let\tentt=\nullfont \let\smallcaps=\nullfont
 
2469
    \let\tensf=\nullfont
 
2470
    % Similarly for index fonts (mostly for their use in smallexample).
 
2471
    \let\smallrm=\nullfont \let\smallit=\nullfont \let\smallsl=\nullfont
 
2472
    \let\smallbf=\nullfont \let\smalltt=\nullfont \let\smallsc=\nullfont
 
2473
    \let\smallsf=\nullfont
 
2474
    %
 
2475
    % Don't complain when characters are missing from the fonts.
 
2476
    \tracinglostchars = 0
 
2477
    %
 
2478
    % Don't bother to do space factor calculations.
 
2479
    \frenchspacing
 
2480
    %
 
2481
    % Don't report underfull hboxes.
 
2482
    \hbadness = 10000
 
2483
    %
 
2484
    % Do minimal line-breaking.
 
2485
    \pretolerance = 10000
 
2486
    %
 
2487
    % Do not execute instructions in @tex
 
2488
    \def\tex{\doignore{tex}}%
 
2489
    % Do not execute macro definitions.
 
2490
    % `c' is a comment character, so the word `macro' will get cut off.
 
2491
    \def\macro{\doignore{ma}}%
 
2492
}
 
2493
 
 
2494
% @set VAR sets the variable VAR to an empty value.
 
2495
% @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE.
 
2496
%
 
2497
% Since we want to separate VAR from REST-OF-LINE (which might be
 
2498
% empty), we can't just use \parsearg; we have to insert a space of our
 
2499
% own to delimit the rest of the line, and then take it out again if we
 
2500
% didn't need it.  Make sure the catcode of space is correct to avoid
 
2501
% losing inside @example, for instance.
 
2502
%
 
2503
\def\set{\begingroup\catcode` =10
 
2504
  \catcode`\-=12 \catcode`\_=12 % Allow - and _ in VAR.
 
2505
  \parsearg\setxxx}
 
2506
\def\setxxx#1{\setyyy#1 \endsetyyy}
 
2507
\def\setyyy#1 #2\endsetyyy{%
 
2508
  \def\temp{#2}%
 
2509
  \ifx\temp\empty \global\expandafter\let\csname SET#1\endcsname = \empty
 
2510
  \else \setzzz{#1}#2\endsetzzz % Remove the trailing space \setxxx inserted.
 
2511
  \fi
 
2512
  \endgroup
 
2513
}
 
2514
% Can't use \xdef to pre-expand #2 and save some time, since \temp or
 
2515
% \next or other control sequences that we've defined might get us into
 
2516
% an infinite loop. Consider `@set foo @cite{bar}'.
 
2517
\def\setzzz#1#2 \endsetzzz{\expandafter\gdef\csname SET#1\endcsname{#2}}
 
2518
 
 
2519
% @clear VAR clears (i.e., unsets) the variable VAR.
 
2520
%
 
2521
\def\clear{\parsearg\clearxxx}
 
2522
\def\clearxxx#1{\global\expandafter\let\csname SET#1\endcsname=\relax}
 
2523
 
 
2524
% @value{foo} gets the text saved in variable foo.
 
2525
{
 
2526
  \catcode`\_ = \active
 
2527
  %
 
2528
  % We might end up with active _ or - characters in the argument if
 
2529
  % we're called from @code, as @code{@value{foo-bar_}}.  So \let any
 
2530
  % such active characters to their normal equivalents.
 
2531
  \gdef\value{\begingroup
 
2532
    \catcode`\-=12 \catcode`\_=12
 
2533
    \indexbreaks \let_\normalunderscore
 
2534
    \valuexxx}
 
2535
}
 
2536
\def\valuexxx#1{\expandablevalue{#1}\endgroup}
 
2537
 
 
2538
% We have this subroutine so that we can handle at least some @value's
 
2539
% properly in indexes (we \let\value to this in \indexdummies).  Ones
 
2540
% whose names contain - or _ still won't work, but we can't do anything
 
2541
% about that.  The command has to be fully expandable, since the result
 
2542
% winds up in the index file.  This means that if the variable's value
 
2543
% contains other Texinfo commands, it's almost certain it will fail
 
2544
% (although perhaps we could fix that with sufficient work to do a
 
2545
% one-level expansion on the result, instead of complete).
 
2546
%
 
2547
\def\expandablevalue#1{%
 
2548
  \expandafter\ifx\csname SET#1\endcsname\relax
 
2549
    {[No value for ``#1'']}%
 
2550
  \else
 
2551
    \csname SET#1\endcsname
 
2552
  \fi
 
2553
}
 
2554
 
 
2555
% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
 
2556
% with @set.
 
2557
%
 
2558
\def\ifset{\parsearg\ifsetxxx}
 
2559
\def\ifsetxxx #1{%
 
2560
  \expandafter\ifx\csname SET#1\endcsname\relax
 
2561
    \expandafter\ifsetfail
 
2562
  \else
 
2563
    \expandafter\ifsetsucceed
 
2564
  \fi
 
2565
}
 
2566
\def\ifsetsucceed{\conditionalsucceed{ifset}}
 
2567
\def\ifsetfail{\nestedignore{ifset}}
 
2568
\defineunmatchedend{ifset}
 
2569
 
 
2570
% @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been
 
2571
% defined with @set, or has been undefined with @clear.
 
2572
%
 
2573
\def\ifclear{\parsearg\ifclearxxx}
 
2574
\def\ifclearxxx #1{%
 
2575
  \expandafter\ifx\csname SET#1\endcsname\relax
 
2576
    \expandafter\ifclearsucceed
 
2577
  \else
 
2578
    \expandafter\ifclearfail
 
2579
  \fi
 
2580
}
 
2581
\def\ifclearsucceed{\conditionalsucceed{ifclear}}
 
2582
\def\ifclearfail{\nestedignore{ifclear}}
 
2583
\defineunmatchedend{ifclear}
 
2584
 
 
2585
% @iftex, @ifnothtml, @ifnotinfo always succeed; we read the text
 
2586
% following, through the first @end iftex (etc.).  Make `@end iftex'
 
2587
% (etc.) valid only after an @iftex.
 
2588
%
 
2589
\def\iftex{\conditionalsucceed{iftex}}
 
2590
\def\ifnothtml{\conditionalsucceed{ifnothtml}}
 
2591
\def\ifnotinfo{\conditionalsucceed{ifnotinfo}}
 
2592
\defineunmatchedend{iftex}
 
2593
\defineunmatchedend{ifnothtml}
 
2594
\defineunmatchedend{ifnotinfo}
 
2595
 
 
2596
% We can't just want to start a group at @iftex (for example) and end it
 
2597
% at @end iftex, since then @set commands inside the conditional have no
 
2598
% effect (they'd get reverted at the end of the group).  So we must
 
2599
% define \Eiftex to redefine itself to be its previous value.  (We can't
 
2600
% just define it to fail again with an ``unmatched end'' error, since
 
2601
% the @ifset might be nested.)
 
2602
%
 
2603
\def\conditionalsucceed#1{%
 
2604
  \edef\temp{%
 
2605
    % Remember the current value of \E#1.
 
2606
    \let\nece{prevE#1} = \nece{E#1}%
 
2607
    %
 
2608
    % At the `@end #1', redefine \E#1 to be its previous value.
 
2609
    \def\nece{E#1}{\let\nece{E#1} = \nece{prevE#1}}%
 
2610
  }%
 
2611
  \temp
 
2612
}
 
2613
 
 
2614
% We need to expand lots of \csname's, but we don't want to expand the
 
2615
% control sequences after we've constructed them.
 
2616
%
 
2617
\def\nece#1{\expandafter\noexpand\csname#1\endcsname}
 
2618
 
 
2619
% @defininfoenclose.
 
2620
\let\definfoenclose=\comment
 
2621
 
 
2622
 
2292
2623
\message{indexing,}
2293
2624
% Index generation facilities
2294
2625
 
2315
2646
}
2316
2647
 
2317
2648
% @defindex foo  ==  \newindex{foo}
2318
 
 
 
2649
%
2319
2650
\def\defindex{\parsearg\newindex}
2320
2651
 
2321
2652
% Define @defcodeindex, like @defindex except put all entries in @code.
2322
 
 
 
2653
%
 
2654
\def\defcodeindex{\parsearg\newcodeindex}
 
2655
%
2323
2656
\def\newcodeindex#1{%
2324
2657
  \iflinks
2325
2658
    \expandafter\newwrite \csname#1indfile\endcsname
2326
2659
    \openout \csname#1indfile\endcsname \jobname.#1
2327
2660
  \fi
2328
2661
  \expandafter\xdef\csname#1index\endcsname{%
2329
 
    \noexpand\docodeindex{#1}}
 
2662
    \noexpand\docodeindex{#1}}%
2330
2663
}
2331
2664
 
2332
 
\def\defcodeindex{\parsearg\newcodeindex}
2333
2665
 
2334
2666
% @synindex foo bar    makes index foo feed into index bar.
2335
2667
% Do this instead of @defindex foo if you don't want it as a separate index.
2336
 
% The \closeout helps reduce unnecessary open files; the limit on the
2337
 
% Acorn RISC OS is a mere 16 files.
2338
 
\def\synindex#1 #2 {%
2339
 
  \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
2340
 
  \expandafter\closeout\csname#1indfile\endcsname
2341
 
  \expandafter\let\csname#1indfile\endcsname=\synindexfoo
2342
 
  \expandafter\xdef\csname#1index\endcsname{% define \xxxindex
2343
 
    \noexpand\doindex{#2}}%
2344
 
}
2345
 
 
 
2668
2346
2669
% @syncodeindex foo bar   similar, but put all entries made for index foo
2347
2670
% inside @code.
2348
 
\def\syncodeindex#1 #2 {%
2349
 
  \expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
2350
 
  \expandafter\closeout\csname#1indfile\endcsname
2351
 
  \expandafter\let\csname#1indfile\endcsname=\synindexfoo
2352
 
  \expandafter\xdef\csname#1index\endcsname{% define \xxxindex
2353
 
    \noexpand\docodeindex{#2}}%
 
2671
 
2672
\def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}}
 
2673
\def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}}
 
2674
 
 
2675
% #1 is \doindex or \docodeindex, #2 the index getting redefined (foo),
 
2676
% #3 the target index (bar).
 
2677
\def\dosynindex#1#2#3{%
 
2678
  % Only do \closeout if we haven't already done it, else we'll end up
 
2679
  % closing the target index.
 
2680
  \expandafter \ifx\csname donesynindex#2\endcsname \undefined
 
2681
    % The \closeout helps reduce unnecessary open files; the limit on the
 
2682
    % Acorn RISC OS is a mere 16 files.
 
2683
    \expandafter\closeout\csname#2indfile\endcsname
 
2684
    \expandafter\let\csname\donesynindex#2\endcsname = 1
 
2685
  \fi
 
2686
  % redefine \fooindfile:
 
2687
  \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname
 
2688
  \expandafter\let\csname#2indfile\endcsname=\temp
 
2689
  % redefine \fooindex:
 
2690
  \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}%
2354
2691
}
2355
2692
 
2356
2693
% Define \doindex, the driver for all \fooindex macros.
2403
2740
\def\@{@}% will be @@ when we switch to @ as escape char.
2404
2741
% Need these in case \tex is in effect and \{ is a \delimiter again.
2405
2742
% But can't use \lbracecmd and \rbracecmd because texindex assumes
2406
 
% braces and backslashes are used only as delimiters.
 
2743
% braces and backslashes are used only as delimiters.  
2407
2744
\let\{ = \mylbrace
2408
2745
\let\} = \myrbrace
2409
2746
\def\_{{\realbackslash _}}%
2455
2792
\let\value = \expandablevalue
2456
2793
%
2457
2794
\unsepspaces
 
2795
% Turn off macro expansion
 
2796
\turnoffmacros
2458
2797
}
2459
2798
 
2460
2799
% If an index command is used in an @example environment, any spaces
2514
2853
\let\url=\indexdummyfont
2515
2854
\let\uref=\indexdummyfont
2516
2855
\let\env=\indexdummyfont
 
2856
\let\acronym=\indexdummyfont
2517
2857
\let\command=\indexdummyfont
2518
2858
\let\option=\indexdummyfont
2519
2859
\let\file=\indexdummyfont
2540
2880
\def\emptymacro{\empty}
2541
2881
 
2542
2882
% Most index entries go through here, but \dosubind is the general case.
2543
 
 
2883
%
2544
2884
\def\doind#1#2{\dosubind{#1}{#2}\empty}
2545
2885
 
2546
2886
% Workhorse for all \fooindexes.
2547
2887
% #1 is name of index, #2 is stuff to put there, #3 is subentry --
2548
2888
% \empty if called from \doind, as we usually are.  The main exception
2549
2889
% is with defuns, which call us directly.
2550
 
 
2890
%
2551
2891
\def\dosubind#1#2#3{%
2552
2892
  % Put the index entry in the margin if desired.
2553
2893
  \ifx\SETmarginindex\relax\else
2572
2912
          \def\subentry{ #3}%
2573
2913
        \fi
2574
2914
        %
2575
 
        % First process the index-string with all font commands turned off
2576
 
        % to get the string to sort by.
 
2915
        % First process the index entry with all font commands turned
 
2916
        % off to get the string to sort by.
2577
2917
        {\indexnofonts \xdef\indexsorttmp{#2\subentry}}%
2578
2918
        %
2579
 
        % Now produce the complete index entry, with both the sort key and the
2580
 
        % original text, including any font commands.
 
2919
        % Now the real index entry with the fonts.
2581
2920
        \toks0 = {#2}%
 
2921
        %
 
2922
        % If the third (subentry) arg is present, add it to the index
 
2923
        % line to write.
 
2924
        \ifx\thirdarg\emptymacro \else
 
2925
          \toks0 = \expandafter{\the\toks0{#3}}%
 
2926
        \fi
 
2927
        %
 
2928
        % Set up the complete index entry, with both the sort key and
 
2929
        % the original text, including any font commands.  We write
 
2930
        % three arguments to \entry to the .?? file (four in the
 
2931
        % subentry case), texindex reduces to two when writing the .??s
 
2932
        % sorted result.
2582
2933
        \edef\temp{%
2583
2934
          \write\csname#1indfile\endcsname{%
2584
2935
            \realbackslash entry{\indexsorttmp}{\folio}{\the\toks0}}%
2585
2936
        }%
2586
2937
        %
2587
 
        % If third (subentry) arg is present, add it to the index string.
2588
 
        \ifx\thirdarg\emptymacro \else
2589
 
          \toks0 = {#3}%
2590
 
          \edef\temp{\temp{\the\toks0}}%
2591
 
        \fi
2592
 
        %
2593
2938
        % If a skip is the last thing on the list now, preserve it
2594
2939
        % by backing up by \lastskip, doing the \write, then inserting
2595
2940
        % the skip again.  Otherwise, the whatsit generated by the
2601
2946
        % will have extra space inserted, because the \medbreak in the
2602
2947
        % start of the @defun won't see the skip inserted by the @end of
2603
2948
        % the previous defun.
2604
 
        % 
 
2949
        %
2605
2950
        % But don't do any of this if we're not in vertical mode.  We
2606
2951
        % don't want to do a \vskip and prematurely end a paragraph.
2607
 
        % 
 
2952
        %
2608
2953
        % Avoid page breaks due to these extra skips, too.
2609
 
        % 
 
2954
        %
2610
2955
        \iflinks
2611
2956
          \ifvmode
2612
2957
            \skip0 = \lastskip
2615
2960
          %
2616
2961
          \temp % do the write
2617
2962
          %
2618
 
          % 
 
2963
          %
2619
2964
          \ifvmode \ifdim\skip0 = 0pt \else \nobreak\vskip\skip0 \fi \fi
2620
2965
        \fi
2621
2966
      }%
2663
3008
\def\doprintindex#1{\begingroup
2664
3009
  \dobreak \chapheadingskip{10000}%
2665
3010
  %
2666
 
  \indexfonts \rm
 
3011
  \smallfonts \rm
2667
3012
  \tolerance = 9500
2668
3013
  \indexbreaks
2669
3014
  %
2679
3024
    % and it loses the chapter title and the aux file entries for the
2680
3025
    % index.  The easiest way to prevent this problem is to make sure
2681
3026
    % there is some text.
2682
 
    (Index is nonexistent)
 
3027
    \putwordIndexNonexistent
2683
3028
  \else
2684
3029
    %
2685
3030
    % If the index file exists but is empty, then \openin leaves \ifeof
2687
3032
    % it can discover if there is anything in it.
2688
3033
    \read 1 to \temp
2689
3034
    \ifeof 1
2690
 
      (Index is empty)
 
3035
      \putwordIndexIsEmpty
2691
3036
    \else
2692
3037
      % Index files are almost Texinfo source, but we use \ as the escape
2693
3038
      % character.  It would be better to use @, but that's too big a change
2712
3057
  %
2713
3058
  % Remove any glue we may have, we'll be inserting our own.
2714
3059
  \removelastskip
2715
 
  % 
 
3060
  %
2716
3061
  % We like breaks before the index initials, so insert a bonus.
2717
3062
  \penalty -300
2718
3063
  %
2720
3065
  % baselineskips increases the chance of the dots lining up from column
2721
3066
  % to column.  It still won't often be perfect, because of the stretch
2722
3067
  % we need before each entry, but it's better.
2723
 
  % 
 
3068
  %
2724
3069
  % No shrink because it confuses \balancecolumns.
2725
3070
  \vskip 1.67\baselineskip plus .5\baselineskip
2726
3071
  \leftline{\secbf #1}%
2790
3135
    % The `\ ' here is removed by the implicit \unskip that TeX does as
2791
3136
    % part of (the primitive) \par.  Without it, a spurious underfull
2792
3137
    % \hbox ensues.
2793
 
    \ #2% The page number ends the paragraph.
 
3138
    \ifpdf
 
3139
      \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph.
 
3140
    \else
 
3141
      \ #2% The page number ends the paragraph.
 
3142
    \fi
2794
3143
  \fi%
2795
3144
  \par
2796
3145
\endgroup}
2802
3151
\def\primary #1{\line{#1\hfil}}
2803
3152
 
2804
3153
\newskip\secondaryindent \secondaryindent=0.5cm
2805
 
 
2806
 
\def\secondary #1#2{
2807
 
{\parfillskip=0in \parskip=0in
2808
 
\hangindent =1in \hangafter=1
2809
 
\noindent\hskip\secondaryindent\hbox{#1}\indexdotfill #2\par
 
3154
\def\secondary#1#2{{%
 
3155
  \parfillskip=0in
 
3156
  \parskip=0in
 
3157
  \hangindent=1in
 
3158
  \hangafter=1
 
3159
  \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill
 
3160
  \ifpdf
 
3161
    \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph.
 
3162
  \else
 
3163
    #2
 
3164
  \fi
 
3165
  \par
2810
3166
}}
2811
3167
 
2812
3168
% Define two-column mode, which we use to typeset indexes.
2819
3175
 
2820
3176
\def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
2821
3177
  % Grab any single-column material above us.
2822
 
  \output = {\global\setbox\partialpage = \vbox{%
2823
 
    % 
 
3178
  \output = {%
 
3179
    %
2824
3180
    % Here is a possibility not foreseen in manmac: if we accumulate a
2825
3181
    % whole lot of material, we might end up calling this \output
2826
3182
    % routine twice in a row (see the doublecol-lose test, which is
2827
3183
    % essentially a couple of indexes with @setchapternewpage off).  In
2828
 
    % that case, we must prevent the second \partialpage from
2829
 
    % simply overwriting the first, causing us to lose the page.
2830
 
    % This will preserve it until a real output routine can ship it
2831
 
    % out.  Generally, \partialpage will be empty when this runs and
2832
 
    % this will be a no-op.
2833
 
    \unvbox\partialpage
 
3184
    % that case we just ship out what is in \partialpage with the normal
 
3185
    % output routine.  Generally, \partialpage will be empty when this
 
3186
    % runs and this will be a no-op.  See the indexspread.tex test case.
 
3187
    \ifvoid\partialpage \else
 
3188
      \onepageout{\pagecontents\partialpage}%
 
3189
    \fi
2834
3190
    %
2835
 
    % Unvbox the main output page.
2836
 
    \unvbox255
2837
 
    \kern-\topskip \kern\baselineskip
2838
 
  }}%
 
3191
    \global\setbox\partialpage = \vbox{%
 
3192
      % Unvbox the main output page.
 
3193
      \unvbox\PAGE
 
3194
      \kern-\topskip \kern\baselineskip
 
3195
    }%
 
3196
  }%
2839
3197
  \eject % run that output routine to set \partialpage
2840
3198
  %
2841
3199
  % Use the double-column output routine for subsequent pages.
2864
3222
  %
2865
3223
  % Double the \vsize as well.  (We don't need a separate register here,
2866
3224
  % since nobody clobbers \vsize.)
2867
 
  \advance\vsize by -\ht\partialpage
2868
3225
  \vsize = 2\vsize
2869
3226
}
2870
3227
 
2871
3228
% The double-column output routine for all double-column pages except
2872
3229
% the last.
2873
 
 
3230
%
2874
3231
\def\doublecolumnout{%
2875
3232
  \splittopskip=\topskip \splitmaxdepth=\maxdepth
2876
3233
  % Get the available space for the double columns -- the normal
2878
3235
  % previous page.
2879
3236
  \dimen@ = \vsize
2880
3237
  \divide\dimen@ by 2
 
3238
  \advance\dimen@ by -\ht\partialpage
2881
3239
  %
2882
3240
  % box0 will be the left-hand column, box2 the right.
2883
3241
  \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
2885
3243
  \unvbox255
2886
3244
  \penalty\outputpenalty
2887
3245
}
 
3246
%
 
3247
% Re-output the contents of the output page -- any previous material,
 
3248
% followed by the two boxes we just split, in box0 and box2.
2888
3249
\def\pagesofar{%
2889
 
  % Re-output the contents of the output page -- any previous material,
2890
 
  % followed by the two boxes we just split, in box0 and box2.
2891
 
  \advance\vsize by \ht\partialpage
2892
3250
  \unvbox\partialpage
2893
3251
  %
2894
3252
  \hsize = \doublecolumnhsize
2895
3253
  \wd0=\hsize \wd2=\hsize
2896
3254
  \hbox to\pagewidth{\box0\hfil\box2}%
2897
3255
}
 
3256
 
3257
% All done with double columns.
2898
3258
\def\enddoublecolumns{%
2899
3259
  \output = {%
2900
3260
    % Split the last of the double-column material.  Leave it on the
2919
3279
  % \endgroup where \vsize got restored).
2920
3280
  \pagegoal = \vsize
2921
3281
}
 
3282
%
 
3283
% Called at the end of the double column material.
2922
3284
\def\balancecolumns{%
2923
 
  % Called at the end of the double column material.
2924
3285
  \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120.
2925
3286
  \dimen@ = \ht0
2926
3287
  \advance\dimen@ by \topskip
2948
3309
 
2949
3310
 
2950
3311
\message{sectioning,}
2951
 
% Define chapters, sections, etc.
 
3312
% Chapters, sections, etc.
2952
3313
 
2953
3314
\newcount\chapno
2954
3315
\newcount\secno        \secno=0
2957
3318
 
2958
3319
% This counter is funny since it counts through charcodes of letters A, B, ...
2959
3320
\newcount\appendixno  \appendixno = `\@
2960
 
\def\appendixletter{\char\the\appendixno}
 
3321
% \def\appendixletter{\char\the\appendixno}
 
3322
% We do the following for the sake of pdftex, which needs the actual
 
3323
% letter in the expansion, not just typeset.
 
3324
\def\appendixletter{%
 
3325
  \ifnum\appendixno=`A A%
 
3326
  \else\ifnum\appendixno=`B B%
 
3327
  \else\ifnum\appendixno=`C C%
 
3328
  \else\ifnum\appendixno=`D D%
 
3329
  \else\ifnum\appendixno=`E E%
 
3330
  \else\ifnum\appendixno=`F F%
 
3331
  \else\ifnum\appendixno=`G G%
 
3332
  \else\ifnum\appendixno=`H H%
 
3333
  \else\ifnum\appendixno=`I I%
 
3334
  \else\ifnum\appendixno=`J J%
 
3335
  \else\ifnum\appendixno=`K K%
 
3336
  \else\ifnum\appendixno=`L L%
 
3337
  \else\ifnum\appendixno=`M M%
 
3338
  \else\ifnum\appendixno=`N N%
 
3339
  \else\ifnum\appendixno=`O O%
 
3340
  \else\ifnum\appendixno=`P P%
 
3341
  \else\ifnum\appendixno=`Q Q%
 
3342
  \else\ifnum\appendixno=`R R%
 
3343
  \else\ifnum\appendixno=`S S%
 
3344
  \else\ifnum\appendixno=`T T%
 
3345
  \else\ifnum\appendixno=`U U%
 
3346
  \else\ifnum\appendixno=`V V%
 
3347
  \else\ifnum\appendixno=`W W%
 
3348
  \else\ifnum\appendixno=`X X%
 
3349
  \else\ifnum\appendixno=`Y Y%
 
3350
  \else\ifnum\appendixno=`Z Z%
 
3351
  % The \the is necessary, despite appearances, because \appendixletter is
 
3352
  % expanded while writing the .toc file.  \char\appendixno is not
 
3353
  % expandable, thus it is written literally, thus all appendixes come out
 
3354
  % with the same letter (or @) in the toc without it.
 
3355
  \else\char\the\appendixno
 
3356
  \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi
 
3357
  \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi}
2961
3358
 
2962
3359
% Each @chapter defines this as the name of the chapter.
2963
3360
% page headings and footings can use it.  @section does likewise.
3430
3827
 
3431
3828
 
3432
3829
\message{toc,}
 
3830
% Table of contents.
3433
3831
\newwrite\tocfile
3434
3832
 
3435
3833
% Write an entry to the toc file, opening it if necessary.
3436
3834
% Called from @chapter, etc.  We supply {\folio} at the end of the
3437
3835
% argument, which will end up as the last argument to the \...entry macro.
3438
 
 
3836
%
3439
3837
% We open the .toc file here instead of at @setfilename or any other
3440
3838
% given time so that @contents can be put in the document anywhere.
3441
 
 
3839
%
3442
3840
\newif\iftocfileopened
3443
3841
\def\writetocentry#1{%
3444
3842
  \iftocfileopened\else
3454
3852
 
3455
3853
% Finish up the main text and prepare to read what we've written
3456
3854
% to \tocfile.
3457
 
 
3855
%
3458
3856
\def\startcontents#1{%
3459
3857
   % If @setchapternewpage on, and @headings double, the contents should
3460
3858
   % start on an odd page, unlike chapters.  Thus, we maintain
3482
3880
 
3483
3881
% Normal (long) toc.
3484
3882
\def\contents{%
3485
 
   \startcontents{\putwordTableofContents}%
 
3883
   \startcontents{\putwordTOC}%
3486
3884
     \openin 1 \jobname.toc
3487
3885
     \ifeof 1 \else
3488
3886
       \closein 1
3489
3887
       \input \jobname.toc
3490
3888
     \fi
3491
3889
     \vfill \eject
 
3890
     \contentsalignmacro % in case @setchapternewpage odd is in effect
 
3891
     \pdfmakeoutlines
3492
3892
   \endgroup
3493
3893
   \lastnegativepageno = \pageno
3494
3894
   \pageno = \savepageno
3496
3896
 
3497
3897
% And just the chapters.
3498
3898
\def\summarycontents{%
3499
 
   \startcontents{\putwordShortContents}%
 
3899
   \startcontents{\putwordShortTOC}%
3500
3900
      %
3501
3901
      \let\chapentry = \shortchapentry
3502
3902
      \let\unnumbchapentry = \shortunnumberedentry
3518
3918
        \input \jobname.toc
3519
3919
      \fi
3520
3920
     \vfill \eject
 
3921
     \contentsalignmacro % in case @setchapternewpage odd is in effect
3521
3922
   \endgroup
3522
3923
   \lastnegativepageno = \pageno
3523
3924
   \pageno = \savepageno
3524
3925
}
3525
3926
\let\shortcontents = \summarycontents
3526
3927
 
 
3928
\ifpdf
 
3929
  \pdfcatalog{/PageMode /UseOutlines}%
 
3930
\fi
 
3931
 
3527
3932
% These macros generate individual entries in the table of contents.
3528
3933
% The first argument is the chapter or section name.
3529
3934
% The last argument is the page number.
3534
3939
 
3535
3940
% See comments in \dochapentry re vbox and related settings
3536
3941
\def\shortchapentry#1#2#3{%
3537
 
  \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno{#3}}%
 
3942
  \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#3\egroup}%
3538
3943
}
3539
3944
 
3540
3945
% Typeset the label for a chapter or appendix for the short contents.
3542
3947
% We could simplify the code here by writing out an \appendixentry
3543
3948
% command in the toc file for appendices, instead of using \chapentry
3544
3949
% for both, but it doesn't seem worth it.
3545
 
\setbox0 = \hbox{\shortcontrm \putwordAppendix }
3546
 
\newdimen\shortappendixwidth \shortappendixwidth = \wd0
3547
 
 
 
3950
%
 
3951
\newdimen\shortappendixwidth
 
3952
%
3548
3953
\def\shortchaplabel#1{%
 
3954
  % Compute width of word "Appendix", may change with language.
 
3955
  \setbox0 = \hbox{\shortcontrm \putwordAppendix}%
 
3956
  \shortappendixwidth = \wd0
 
3957
  %
3549
3958
  % We typeset #1 in a box of constant width, regardless of the text of
3550
3959
  % #1, so the chapter titles will come out aligned.
3551
3960
  \setbox0 = \hbox{#1}%
3560
3969
}
3561
3970
 
3562
3971
\def\unnumbchapentry#1#2{\dochapentry{#1}{#2}}
3563
 
\def\shortunnumberedentry#1#2{\tocentry{#1}{\doshortpageno{#2}}}
 
3972
\def\shortunnumberedentry#1#2{\tocentry{#1}{\doshortpageno\bgroup#2\egroup}}
3564
3973
 
3565
3974
% Sections.
3566
3975
\def\secentry#1#2#3#4{\dosecentry{#2.#3\labelspace#1}{#4}}
3587
3996
   \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip
3588
3997
   \begingroup
3589
3998
     \chapentryfonts
3590
 
     \tocentry{#1}{\dopageno{#2}}%
 
3999
     \tocentry{#1}{\dopageno\bgroup#2\egroup}%
3591
4000
   \endgroup
3592
4001
   \nobreak\vskip .25\baselineskip plus.1\baselineskip
3593
4002
}
3594
4003
 
3595
4004
\def\dosecentry#1#2{\begingroup
3596
4005
  \secentryfonts \leftskip=\tocindent
3597
 
  \tocentry{#1}{\dopageno{#2}}%
 
4006
  \tocentry{#1}{\dopageno\bgroup#2\egroup}%
3598
4007
\endgroup}
3599
4008
 
3600
4009
\def\dosubsecentry#1#2{\begingroup
3601
4010
  \subsecentryfonts \leftskip=2\tocindent
3602
 
  \tocentry{#1}{\dopageno{#2}}%
 
4011
  \tocentry{#1}{\dopageno\bgroup#2\egroup}%
3603
4012
\endgroup}
3604
4013
 
3605
4014
\def\dosubsubsecentry#1#2{\begingroup
3606
4015
  \subsubsecentryfonts \leftskip=3\tocindent
3607
 
  \tocentry{#1}{\dopageno{#2}}%
 
4016
  \tocentry{#1}{\dopageno\bgroup#2\egroup}%
3608
4017
\endgroup}
3609
4018
 
3610
4019
% Final typesetting of a toc entry; we use the same \entry macro as for
3632
4041
 
3633
4042
 
3634
4043
\message{environments,}
 
4044
% @foo ... @end foo.
3635
4045
 
3636
4046
% Since these characters are used in examples, it should be an even number of
3637
4047
% \tt widths. Each \tt character is 1en, so two makes it 1em.
3747
4157
% is reset to zero; thus the \afterenvbreak inserts no space -- but the
3748
4158
% start of the next paragraph will insert \parskip
3749
4159
%
3750
 
\def\aboveenvbreak{{\advance\envskipamount by \parskip
3751
 
\endgraf \ifdim\lastskip<\envskipamount
3752
 
\removelastskip \penalty-50 \vskip\envskipamount \fi}}
 
4160
\def\aboveenvbreak{{%
 
4161
  \ifnum\lastpenalty < 10000
 
4162
    \advance\envskipamount by \parskip
 
4163
    \endgraf
 
4164
    \ifdim\lastskip<\envskipamount
 
4165
      \removelastskip
 
4166
      \penalty-50
 
4167
      \vskip\envskipamount
 
4168
    \fi
 
4169
  \fi
 
4170
}}
3753
4171
 
3754
4172
\let\afterenvbreak = \aboveenvbreak
3755
4173
 
3842
4260
 
3843
4261
% Define the \E... control sequence only if we are inside the particular
3844
4262
% environment, so the error checking in \end will work.
3845
 
 
4263
%
3846
4264
% To end an @example-like environment, we first end the paragraph (via
3847
4265
% \afterenvbreak's vertical glue), and then the group.  That way we keep
3848
4266
% the zero \parskip that the environments set -- \parskip glue will be
3867
4285
% redefines).  We must call \example (or whatever) last in the
3868
4286
% definition, since it reads the return following the @example (or
3869
4287
% whatever) command.
3870
 
 
4288
%
3871
4289
% This actually allows (for example) @end display inside an
3872
4290
% @smalldisplay.  Too bad, but makeinfo will catch the error anyway.
3873
4291
%
3881
4299
\def\smalllispx{\begingroup
3882
4300
  \def\Esmalllisp{\nonfillfinish\endgroup}%
3883
4301
  \def\Esmallexample{\nonfillfinish\endgroup}%
3884
 
  \indexfonts
 
4302
  \smallfonts
3885
4303
  \lisp
3886
4304
}
3887
4305
 
3897
4315
%
3898
4316
\def\smalldisplayx{\begingroup
3899
4317
  \def\Esmalldisplay{\nonfillfinish\endgroup}%
3900
 
  \indexfonts \rm
 
4318
  \smallfonts \rm
3901
4319
  \display
3902
4320
}
3903
4321
 
3914
4332
%
3915
4333
\def\smallformatx{\begingroup
3916
4334
  \def\Esmallformat{\nonfillfinish\endgroup}%
3917
 
  \indexfonts \rm
 
4335
  \smallfonts \rm
3918
4336
  \format
3919
4337
}
3920
4338
 
3923
4341
\def\flushleft{\begingroup \def\Eflushleft{\nonfillfinish\endgroup}\format}
3924
4342
 
3925
4343
% @flushright.
3926
 
 
4344
%
3927
4345
\def\flushright{\begingroup
3928
4346
  \let\nonarrowing = t
3929
4347
  \nonfillstart
3932
4350
  \gobble
3933
4351
}
3934
4352
 
 
4353
 
3935
4354
% @quotation does normal linebreaking (hence we can't use \nonfillstart)
3936
4355
% and narrows the margins.
3937
4356
%
3954
4373
}
3955
4374
 
3956
4375
 
 
4376
% LaTeX-like @verbatim...@end verbatim and @verb{<char>...<char>}
 
4377
% If we want to allow any <char> as delimiter, 
 
4378
% we need the curly braces so that makeinfo sees the @verb command, eg:
 
4379
% `@verbx...x' would look like the '@verbx' command.  --janneke@gnu.org
 
4380
%
 
4381
% [Knuth]: Donald Ervin Knuth, 1996.  The TeXbook.
 
4382
%
 
4383
% [Knuth] p. 344; only we need to do '@' too
 
4384
\def\dospecials{%
 
4385
  \do\ \do\\\do\@\do\{\do\}\do\$\do\&%
 
4386
  \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~}
 
4387
%
 
4388
% [Knuth] p. 380
 
4389
\def\uncatcodespecials{%
 
4390
  \def\do##1{\catcode`##1=12}\dospecials}
 
4391
%
 
4392
% [Knuth] pp. 380,381,391
 
4393
% Disable Spanish ligatures ?` and !` of \tt font
 
4394
\begingroup
 
4395
  \catcode`\`=\active\gdef`{\relax\lq}
 
4396
\endgroup
 
4397
%
 
4398
% Setup for the @verb command.
 
4399
%
 
4400
% Eight spaces for a tab
 
4401
\begingroup
 
4402
  \catcode`\^^I=\active
 
4403
  \gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }}
 
4404
\endgroup
 
4405
%
 
4406
\def\setupverb{%
 
4407
  \tt  % easiest (and conventionally used) font for verbatim
 
4408
  \def\par{\leavevmode\endgraf}%
 
4409
  \catcode`\`=\active
 
4410
  \tabeightspaces
 
4411
  % Respect line breaks,
 
4412
  % print special symbols as themselves, and
 
4413
  % make each space count
 
4414
  % must do in this order:
 
4415
  \obeylines \uncatcodespecials \sepspaces
 
4416
}
 
4417
 
 
4418
% Setup for the @verbatim environment
 
4419
%
 
4420
% Real tab expansion
 
4421
\newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount
 
4422
%
 
4423
\def\starttabbox{\setbox0=\hbox\bgroup}
 
4424
\begingroup
 
4425
  \catcode`\^^I=\active
 
4426
  \gdef\tabexpand{%
 
4427
    \catcode`\^^I=\active
 
4428
    \def^^I{\leavevmode\egroup
 
4429
      \dimen0=\wd0 % the width so far, or since the previous tab
 
4430
      \divide\dimen0 by\tabw
 
4431
      \multiply\dimen0 by\tabw % compute previous multiple of \tabw
 
4432
      \advance\dimen0 by\tabw  % advance to next multiple of \tabw
 
4433
      \wd0=\dimen0 \box0 \starttabbox
 
4434
    }%
 
4435
  }
 
4436
\endgroup
 
4437
\def\setupverbatim{%
 
4438
  % Easiest (and conventionally used) font for verbatim
 
4439
  \tt
 
4440
  \def\par{\leavevmode\egroup\box0\endgraf}%
 
4441
  \catcode`\`=\active
 
4442
  \tabexpand
 
4443
  % Respect line breaks,
 
4444
  % print special symbols as themselves, and
 
4445
  % make each space count
 
4446
  % must do in this order:
 
4447
  \obeylines \uncatcodespecials \sepspaces
 
4448
  \everypar{\starttabbox}%
 
4449
}
 
4450
 
 
4451
% Do the @verb magic: verbatim text is quoted by unique 
 
4452
% delimiter characters.  Before first delimiter expect a 
 
4453
% right brace, after last delimiter expect closing brace:
 
4454
%
 
4455
%    \def\doverb'{'<char>#1<char>'}'{#1}
 
4456
%
 
4457
% [Knuth] p. 382; only eat outer {}
 
4458
\begingroup
 
4459
  \catcode`[=1\catcode`]=2\catcode`\{=12\catcode`\}=12
 
4460
  \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next]
 
4461
\endgroup
 
4462
%
 
4463
\def\verb{\begingroup\setupverb\doverb}
 
4464
%
 
4465
%
 
4466
% Do the @verbatim magic: define the macro \doverbatim so that
 
4467
% the (first) argument ends when '@end verbatim' is reached, ie:
 
4468
%
 
4469
%     \def\doverbatim#1@end verbatim{#1}
 
4470
%
 
4471
% For Texinfo it's a lot easier than for LaTeX, 
 
4472
% because texinfo's \verbatim doesn't stop at '\end{verbatim}':
 
4473
% we need not redefine '\', '{' and '}'
 
4474
%
 
4475
% Inspired by LaTeX's verbatim command set [latex.ltx]
 
4476
%% Include LaTeX hack for completeness -- never know
 
4477
%% \begingroup
 
4478
%% \catcode`|=0 \catcode`[=1
 
4479
%% \catcode`]=2\catcode`\{=12\catcode`\}=12\catcode`\ =\active
 
4480
%% \catcode`\\=12|gdef|doverbatim#1@end verbatim[
 
4481
%% #1|endgroup|def|Everbatim[]|end[verbatim]]
 
4482
%% |endgroup
 
4483
\begingroup
 
4484
  \catcode`\ =\active
 
4485
  \gdef\doverbatim#1@end verbatim{#1\end{verbatim}}
 
4486
\endgroup
 
4487
%
 
4488
\def\verbatim{%
 
4489
  \def\Everbatim{\nonfillfinish\endgroup}%
 
4490
  \begingroup
 
4491
    \nonfillstart
 
4492
    \advance\leftskip by -\defbodyindent
 
4493
    \begingroup\setupverbatim\doverbatim
 
4494
}
 
4495
 
 
4496
% @verbatiminclude FILE - insert text of file in verbatim environment.
 
4497
%
 
4498
% Allow normal characters that we make active in the argument (a file name).
 
4499
\def\verbatiminclude{%
 
4500
  \begingroup
 
4501
    \catcode`\\=12
 
4502
    \catcode`~=12
 
4503
    \catcode`^=12
 
4504
    \catcode`_=12
 
4505
    \catcode`|=12
 
4506
    \catcode`<=12
 
4507
    \catcode`>=12
 
4508
    \catcode`+=12
 
4509
    \parsearg\doverbatiminclude
 
4510
}
 
4511
\def\setupverbatiminclude{%
 
4512
  \begingroup
 
4513
    \nonfillstart
 
4514
    \advance\leftskip by -\defbodyindent
 
4515
    \begingroup\setupverbatim
 
4516
}
 
4517
%
 
4518
\def\doverbatiminclude#1{%
 
4519
     % Restore active chars for included file.
 
4520
  \endgroup
 
4521
  \begingroup
 
4522
  \def\thisfile{#1}%
 
4523
  \expandafter\expandafter\setupverbatiminclude\input\thisfile
 
4524
  \endgroup\nonfillfinish\endgroup
 
4525
}
 
4526
 
 
4527
 
3957
4528
\message{defuns,}
3958
 
% Define formatter for defuns
3959
 
% First, allow user to change definition object font (\df) internally
 
4529
% @defun etc.
 
4530
 
 
4531
% Allow user to change definition object font (\df) internally
3960
4532
\def\setdeffont #1 {\csname DEF#1\endcsname}
3961
4533
 
3962
4534
\newskip\defbodyindent \defbodyindent=.4in
4010
4582
%% contained text.  This is especially needed for [ and ]
4011
4583
\def\opnr{{\sf\char`\(}\global\advance\parencount by 1 }
4012
4584
\def\clnr{{\sf\char`\)}\global\advance\parencount by -1 }
4013
 
\def\ampnr{\&}
 
4585
\let\ampnr = \&
4014
4586
\def\lbrb{{\bf\char`\[}}
4015
4587
\def\rbrb{{\bf\char`\]}}
4016
4588
 
 
4589
% Active &'s sneak into the index arguments, so make sure it's defined.
 
4590
{
 
4591
  \catcode`& = 13
 
4592
  \global\let& = \ampnr
 
4593
}
 
4594
 
4017
4595
% First, defname, which formats the header line itself.
4018
4596
% #1 should be the function name.
4019
4597
% #2 should be the type of definition, such as "Function".
4065
4643
% #2 is the \...x control sequence for consecutive fns (which we define).
4066
4644
% #3 is the control sequence to call to resume processing.
4067
4645
% #4, delimited by the space, is the class name.
4068
 
 
4646
%
4069
4647
\def\defmethparsebody#1#2#3#4 {\begingroup\inENV %
4070
4648
\medbreak %
4071
4649
% Define the end token that this defining construct specifies
4077
4655
\exdentamount=\defbodyindent
4078
4656
\begingroup\obeylines\activeparens\spacesplit{#3{#4}}}
4079
4657
 
4080
 
% @deftypemethod has an extra argument that nothing else does.  Sigh.
 
4658
% Used for @deftypemethod and @deftypeivar.
4081
4659
% #1 is the \E... control sequence to end the definition (which we define).
4082
4660
% #2 is the \...x control sequence for consecutive fns (which we define).
4083
4661
% #3 is the control sequence to call to resume processing.
4084
 
% #4, delimited by the space, is the class name.
 
4662
% #4, delimited by a space, is the class name.
4085
4663
% #5 is the method's return type.
 
4664
%
 
4665
\def\deftypemethparsebody#1#2#3#4 #5 {\begingroup\inENV
 
4666
  \medbreak
 
4667
  \def#1{\endgraf\endgroup\medbreak}%
 
4668
  \def#2##1 ##2 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}{##2}}}%
 
4669
  \parindent=0in
 
4670
  \advance\leftskip by \defbodyindent
 
4671
  \exdentamount=\defbodyindent
 
4672
  \begingroup\obeylines\activeparens\spacesplit{#3{#4}{#5}}}
 
4673
 
 
4674
% Used for @deftypeop.  The change from \deftypemethparsebody is an
 
4675
% extra argument at the beginning which is the `category', instead of it
 
4676
% being the hardwired string `Method' or `Instance Variable'.  We have
 
4677
% to account for this both in the \...x definition and in parsing the
 
4678
% input at hand.  Thus also need a control sequence (passed as #5) for
 
4679
% the \E... definition to assign the category name to.
4086
4680
4087
 
\def\deftypemethparsebody#1#2#3#4 #5 {\begingroup\inENV %
4088
 
\medbreak %
4089
 
% Define the end token that this defining construct specifies
4090
 
% so that it will exit this group.
4091
 
\def#1{\endgraf\endgroup\medbreak}%
4092
 
\def#2##1 ##2 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}{##2}}}%
4093
 
\parindent=0in
4094
 
\advance\leftskip by \defbodyindent
4095
 
\exdentamount=\defbodyindent
4096
 
\begingroup\obeylines\activeparens\spacesplit{#3{#4}{#5}}}
 
4681
\def\deftypeopparsebody#1#2#3#4#5 #6 {\begingroup\inENV
 
4682
  \medbreak
 
4683
  \def#1{\endgraf\endgroup\medbreak}%
 
4684
  \def#2##1 ##2 ##3 {%
 
4685
    \def#4{##1}%
 
4686
    \begingroup\obeylines\activeparens\spacesplit{#3{##2}{##3}}}%
 
4687
  \parindent=0in
 
4688
  \advance\leftskip by \defbodyindent
 
4689
  \exdentamount=\defbodyindent
 
4690
  \begingroup\obeylines\activeparens\spacesplit{#3{#5}{#6}}}
4097
4691
 
4098
4692
\def\defopparsebody #1#2#3#4#5 {\begingroup\inENV %
4099
4693
\medbreak %
4204
4798
% First, define the processing that is wanted for arguments of \defun
4205
4799
% Use this to expand the args and terminate the paragraph they make up
4206
4800
 
4207
 
\def\defunargs #1{\functionparens \sl
 
4801
\def\defunargs#1{\functionparens \sl
4208
4802
% Expand, preventing hyphenation at `-' chars.
4209
4803
% Note that groups don't affect changes in \hyphenchar.
4210
 
\hyphenchar\tensl=0
 
4804
% Set the font temporarily and use \font in case \setfont made \tensl a macro.
 
4805
{\tensl\hyphenchar\font=0}%
4211
4806
#1%
4212
 
\hyphenchar\tensl=45
 
4807
{\tensl\hyphenchar\font=45}%
4213
4808
\ifnum\parencount=0 \else \errmessage{Unbalanced parentheses in @def}\fi%
4214
4809
\interlinepenalty=10000
4215
4810
\advance\rightskip by 0pt plus 1fil
4243
4838
\def\defun{\defparsebody\Edefun\defunx\defunheader}
4244
4839
 
4245
4840
\def\defunheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
4246
 
\begingroup\defname {#1}{Function}%
 
4841
\begingroup\defname {#1}{\putwordDeffunc}%
4247
4842
\defunargs {#2}\endgroup %
4248
4843
\catcode 61=\other % Turn off change made in \defparsebody
4249
4844
}
4257
4852
% #1 is the data type, #2 the name, #3 the args.
4258
4853
\def\deftypefunheaderx #1#2 #3\relax{%
4259
4854
\doind {fn}{\code{#2}}% Make entry in function index
4260
 
\begingroup\defname {\defheaderxcond#1\relax$$$#2}{Function}%
 
4855
\begingroup\defname {\defheaderxcond#1\relax$$$#2}{\putwordDeftypefun}%
4261
4856
\deftypefunargs {#3}\endgroup %
4262
4857
\catcode 61=\other % Turn off change made in \defparsebody
4263
4858
}
4288
4883
\def\defmac{\defparsebody\Edefmac\defmacx\defmacheader}
4289
4884
 
4290
4885
\def\defmacheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
4291
 
\begingroup\defname {#1}{Macro}%
 
4886
\begingroup\defname {#1}{\putwordDefmac}%
4292
4887
\defunargs {#2}\endgroup %
4293
4888
\catcode 61=\other % Turn off change made in \defparsebody
4294
4889
}
4298
4893
\def\defspec{\defparsebody\Edefspec\defspecx\defspecheader}
4299
4894
 
4300
4895
\def\defspecheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
4301
 
\begingroup\defname {#1}{Special Form}%
 
4896
\begingroup\defname {#1}{\putwordDefspec}%
4302
4897
\defunargs {#2}\endgroup %
4303
4898
\catcode 61=\other % Turn off change made in \defparsebody
4304
4899
}
4305
4900
 
4306
 
% This definition is run if you use @defunx
4307
 
% anywhere other than immediately after a @defun or @defunx.
4308
 
 
4309
 
\def\deffnx #1 {\errmessage{@deffnx in invalid context}}
4310
 
\def\defunx #1 {\errmessage{@defunx in invalid context}}
4311
 
\def\defmacx #1 {\errmessage{@defmacx in invalid context}}
4312
 
\def\defspecx #1 {\errmessage{@defspecx in invalid context}}
4313
 
\def\deftypefnx #1 {\errmessage{@deftypefnx in invalid context}}
4314
 
\def\deftypemethodx #1 {\errmessage{@deftypemethodx in invalid context}}
4315
 
\def\deftypefunx #1 {\errmessage{@deftypefunx in invalid context}}
4316
 
 
4317
 
% @defmethod, and so on
4318
 
 
4319
4901
% @defop CATEGORY CLASS OPERATION ARG...
4320
 
 
 
4902
%
4321
4903
\def\defop #1 {\def\defoptype{#1}%
4322
4904
\defopparsebody\Edefop\defopx\defopheader\defoptype}
4323
 
 
4324
 
\def\defopheader #1#2#3{%
 
4905
%
 
4906
\def\defopheader#1#2#3{%
4325
4907
\dosubind {fn}{\code{#2}}{\putwordon\ #1}% Make entry in function index
4326
 
\begingroup\defname {#2}{\defoptype{} on #1}%
 
4908
\begingroup\defname {#2}{\defoptype\ \putwordon\ #1}%
4327
4909
\defunargs {#3}\endgroup %
4328
4910
}
4329
4911
 
4330
 
% @deftypemethod CLASS RETURN-TYPE METHOD ARG...
 
4912
% @deftypeop CATEGORY CLASS TYPE OPERATION ARG...
 
4913
%
 
4914
\def\deftypeop #1 {\def\deftypeopcategory{#1}%
 
4915
  \deftypeopparsebody\Edeftypeop\deftypeopx\deftypeopheader
 
4916
                       \deftypeopcategory}
 
4917
%
 
4918
% #1 is the class name, #2 the data type, #3 the operation name, #4 the args.
 
4919
\def\deftypeopheader#1#2#3#4{%
 
4920
  \dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index
 
4921
  \begingroup
 
4922
    \defname{\defheaderxcond#2\relax$$$#3}
 
4923
            {\deftypeopcategory\ \putwordon\ \code{#1}}%
 
4924
    \deftypefunargs{#4}%
 
4925
  \endgroup
 
4926
}
 
4927
 
 
4928
% @deftypemethod CLASS TYPE METHOD ARG...
4331
4929
%
4332
4930
\def\deftypemethod{%
4333
4931
  \deftypemethparsebody\Edeftypemethod\deftypemethodx\deftypemethodheader}
4341
4939
  \endgroup
4342
4940
}
4343
4941
 
 
4942
% @deftypeivar CLASS TYPE VARNAME
 
4943
%
 
4944
\def\deftypeivar{%
 
4945
  \deftypemethparsebody\Edeftypeivar\deftypeivarx\deftypeivarheader}
 
4946
%
 
4947
% #1 is the class name, #2 the data type, #3 the variable name.
 
4948
\def\deftypeivarheader#1#2#3{%
 
4949
  \dosubind{vr}{\code{#3}}{\putwordof\ \code{#1}}% entry in variable index
 
4950
  \begingroup
 
4951
    \defname{\defheaderxcond#2\relax$$$#3}
 
4952
            {\putwordInstanceVariableof\ \code{#1}}%
 
4953
    \defvarargs{#3}%
 
4954
  \endgroup
 
4955
}
 
4956
 
4344
4957
% @defmethod == @defop Method
4345
4958
%
4346
4959
\def\defmethod{\defmethparsebody\Edefmethod\defmethodx\defmethodheader}
4360
4973
\defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype}
4361
4974
 
4362
4975
\def\defcvarheader #1#2#3{%
4363
 
\dosubind {vr}{\code{#2}}{of #1}% Make entry in var index
4364
 
\begingroup\defname {#2}{\defcvtype{} of #1}%
 
4976
\dosubind {vr}{\code{#2}}{\putwordof\ #1}% Make entry in var index
 
4977
\begingroup\defname {#2}{\defcvtype\ \putwordof\ #1}%
4365
4978
\defvarargs {#3}\endgroup %
4366
4979
}
4367
4980
 
4368
 
% @defivar == @defcv {Instance Variable}
4369
 
 
 
4981
% @defivar CLASS VARNAME == @defcv {Instance Variable} CLASS VARNAME
 
4982
%
4370
4983
\def\defivar{\defvrparsebody\Edefivar\defivarx\defivarheader}
4371
 
 
4372
 
\def\defivarheader #1#2#3{%
4373
 
\dosubind {vr}{\code{#2}}{of #1}% Make entry in var index
4374
 
\begingroup\defname {#2}{Instance Variable of #1}%
4375
 
\defvarargs {#3}\endgroup %
 
4984
%
 
4985
\def\defivarheader#1#2#3{%
 
4986
  \dosubind {vr}{\code{#2}}{\putwordof\ #1}% entry in var index
 
4987
  \begingroup
 
4988
    \defname{#2}{\putwordInstanceVariableof\ #1}%
 
4989
    \defvarargs{#3}%
 
4990
  \endgroup
4376
4991
}
4377
4992
 
4378
 
% These definitions are run if you use @defmethodx, etc.,
4379
 
% anywhere other than immediately after a @defmethod, etc.
4380
 
 
4381
 
\def\defopx #1 {\errmessage{@defopx in invalid context}}
4382
 
\def\defmethodx #1 {\errmessage{@defmethodx in invalid context}}
4383
 
\def\defcvx #1 {\errmessage{@defcvx in invalid context}}
4384
 
\def\defivarx #1 {\errmessage{@defivarx in invalid context}}
4385
 
 
4386
 
% Now @defvar
4387
 
 
 
4993
% @defvar
4388
4994
% First, define the processing that is wanted for arguments of @defvar.
4389
4995
% This is actually simple: just print them in roman.
4390
4996
% This must expand the args and terminate the paragraph they make up
4404
5010
\def\defvar{\defvarparsebody\Edefvar\defvarx\defvarheader}
4405
5011
 
4406
5012
\def\defvarheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index
4407
 
\begingroup\defname {#1}{Variable}%
 
5013
\begingroup\defname {#1}{\putwordDefvar}%
4408
5014
\defvarargs {#2}\endgroup %
4409
5015
}
4410
5016
 
4413
5019
\def\defopt{\defvarparsebody\Edefopt\defoptx\defoptheader}
4414
5020
 
4415
5021
\def\defoptheader #1#2{\doind {vr}{\code{#1}}% Make entry in var index
4416
 
\begingroup\defname {#1}{User Option}%
 
5022
\begingroup\defname {#1}{\putwordDefopt}%
4417
5023
\defvarargs {#2}\endgroup %
4418
5024
}
4419
5025
 
4425
5031
% is actually part of the data type, which should not be put into the index.
4426
5032
\def\deftypevarheader #1#2{%
4427
5033
\dovarind#2 \relax% Make entry in variables index
4428
 
\begingroup\defname {\defheaderxcond#1\relax$$$#2}{Variable}%
 
5034
\begingroup\defname {\defheaderxcond#1\relax$$$#2}{\putwordDeftypevar}%
4429
5035
\interlinepenalty=10000
4430
5036
\endgraf\nobreak\vskip -\parskip\nobreak
4431
5037
\endgroup}
4441
5047
\endgraf\nobreak\vskip -\parskip\nobreak
4442
5048
\endgroup}
4443
5049
 
4444
 
% This definition is run if you use @defvarx
4445
 
% anywhere other than immediately after a @defvar or @defvarx.
4446
 
 
4447
 
\def\defvrx #1 {\errmessage{@defvrx in invalid context}}
4448
 
\def\defvarx #1 {\errmessage{@defvarx in invalid context}}
4449
 
\def\defoptx #1 {\errmessage{@defoptx in invalid context}}
4450
 
\def\deftypevarx #1 {\errmessage{@deftypevarx in invalid context}}
4451
 
\def\deftypevrx #1 {\errmessage{@deftypevrx in invalid context}}
4452
 
 
4453
5050
% Now define @deftp
4454
5051
% Args are printed in bold, a slight difference from @defvar.
4455
5052
 
4462
5059
\def\deftpheader #1#2#3{\doind {tp}{\code{#2}}%
4463
5060
\begingroup\defname {#2}{#1}\deftpargs{#3}\endgroup}
4464
5061
 
4465
 
% This definition is run if you use @deftpx, etc
4466
 
% anywhere other than immediately after a @deftp, etc.
4467
 
 
4468
 
\def\deftpx #1 {\errmessage{@deftpx in invalid context}}
 
5062
% These definitions are used if you use @defunx (etc.)
 
5063
% anywhere other than immediately after a @defun or @defunx.
 
5064
 
5065
\def\defcvx#1 {\errmessage{@defcvx in invalid context}}
 
5066
\def\deffnx#1 {\errmessage{@deffnx in invalid context}}
 
5067
\def\defivarx#1 {\errmessage{@defivarx in invalid context}}
 
5068
\def\defmacx#1 {\errmessage{@defmacx in invalid context}}
 
5069
\def\defmethodx#1 {\errmessage{@defmethodx in invalid context}}
 
5070
\def\defoptx #1 {\errmessage{@defoptx in invalid context}}
 
5071
\def\defopx#1 {\errmessage{@defopx in invalid context}}
 
5072
\def\defspecx#1 {\errmessage{@defspecx in invalid context}}
 
5073
\def\deftpx#1 {\errmessage{@deftpx in invalid context}}
 
5074
\def\deftypefnx#1 {\errmessage{@deftypefnx in invalid context}}
 
5075
\def\deftypefunx#1 {\errmessage{@deftypefunx in invalid context}}
 
5076
\def\deftypeivarx#1 {\errmessage{@deftypeivarx in invalid context}}
 
5077
\def\deftypemethodx#1 {\errmessage{@deftypemethodx in invalid context}}
 
5078
\def\deftypeopx#1 {\errmessage{@deftypeopx in invalid context}}
 
5079
\def\deftypevarx#1 {\errmessage{@deftypevarx in invalid context}}
 
5080
\def\deftypevrx#1 {\errmessage{@deftypevrx in invalid context}}
 
5081
\def\defunx#1 {\errmessage{@defunx in invalid context}}
 
5082
\def\defvarx#1 {\errmessage{@defvarx in invalid context}}
 
5083
\def\defvrx#1 {\errmessage{@defvrx in invalid context}}
4469
5084
 
4470
5085
 
4471
5086
\message{macros,}
4472
5087
% @macro.
4473
5088
 
4474
 
% To do this right we need a feature of e-TeX, \scantokens, 
 
5089
% To do this right we need a feature of e-TeX, \scantokens,
4475
5090
% which we arrange to emulate with a temporary file in ordinary TeX.
4476
5091
\ifx\eTeXversion\undefined
4477
5092
 \newwrite\macscribble
4478
5093
 \def\scanmacro#1{%
4479
5094
   \begingroup \newlinechar`\^^M
 
5095
   % Undo catcode changes of \startcontents and \doprintindex
 
5096
   \catcode`\@=0 \catcode`\\=12 \escapechar=`\@
 
5097
   % Append \endinput to make sure that TeX does not see the ending newline.
 
5098
   \toks0={#1\endinput}%
4480
5099
   \immediate\openout\macscribble=\jobname.tmp
4481
 
   \immediate\write\macscribble{#1}%
 
5100
   \immediate\write\macscribble{\the\toks0}%
4482
5101
   \immediate\closeout\macscribble
4483
5102
   \let\xeatspaces\eatspaces
4484
5103
   \input \jobname.tmp
4487
5106
\else
4488
5107
\def\scanmacro#1{%
4489
5108
\begingroup \newlinechar`\^^M
4490
 
\let\xeatspaces\eatspaces\scantokens{#1}\endgroup}
 
5109
% Undo catcode changes of \startcontents and \doprintindex
 
5110
\catcode`\@=0 \catcode`\\=12 \escapechar=`\@
 
5111
\let\xeatspaces\eatspaces\scantokens{#1\endinput}\endgroup}
4491
5112
\fi
4492
5113
 
4493
5114
\newcount\paramno   % Count of parameters
4494
5115
\newtoks\macname    % Macro name
4495
5116
\newif\ifrecursive  % Is it recursive?
 
5117
\def\macrolist{}    % List of all defined macros in the form
 
5118
                    % \do\macro1\do\macro2...
4496
5119
 
4497
5120
% Utility routines.
4498
5121
% Thisdoes \let #1 = #2, except with \csnames.
4524
5147
% all characters are catcode 10, 11 or 12, except \ which is active
4525
5148
% (as in normal texinfo). It is necessary to change the definition of \.
4526
5149
 
4527
 
% It's necessary to have hard CRs when the macro is executed. This is 
4528
 
% done by  making ^^M (\endlinechar) catcode 12 when reading the macro 
 
5150
% It's necessary to have hard CRs when the macro is executed. This is
 
5151
% done by  making ^^M (\endlinechar) catcode 12 when reading the macro
4529
5152
% body, and then making it the \newlinechar in \scanmacro.
4530
5153
 
4531
5154
\def\macrobodyctxt{%
4554
5177
  \catcode`\\=12}
4555
5178
 
4556
5179
% \mbodybackslash is the definition of \ in @macro bodies.
4557
 
% It maps \foo\ => \csname macarg.foo\endcsname => #N 
 
5180
% It maps \foo\ => \csname macarg.foo\endcsname => #N
4558
5181
% where N is the macro parameter number.
4559
5182
% We define \csname macarg.\endcsname to be \realbackslash, so
4560
5183
% \\ in macro replacement text gets you a backslash.
4573
5196
  \ifx\argl\empty       % no arguments
4574
5197
     \paramno=0%
4575
5198
  \else
4576
 
     \expandafter\parsemargdef \argl;% 
 
5199
     \expandafter\parsemargdef \argl;%
4577
5200
  \fi
4578
 
  \expandafter\ifx \csname macsave.\the\macname\endcsname \relax
4579
 
     \cslet{macsave.\the\macname}{\the\macname}%
4580
 
  \else
 
5201
  \if1\csname ismacro.\the\macname\endcsname
4581
5202
     \message{Warning: redefining \the\macname}%
 
5203
  \else
 
5204
     \expandafter\ifx\csname \the\macname\endcsname \relax
 
5205
     \else \errmessage{The name \the\macname\space is reserved}\fi
 
5206
     \global\cslet{macsave.\the\macname}{\the\macname}%
 
5207
     \global\expandafter\let\csname ismacro.\the\macname\endcsname=1%
 
5208
     % Add the macroname to \macrolist
 
5209
     \toks0 = \expandafter{\macrolist\do}%
 
5210
     \xdef\macrolist{\the\toks0
 
5211
       \expandafter\noexpand\csname\the\macname\endcsname}%
4582
5212
  \fi
4583
5213
  \begingroup \macrobodyctxt
4584
5214
  \ifrecursive \expandafter\parsermacbody
4585
 
  \else \expandafter\parsemacbody 
 
5215
  \else \expandafter\parsemacbody
4586
5216
  \fi}
4587
5217
 
4588
5218
\def\unmacro{\parsearg\unmacroxxx}
4589
5219
\def\unmacroxxx#1{%
4590
 
  \expandafter\ifx \csname macsave.\the\macname\endcsname \relax
4591
 
    \errmessage{Macro \the\macname\ not defined.}%
 
5220
  \if1\csname ismacro.#1\endcsname
 
5221
    \global\cslet{#1}{macsave.#1}%
 
5222
    \global\expandafter\let \csname ismacro.#1\endcsname=0%
 
5223
    % Remove the macro name from \macrolist
 
5224
    \begingroup
 
5225
      \edef\tempa{\expandafter\noexpand\csname#1\endcsname}%
 
5226
      \def\do##1{%
 
5227
        \def\tempb{##1}%
 
5228
        \ifx\tempa\tempb
 
5229
          % remove this
 
5230
        \else
 
5231
          \toks0 = \expandafter{\newmacrolist\do}%
 
5232
          \edef\newmacrolist{\the\toks0\expandafter\noexpand\tempa}%
 
5233
        \fi}%
 
5234
      \def\newmacrolist{}%
 
5235
      % Execute macro list to define \newmacrolist
 
5236
      \macrolist
 
5237
      \global\let\macrolist\newmacrolist
 
5238
    \endgroup
4592
5239
  \else
4593
 
    \cslet{#1}{macsave.#1}%
4594
 
    \expandafter\let \csname macsave.\the\macname\endcsname \undefined
 
5240
    \errmessage{Macro #1 not defined}%
4595
5241
  \fi
4596
5242
}
4597
5243
 
4650
5296
    \or % 1
4651
5297
      \expandafter\xdef\csname\the\macname\endcsname{%
4652
5298
         \bgroup\noexpand\macroargctxt
4653
 
         \noexpand\braceorline\csname\the\macname xxx\endcsname}%
 
5299
         \noexpand\braceorline
 
5300
         \expandafter\noexpand\csname\the\macname xxx\endcsname}%
4654
5301
      \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
4655
5302
         \egroup\noexpand\scanmacro{\temp}}%
4656
5303
    \else % many
4657
5304
      \expandafter\xdef\csname\the\macname\endcsname{%
4658
5305
         \bgroup\noexpand\macroargctxt
4659
 
         \noexpand\csname\the\macname xx\endcsname}
 
5306
         \noexpand\csname\the\macname xx\endcsname}%
4660
5307
      \expandafter\xdef\csname\the\macname xx\endcsname##1{%
4661
 
          \csname\the\macname xxx\endcsname ##1,}%
 
5308
          \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
4662
5309
      \expandafter\expandafter
4663
5310
      \expandafter\xdef
4664
5311
      \expandafter\expandafter
4665
 
        \csname\the\macname xxx\endcsname 
 
5312
        \csname\the\macname xxx\endcsname
4666
5313
          \paramlist{\egroup\noexpand\scanmacro{\temp}}%
4667
5314
    \fi
4668
5315
  \else
4674
5321
    \or % 1
4675
5322
      \expandafter\xdef\csname\the\macname\endcsname{%
4676
5323
         \bgroup\noexpand\macroargctxt
4677
 
         \noexpand\braceorline\csname\the\macname xxx\endcsname}%
 
5324
         \noexpand\braceorline
 
5325
         \expandafter\noexpand\csname\the\macname xxx\endcsname}%
4678
5326
      \expandafter\xdef\csname\the\macname xxx\endcsname##1{%
4679
5327
        \egroup
4680
5328
        \noexpand\norecurse{\the\macname}%
4682
5330
    \else % many
4683
5331
      \expandafter\xdef\csname\the\macname\endcsname{%
4684
5332
         \bgroup\noexpand\macroargctxt
4685
 
         \noexpand\csname\the\macname xx\endcsname}
 
5333
         \expandafter\noexpand\csname\the\macname xx\endcsname}%
4686
5334
      \expandafter\xdef\csname\the\macname xx\endcsname##1{%
4687
 
          \csname\the\macname xxx\endcsname ##1,}%
 
5335
          \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}%
4688
5336
      \expandafter\expandafter
4689
5337
      \expandafter\xdef
4690
5338
      \expandafter\expandafter
4705
5353
\def\braceorline#1{\let\next=#1\futurelet\nchar\braceorlinexxx}
4706
5354
\def\braceorlinexxx{%
4707
5355
  \ifx\nchar\bgroup\else
4708
 
    \expandafter\parsearg 
 
5356
    \expandafter\parsearg
4709
5357
  \fi \next}
4710
5358
 
 
5359
% We mant to disable all macros during \shipout so that they are not
 
5360
% expanded by \write.
 
5361
\def\turnoffmacros{\begingroup \def\do##1{\let\noexpand##1=\relax}%
 
5362
  \edef\next{\macrolist}\expandafter\endgroup\next}
 
5363
 
 
5364
 
 
5365
% @alias.
 
5366
% We need some trickery to remove the optional spaces around the equal
 
5367
% sign.  Just make them active and then expand them all to nothing.
 
5368
\def\alias{\begingroup\obeyspaces\parsearg\aliasxxx}
 
5369
\def\aliasxxx #1{\aliasyyy#1\relax}
 
5370
\def\aliasyyy #1=#2\relax{\ignoreactivespaces
 
5371
\edef\next{\global\let\expandafter\noexpand\csname#1\endcsname=%
 
5372
           \expandafter\noexpand\csname#2\endcsname}%
 
5373
\expandafter\endgroup\next}
 
5374
 
4711
5375
 
4712
5376
\message{cross references,}
 
5377
% @xref etc.
 
5378
 
4713
5379
\newwrite\auxfile
4714
5380
 
4715
5381
\newif\ifhavexrefs    % True if xref values are known.
4751
5417
 
4752
5418
 
4753
5419
% @anchor{NAME} -- define xref target at arbitrary point.
4754
 
4755
 
\def\anchor#1{\setref{#1}{Ynothing}}
4756
 
 
 
5420
%
 
5421
\newcount\savesfregister
 
5422
\gdef\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi}
 
5423
\gdef\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi}
 
5424
\gdef\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces}
4757
5425
 
4758
5426
% \setref{NAME}{SNT} defines a cross-reference point NAME, namely
4759
5427
% NAME-title, NAME-pg, and NAME-SNT.  Called from \foonoderef.  We have
4760
5428
% to set \indexdummies so commands such as @code in a section title
4761
5429
% aren't expanded.  It would be nicer not to expand the titles in the
4762
5430
% first place, but there's so many layers that that is hard to do.
4763
 
 
5431
%
4764
5432
\def\setref#1#2{{%
4765
5433
  \indexdummies
 
5434
  \pdfmkdest{#1}%
4766
5435
  \dosetq{#1-title}{Ytitle}%
4767
5436
  \dosetq{#1-pg}{Ypagenumber}%
4768
 
  \dosetq{#1-snt}{#2}
 
5437
  \dosetq{#1-snt}{#2}%
4769
5438
}}
4770
5439
 
4771
5440
% @xref, @pxref, and @ref generate cross-references.  For \xrefX, #1 is
4777
5446
\def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]}
4778
5447
\def\ref#1{\xrefX[#1,,,,,,,]}
4779
5448
\def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup
 
5449
  \unsepspaces
4780
5450
  \def\printedmanual{\ignorespaces #5}%
4781
5451
  \def\printednodename{\ignorespaces #3}%
4782
5452
  \setbox1=\hbox{\printedmanual}%
4810
5480
  % are best written with fairly long node names, containing hyphens, this
4811
5481
  % is a loss.  Therefore, we give the text of the node name again, so it
4812
5482
  % is as if TeX is seeing it for the first time.
 
5483
  \ifpdf
 
5484
    \leavevmode
 
5485
    \getfilename{#4}%
 
5486
    \ifnum\filenamelength>0
 
5487
      \startlink attr{/Border [0 0 0]}%
 
5488
        goto file{\the\filename.pdf} name{#1@}%
 
5489
    \else
 
5490
      \startlink attr{/Border [0 0 0]}%
 
5491
        goto name{#1@}%
 
5492
    \fi
 
5493
    \linkcolor
 
5494
  \fi
 
5495
  %
4813
5496
  \ifdim \wd1 > 0pt
4814
 
    \putwordsection{} ``\printednodename'' in \cite{\printedmanual}%
 
5497
    \putwordsection{} ``\printednodename'' \putwordin{} \cite{\printedmanual}%
4815
5498
  \else
4816
5499
    % _ (for example) has to be the character _ for the purposes of the
4817
5500
    % control sequence corresponding to the node, but it has to expand
4824
5507
     \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}%
4825
5508
     \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
4826
5509
    }%
4827
 
    % [mynode], 
 
5510
    % [mynode],
4828
5511
    [\printednodename],\space
4829
5512
    % page 3
4830
5513
    \turnoffactive \putwordpage\tie\refx{#1-pg}{}%
4831
5514
  \fi
 
5515
  \endlink
4832
5516
\endgroup}
4833
5517
 
4834
5518
% \dosetq is the interface for calls from other macros
4836
5520
% Use \normalturnoffactive so that punctuation chars such as underscore
4837
5521
% and backslash work in node names.  (\turnoffactive doesn't do \.)
4838
5522
\def\dosetq#1#2{%
4839
 
  {\let\folio=0
 
5523
  {\let\folio=0%
4840
5524
   \normalturnoffactive
4841
5525
   \edef\next{\write\auxfile{\internalsetq{#1}{#2}}}%
4842
5526
   \iflinks
4913
5597
}
4914
5598
 
4915
5599
% This is the macro invoked by entries in the aux file.
4916
 
 
5600
%
4917
5601
\def\xrdef#1{\begingroup
4918
5602
  % Reenable \ as an escape while reading the second argument.
4919
5603
  \catcode`\\ = 0
5065
5749
  \xspaceskip\z@skip
5066
5750
  \parindent\defaultparindent
5067
5751
  %
 
5752
  \smallfonts \rm
 
5753
  %
5068
5754
  % Hang the footnote text off the number.
5069
5755
  \hang
5070
5756
  \textindent{\thisfootno}%
5079
5765
  \else\let\next\f@t\fi \next}
5080
5766
\def\f@@t{\bgroup\aftergroup\@foot\let\next}
5081
5767
\def\f@t#1{#1\@foot}
5082
 
\def\@foot{\strut\egroup}
 
5768
\def\@foot{\strut\par\egroup}
5083
5769
 
5084
5770
}%end \catcode `\@=11
5085
5771
 
5138
5824
 
5139
5825
% @image.  We use the macros from epsf.tex to support this.
5140
5826
% If epsf.tex is not installed and @image is used, we complain.
5141
 
 
5827
%
5142
5828
% Check for and read epsf.tex up front.  If we read it only at @image
5143
5829
% time, we might be inside a group, and then its definitions would get
5144
5830
% undone and the next image would fail.
5151
5837
  \input epsf.tex
5152
5838
\fi
5153
5839
%
 
5840
% We will only complain once about lack of epsf.tex.
5154
5841
\newif\ifwarnednoepsf
5155
5842
\newhelp\noepsfhelp{epsf.tex must be installed for images to
5156
5843
  work.  It is also included in the Texinfo distribution, or you can get
5157
 
  it from ftp://ftp.tug.org/tex/epsf.tex.}
 
5844
  it from ftp://tug.org/tex/epsf.tex.}
5158
5845
%
5159
 
% Only complain once about lack of epsf.tex.
5160
5846
\def\image#1{%
5161
5847
  \ifx\epsfbox\undefined
5162
5848
    \ifwarnednoepsf \else
5174
5860
% #2 is (optional) width, #3 is (optional) height.
5175
5861
% #4 is just the usual extra ignored arg for parsing this stuff.
5176
5862
\def\imagexxx#1,#2,#3,#4\finish{%
5177
 
  % \epsfbox itself resets \epsf?size at each figure.
5178
 
  \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
5179
 
  \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
5180
 
  % If the image is by itself, center it.
5181
 
  \ifvmode
5182
 
    \nobreak\medskip
5183
 
    \nobreak
5184
 
    \centerline{\epsfbox{#1.eps}}%
5185
 
    \bigbreak
5186
 
  \else
5187
 
    \epsfbox{#1.eps}%
5188
 
  \fi
5189
 
}
5190
 
 
5191
 
 
5192
 
\message{paper sizes,}
5193
 
% And other related parameters.
5194
 
 
 
5863
  \ifpdf
 
5864
    \centerline{\dopdfimage{#1}{#2}{#3}}%
 
5865
  \else
 
5866
    % \epsfbox itself resets \epsf?size at each figure.
 
5867
    \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
 
5868
    \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi
 
5869
    \begingroup
 
5870
      \catcode`\^^M = 5     % in case we're inside an example
 
5871
      \normalturnoffactive  % allow _ et al. in names
 
5872
      % If the image is by itself, center it.
 
5873
      \ifvmode
 
5874
        \nobreak\bigskip
 
5875
        % Usually we'll have text after the image which will insert
 
5876
        % \parskip glue, so insert it here too to equalize the space
 
5877
        % above and below. 
 
5878
        \nobreak\vskip\parskip
 
5879
        \nobreak
 
5880
        \centerline{\epsfbox{#1.eps}}%
 
5881
        \bigbreak
 
5882
      \else
 
5883
        % In the middle of a paragraph, no extra space.
 
5884
        \epsfbox{#1.eps}%
 
5885
      \fi
 
5886
    \endgroup
 
5887
  \fi
 
5888
}
 
5889
 
 
5890
 
 
5891
\message{localization,}
 
5892
% and i18n.
 
5893
 
 
5894
% @documentlanguage is usually given very early, just after
 
5895
% @setfilename.  If done too late, it may not override everything
 
5896
% properly.  Single argument is the language abbreviation.
 
5897
% It would be nice if we could set up a hyphenation file here.
 
5898
%
 
5899
\def\documentlanguage{\parsearg\dodocumentlanguage}
 
5900
\def\dodocumentlanguage#1{%
 
5901
  \tex % read txi-??.tex file in plain TeX.
 
5902
  % Read the file if it exists.
 
5903
  \openin 1 txi-#1.tex
 
5904
  \ifeof1
 
5905
    \errhelp = \nolanghelp
 
5906
    \errmessage{Cannot read language file txi-#1.tex}%
 
5907
    \let\temp = \relax
 
5908
  \else
 
5909
    \def\temp{\input txi-#1.tex }%
 
5910
  \fi
 
5911
  \temp
 
5912
  \endgroup
 
5913
}
 
5914
\newhelp\nolanghelp{The given language definition file cannot be found or
 
5915
is empty.  Maybe you need to install it?  In the current directory
 
5916
should work if nowhere else does.}
 
5917
 
 
5918
 
 
5919
% @documentencoding should change something in TeX eventually, most
 
5920
% likely, but for now just recognize it.
 
5921
\let\documentencoding = \comment
 
5922
 
 
5923
 
 
5924
% Page size parameters.
 
5925
%
5195
5926
\newdimen\defaultparindent \defaultparindent = 15pt
5196
5927
 
5197
5928
\chapheadingskip = 15pt plus 4pt minus 2pt
5211
5942
% Use TeX 3.0's \emergencystretch to help line breaking, but if we're
5212
5943
% using an old version of TeX, don't do anything.  We want the amount of
5213
5944
% stretch added to depend on the line length, hence the dependence on
5214
 
% \hsize.  This makes it come to about 9pt for the 8.5x11 format.  We
5215
 
% call this whenever the paper size is set.
 
5945
% \hsize.  We call this whenever the paper size is set.
5216
5946
%
5217
5947
\def\setemergencystretch{%
5218
5948
  \ifx\emergencystretch\thisisundefined
5219
5949
    % Allow us to assign to \emergencystretch anyway.
5220
5950
    \def\emergencystretch{\dimen0}%
5221
5951
  \else
5222
 
    \emergencystretch = \hsize
5223
 
    \divide\emergencystretch by 45
 
5952
    \emergencystretch = .15\hsize
5224
5953
  \fi
5225
5954
}
5226
5955
 
5251
5980
  \setemergencystretch
5252
5981
}
5253
5982
 
 
5983
% Use `small' versions.
 
5984
 
5985
\def\smallenvironments{%
 
5986
  \let\smalldisplay = \smalldisplayx
 
5987
  \let\smallexample = \smalllispx
 
5988
  \let\smallformat = \smallformatx
 
5989
  \let\smalllisp = \smalllispx
 
5990
}
 
5991
 
5254
5992
% @letterpaper (the default).
5255
5993
\def\letterpaper{{\globaldefs = 1
5256
5994
  \parskip = 3pt plus 2pt minus 1pt
5273
6011
  \contentsrightmargin = 0pt
5274
6012
  \deftypemargin = 0pt
5275
6013
  \defbodyindent = .5cm
5276
 
  %
5277
 
  \let\smalldisplay = \smalldisplayx
5278
 
  \let\smallexample = \smalllispx
5279
 
  \let\smallformat = \smallformatx
5280
 
  \let\smalllisp = \smalllispx
 
6014
  \smallenvironments
5281
6015
}}
5282
6016
 
5283
6017
% Use @afourpaper to print on European A4 paper.
5291
6025
  \hfuzz = 1pt
5292
6026
}}
5293
6027
 
 
6028
% Use @afivepaper to print on European A5 paper.
 
6029
% From romildo@urano.iceb.ufop.br, 2 July 2000.
 
6030
% He also recommends making @example and @lisp be small.
 
6031
\def\afivepaper{{\globaldefs = 1
 
6032
  \setleading{12.5pt}%
 
6033
  \parskip = 2pt plus 1pt minus 0.1pt
 
6034
  %
 
6035
  \internalpagesizes{166mm}{120mm}{\voffset}{-8mm}{\bindingoffset}{8pt}%
 
6036
  %
 
6037
  \lispnarrowing = 0.2in
 
6038
  \tolerance = 800
 
6039
  \hfuzz = 1.2pt
 
6040
  \contentsrightmargin = 0mm
 
6041
  \deftypemargin = 0pt
 
6042
  \defbodyindent = 2mm
 
6043
  \tableindent = 12mm
 
6044
  %
 
6045
  \smallenvironments
 
6046
}}
 
6047
 
5294
6048
% A specific text layout, 24x15cm overall, intended for A4 paper.  Top margin
5295
6049
% 29mm, hence bottom margin 28mm, nominal side margin 3cm.
5296
6050
\def\afourlatex{{\globaldefs = 1
5305
6059
% Use @afourwide to print on European A4 paper in wide format.
5306
6060
\def\afourwide{%
5307
6061
  \afourpaper
5308
 
  \internalpagesizes{9.5in}{6.5in}{\hoffset}{\normaloffset}{\bindingoffset}{7mm}%
 
6062
  \internalpagesizes{6.5in}{9.5in}{\hoffset}{\normaloffset}{\bindingoffset}{7mm}%
5309
6063
  %
5310
6064
  \globaldefs = 0
5311
6065
}
5313
6067
% @pagesizes TEXTHEIGHT[,TEXTWIDTH]
5314
6068
% Perhaps we should allow setting the margins, \topskip, \parskip,
5315
6069
% and/or leading, also. Or perhaps we should compute them somehow.
5316
 
 
6070
%
5317
6071
\def\pagesizes{\parsearg\pagesizesxxx}
5318
6072
\def\pagesizesxxx#1{\pagesizesyyy #1,,\finish}
5319
6073
\def\pagesizesyyy#1,#2,#3\finish{{%
5327
6081
}}
5328
6082
 
5329
6083
% Set default to letter.
5330
 
 
6084
%
5331
6085
\letterpaper
5332
6086
 
 
6087
 
5333
6088
\message{and turning on texinfo input format.}
5334
6089
 
5335
6090
% Define macros to output various characters with catcode for normal text.
5341
6096
\catcode`\<=\other
5342
6097
\catcode`\>=\other
5343
6098
\catcode`\+=\other
 
6099
\catcode`\$=\other
5344
6100
\def\normaldoublequote{"}
5345
6101
\def\normaltilde{~}
5346
6102
\def\normalcaret{^}
5349
6105
\def\normalless{<}
5350
6106
\def\normalgreater{>}
5351
6107
\def\normalplus{+}
 
6108
\def\normaldollar{$}
5352
6109
 
5353
6110
% This macro is used to make a character print one way in ttfont
5354
6111
% where it can probably just be output, and another way in other fonts,
5359
6116
% interword stretch (and shrink), and it is reasonable to expect all
5360
6117
% typewriter fonts to have this, we can check that font parameter.
5361
6118
%
5362
 
\def\ifusingtt#1#2{\ifdim \fontdimen3\the\font=0pt #1\else #2\fi}
 
6119
\def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi}
 
6120
 
 
6121
% Same as above, but check for italic font.  Actually this also catches
 
6122
% non-italic slanted fonts since it is impossible to distinguish them from
 
6123
% italic fonts.  But since this is only used by $ and it uses \sl anyway
 
6124
% this is not a problem.
 
6125
\def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi}
5363
6126
 
5364
6127
% Turn off all special characters except @
5365
6128
% (and those which the user can use as if they were ordinary).
5390
6153
\def>{{\tt \gtr}}
5391
6154
\catcode`\+=\active
5392
6155
\def+{{\tt \char 43}}
 
6156
\catcode`\$=\active
 
6157
\def${\ifusingit{{\sl\$}}\normaldollar}
5393
6158
%\catcode 27=\active
5394
6159
%\def^^[{$\diamondsuit$}
5395
6160
 
5420
6185
% \normalbackslash outputs one backslash in fixed width font.
5421
6186
\def\normalbackslash{{\tt\rawbackslashxx}}
5422
6187
 
5423
 
% Say @foo, not \foo, in error messages.
5424
 
\escapechar=`\@
5425
 
 
5426
6188
% \catcode 17=0   % Define control-q
5427
6189
\catcode`\\=\active
5428
6190
 
5436
6198
@let|=@normalverticalbar
5437
6199
@let<=@normalless
5438
6200
@let>=@normalgreater
5439
 
@let+=@normalplus}
 
6201
@let+=@normalplus
 
6202
@let$=@normaldollar}
5440
6203
 
5441
6204
@def@normalturnoffactive{@let"=@normaldoublequote
5442
6205
@let\=@normalbackslash
5446
6209
@let|=@normalverticalbar
5447
6210
@let<=@normalless
5448
6211
@let>=@normalgreater
5449
 
@let+=@normalplus}
 
6212
@let+=@normalplus
 
6213
@let$=@normaldollar}
5450
6214
 
5451
6215
% Make _ and + \other characters, temporarily.
5452
6216
% This is canceled by @fixbackslash.
5465
6229
% Also back turn on active characters that might appear in the input
5466
6230
% file name, in case not using a pre-dumped format.
5467
6231
%
5468
 
@gdef@fixbackslash{@ifx\@eatinput @let\ = @normalbackslash @fi
5469
 
  @catcode`+=@active @catcode`@_=@active}
5470
 
 
5471
 
% These look ok in all fonts, so just make them not special.  The @rm below
5472
 
% makes sure that the current font starts out as the newly loaded cmr10
5473
 
@catcode`@$=@other @catcode`@%=@other @catcode`@&=@other @catcode`@#=@other
5474
 
 
 
6232
@gdef@fixbackslash{%
 
6233
  @ifx\@eatinput @let\ = @normalbackslash @fi
 
6234
  @catcode`+=@active
 
6235
  @catcode`@_=@active
 
6236
}
 
6237
 
 
6238
% Say @foo, not \foo, in error messages.
 
6239
@escapechar = `@@
 
6240
 
 
6241
% These look ok in all fonts, so just make them not special.  
 
6242
@catcode`@& = @other
 
6243
@catcode`@# = @other
 
6244
@catcode`@% = @other
 
6245
 
 
6246
@c Set initial fonts.
5475
6247
@textfonts
5476
6248
@rm
5477
6249
 
 
6250
 
5478
6251
@c Local variables:
5479
6252
@c eval: (add-hook 'write-file-hooks 'time-stamp)
5480
6253
@c page-delimiter: "^\\\\message"
5481
6254
@c time-stamp-start: "def\\\\texinfoversion{"
5482
 
@c time-stamp-format: "%:y-%02m-%02d"
 
6255
@c time-stamp-format: "%:y-%02m-%02d.%02H"
5483
6256
@c time-stamp-end: "}"
5484
6257
@c End: