~ubuntu-branches/ubuntu/precise/automake/precise

« back to all changes in this revision

Viewing changes to texinfo.tex

  • Committer: Bazaar Package Importer
  • Author(s): Eric Dorland
  • Date: 2005-02-06 00:21:08 UTC
  • mfrom: (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20050206002108-nmo15oj9c97jj87e
Tags: 1:1.4-p6-9
* debian/automake1.4.postinst: Make a slave link to the info file.
* debian/copyright: Modern copyright file a bit, and add full copyright
  disclaimer. (Closes: #290066)

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{2001-05-24.08}
 
6
\def\texinfoversion{2002-06-04.06}
7
7
%
8
8
% Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99,
9
 
%               2000, 01 Free Software Foundation, Inc.
 
9
%               2000, 01, 02 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
30
30
% Please try the latest version of texinfo.tex before submitting bug
31
31
% reports; you can get the latest version from:
32
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).
37
 
%   /home/gd/gnu/doc/texinfo.tex on the GNU machines.
 
33
%     (and all GNU mirrors, see http://www.gnu.org/order/ftp.html)
 
34
%   ftp://texinfo.org/texinfo/texinfo.tex
 
35
%   ftp://tug.org/tex/texinfo.tex
 
36
%     (and all CTAN mirrors, see http://www.ctan.org),
 
37
%   and /home/gd/gnu/doc/texinfo.tex on the GNU machines.
 
38
38
39
% The texinfo.tex in any given Texinfo distribution could well be out
39
40
% of date, so if that's what you're using, please check.
40
 
% Texinfo has a small home page at http://texinfo.org/.
 
41
 
42
% Texinfo has a small home page at http://texinfo.org/ and also
 
43
% http://www.gnu.org/software/texinfo.
41
44
%
42
45
% Send bug reports to bug-texinfo@gnu.org.  Please include including a
43
46
% complete document in each bug report with which we can reproduce the
50
53
%   texindex foo.??
51
54
%   tex foo.texi
52
55
%   tex foo.texi
53
 
%   dvips foo.dvi -o # or whatever, to process the dvi file; this makes foo.ps.
54
 
% The extra runs of TeX get the cross-reference information correct.
 
56
%   dvips foo.dvi -o  # or whatever; this makes foo.ps.
 
57
% The extra TeX runs get the cross-reference information correct.
55
58
% Sometimes one run after texindex suffices, and sometimes you need more
56
59
% than two; texi2dvi does it as many times as necessary.
57
60
%
58
61
% 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/.
 
62
% the existing language-specific files from the full Texinfo distribution.
60
63
 
61
64
\message{Loading texinfo [version \texinfoversion]:}
62
65
 
441
444
  % environments.  --karl, 6may93
442
445
  %{\advance \baselineskip by -\singlespaceskip
443
446
  %\kern \baselineskip}%
444
 
  \setleading \singlespaceskip
 
447
  \setleading\singlespaceskip
445
448
}
446
449
 
447
450
%% Simple single-character @ commands
833
836
%
834
837
\def\asis#1{#1}
835
838
 
836
 
% @math means output in math mode.
837
 
% We don't use $'s directly in the definition of \math because control
838
 
% sequences like \math are expanded when the toc file is written.  Then,
839
 
% we read the toc file back, the $'s will be normal characters (as they
840
 
% should be, according to the definition of Texinfo).  So we must use a
841
 
% control sequence to switch into and out of math mode.
842
 
%
843
 
% This isn't quite enough for @math to work properly in indices, but it
844
 
% seems unlikely it will ever be needed there.
845
 
%
846
 
\let\implicitmath = $
847
 
\def\math#1{\implicitmath #1\implicitmath}
 
839
% @math outputs its argument in math mode.
 
840
% We don't use $'s directly in the definition of \math because we need
 
841
% to set catcodes according to plain TeX first, to allow for subscripts,
 
842
% superscripts, special math chars, etc.
 
843
 
844
% @math does not do math typesetting in section titles, index
 
845
% entries, and other such contexts where the catcodes are set before
 
846
% @math gets a chance to work.  This could perhaps be fixed, but for now
 
847
% at least we can have real math in the main text, where it's needed most.
 
848
%
 
849
\let\implicitmath = $%$ font-lock fix
 
850
%
 
851
% One complication: _ usually means subscripts, but it could also mean
 
852
% an actual _ character, as in @math{@var{some_variable} + 1}.  So make
 
853
% _ within @math be active (mathcode "8000), and distinguish by seeing
 
854
% if the current family is \slfam, which is what @var uses.
 
855
 
856
{\catcode95 = \active  % 95 = _
 
857
\gdef\mathunderscore{%
 
858
  \catcode95=\active
 
859
  \def_{\ifnum\fam=\slfam \_\else\sb\fi}%
 
860
}}
 
861
%
 
862
% Another complication: we want \\ (and @\) to output a \ character.
 
863
% FYI, plain.tex uses \\ as a temporary control sequence (why?), but
 
864
% this is not advertised and we don't care.  Texinfo does not
 
865
% otherwise define @\.
 
866
 
867
% The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\.
 
868
\def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi}
 
869
%
 
870
\def\math{%
 
871
  \tex
 
872
  \mathcode`\_="8000 \mathunderscore
 
873
  \let\\ = \mathbackslash
 
874
  \implicitmath\finishmath}
 
875
\def\finishmath#1{#1\implicitmath\Etex}
848
876
 
849
877
% @bullet and @minus need the same treatment as @math, just above.
850
878
\def\bullet{\implicitmath\ptexbullet\implicitmath}
927
955
  \def\dopdfimage#1#2#3{%
928
956
    \def\imagewidth{#2}%
929
957
    \def\imageheight{#3}%
 
958
    % without \immediate, pdftex seg faults when the same image is
 
959
    % included twice.  (Version 3.14159-pre-1.0-unofficial-20010704.)
930
960
    \ifnum\pdftexversion < 14
931
 
      \pdfimage
 
961
      \immediate\pdfimage
932
962
    \else
933
 
      \pdfximage
 
963
      \immediate\pdfximage
934
964
    \fi
935
965
      \ifx\empty\imagewidth\else width \imagewidth \fi
936
966
      \ifx\empty\imageheight\else height \imageheight \fi
942
972
    \ifnum\pdftexversion < 14 \else
943
973
      \pdfrefximage \pdflastximage
944
974
    \fi}
945
 
  \def\pdfmkdest#1{\pdfdest name{#1} xyz}
946
 
  \def\pdfmkpgn#1{#1@}
 
975
  \def\pdfmkdest#1{{\normalturnoffactive \pdfdest name{#1} xyz}}
 
976
  \def\pdfmkpgn#1{#1}
947
977
  \let\linkcolor = \Blue  % was Cyan, but that seems light?
948
978
  \def\endlink{\Black\pdfendlink}
949
979
  % Adding outlines to PDF; macros for calculating structure of outlines
955
985
    \expandafter\xdef\csname#1\endcsname{\the\tempnum}}
956
986
  \def\pdfmakeoutlines{{%
957
987
    \openin 1 \jobname.toc
958
 
    \ifeof 1\else\bgroup
 
988
    \ifeof 1\else\begingroup
959
989
      \closein 1 
960
990
      \indexnofonts
961
991
      \def\tt{}
965
995
      \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace
966
996
      %
967
997
      \def\chapentry ##1##2##3{}
 
998
      \let\appendixentry = \chapentry
968
999
      \def\unnumbchapentry ##1##2{}
969
1000
      \def\secentry ##1##2##3##4{\advancenumber{chap##2}}
970
 
      \def\unnumbsecentry ##1##2{}
 
1001
      \def\unnumbsecentry ##1##2##3{\advancenumber{chap##2}}
971
1002
      \def\subsecentry ##1##2##3##4##5{\advancenumber{sec##2.##3}}
972
 
      \def\unnumbsubsecentry ##1##2{}
 
1003
      \def\unnumbsubsecentry ##1##2##3##4{\advancenumber{sec##2.##3}}
973
1004
      \def\subsubsecentry ##1##2##3##4##5##6{\advancenumber{subsec##2.##3.##4}}
974
 
      \def\unnumbsubsubsecentry ##1##2{}
 
1005
      \def\unnumbsubsubsecentry ##1##2##3##4##5{\advancenumber{subsec##2.##3.##4}}
975
1006
      \input \jobname.toc
976
1007
      \def\chapentry ##1##2##3{%
977
1008
        \pdfoutline goto name{\pdfmkpgn{##3}}count-\expnumber{chap##2}{##1}}
 
1009
      \let\appendixentry = \chapentry
978
1010
      \def\unnumbchapentry ##1##2{%
979
1011
        \pdfoutline goto name{\pdfmkpgn{##2}}{##1}}
980
1012
      \def\secentry ##1##2##3##4{%
981
1013
        \pdfoutline goto name{\pdfmkpgn{##4}}count-\expnumber{sec##2.##3}{##1}}
982
 
      \def\unnumbsecentry ##1##2{%
983
 
        \pdfoutline goto name{\pdfmkpgn{##2}}{##1}}
 
1014
      \def\unnumbsecentry ##1##2##3{%
 
1015
        \pdfoutline goto name{\pdfmkpgn{##3}}{##1}}
984
1016
      \def\subsecentry ##1##2##3##4##5{%
985
1017
        \pdfoutline goto name{\pdfmkpgn{##5}}count-\expnumber{subsec##2.##3.##4}{##1}}
986
 
      \def\unnumbsubsecentry ##1##2{%
987
 
        \pdfoutline goto name{\pdfmkpgn{##2}}{##1}}
 
1018
      \def\unnumbsubsecentry ##1##2##3##4{%
 
1019
        \pdfoutline goto name{\pdfmkpgn{##4}}{##1}}
988
1020
      \def\subsubsecentry ##1##2##3##4##5##6{%
989
1021
        \pdfoutline goto name{\pdfmkpgn{##6}}{##1}}
990
 
      \def\unnumbsubsubsecentry ##1##2{%
991
 
        \pdfoutline goto name{\pdfmkpgn{##2}}{##1}}
 
1022
      \def\unnumbsubsubsecentry ##1##2##3##4##5{%
 
1023
        \pdfoutline goto name{\pdfmkpgn{##5}}{##1}}
992
1024
      \input \jobname.toc
993
 
    \egroup\fi
 
1025
    \endgroup\fi
994
1026
  }}
995
1027
  \def\makelinks #1,{%
996
1028
    \def\params{#1}\def\E{END}%
1068
1100
  \def\makelink{\addtokens{\toksB}%
1069
1101
    {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0}
1070
1102
  \def\pdflink#1{%
1071
 
    \startlink attr{/Border [0 0 0]} goto name{\mkpgn{#1}}
 
1103
    \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}}
1072
1104
    \linkcolor #1\endlink}
1073
 
  \def\mkpgn#1{#1@} 
1074
1105
  \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st}
1075
1106
\fi % \ifx\pdfoutput
1076
1107
 
1087
1118
% We don't need math for this one.
1088
1119
\def\ttsl{\tenttsl}
1089
1120
 
1090
 
% Use Computer Modern fonts at \magstephalf (11pt).
1091
 
\newcount\mainmagstep
1092
 
\mainmagstep=\magstephalf
 
1121
% Default leading.
 
1122
\newdimen\textleading  \textleading = 13.2pt
 
1123
 
 
1124
% Set the baselineskip to #1, and the lineskip and strut size
 
1125
% correspondingly.  There is no deep meaning behind these magic numbers
 
1126
% used as factors; they just match (closely enough) what Knuth defined.
 
1127
%
 
1128
\def\lineskipfactor{.08333}
 
1129
\def\strutheightpercent{.70833}
 
1130
\def\strutdepthpercent {.29167}
 
1131
%
 
1132
\def\setleading#1{%
 
1133
  \normalbaselineskip = #1\relax
 
1134
  \normallineskip = \lineskipfactor\normalbaselineskip
 
1135
  \normalbaselines
 
1136
  \setbox\strutbox =\hbox{%
 
1137
    \vrule width0pt height\strutheightpercent\baselineskip
 
1138
                    depth \strutdepthpercent \baselineskip
 
1139
  }%
 
1140
}
1093
1141
 
1094
1142
% Set the font macro #1 to the font named #2, adding on the
1095
1143
% specified font prefix (normally `cm').
1119
1167
\def\scshape{csc}
1120
1168
\def\scbshape{csc}
1121
1169
 
 
1170
\newcount\mainmagstep
1122
1171
\ifx\bigger\relax
1123
 
\let\mainmagstep=\magstep1
1124
 
\setfont\textrm\rmshape{12}{1000}
1125
 
\setfont\texttt\ttshape{12}{1000}
 
1172
  % not really supported.
 
1173
  \let\mainmagstep=\magstep1
 
1174
  \setfont\textrm\rmshape{12}{1000}
 
1175
  \setfont\texttt\ttshape{12}{1000}
1126
1176
\else
1127
 
\setfont\textrm\rmshape{10}{\mainmagstep}
1128
 
\setfont\texttt\ttshape{10}{\mainmagstep}
 
1177
  \mainmagstep=\magstephalf
 
1178
  \setfont\textrm\rmshape{10}{\mainmagstep}
 
1179
  \setfont\texttt\ttshape{10}{\mainmagstep}
1129
1180
\fi
1130
1181
% Instead of cmb10, you many want to use cmbx10.
1131
1182
% cmbx10 is a prettier font on its own, but cmb10
1156
1207
\font\smalli=cmmi9
1157
1208
\font\smallsy=cmsy9
1158
1209
 
 
1210
% Fonts for small examples (8pt).
 
1211
\setfont\smallerrm\rmshape{8}{1000}
 
1212
\setfont\smallertt\ttshape{8}{1000}
 
1213
\setfont\smallerbf\bfshape{10}{800}
 
1214
\setfont\smallerit\itshape{8}{1000}
 
1215
\setfont\smallersl\slshape{8}{1000}
 
1216
\setfont\smallersf\sfshape{8}{1000}
 
1217
\setfont\smallersc\scshape{10}{800}
 
1218
\setfont\smallerttsl\ttslshape{10}{800}
 
1219
\font\smalleri=cmmi8
 
1220
\font\smallersy=cmsy8
 
1221
 
1159
1222
% Fonts for title page:
1160
1223
\setfont\titlerm\rmbshape{12}{\magstep3}
1161
1224
\setfont\titleit\itbshape{10}{\magstep4}
1193
1256
\font\seci=cmmi12 scaled \magstep1
1194
1257
\font\secsy=cmsy10 scaled \magstep2
1195
1258
 
1196
 
% \setfont\ssecrm\bxshape{10}{\magstep1}    % This size an font looked bad.
1197
 
% \setfont\ssecit\itshape{10}{\magstep1}    % The letters were too crowded.
1198
 
% \setfont\ssecsl\slshape{10}{\magstep1}
1199
 
% \setfont\ssectt\ttshape{10}{\magstep1}
1200
 
% \setfont\ssecsf\sfshape{10}{\magstep1}
1201
 
 
1202
 
%\setfont\ssecrm\bfshape{10}{1315}      % Note the use of cmb rather than cmbx.
1203
 
%\setfont\ssecit\itshape{10}{1315}      % Also, the size is a little larger than
1204
 
%\setfont\ssecsl\slshape{10}{1315}      % being scaled magstep1.
1205
 
%\setfont\ssectt\ttshape{10}{1315}
1206
 
%\setfont\ssecsf\sfshape{10}{1315}
1207
 
 
1208
 
%\let\ssecbf=\ssecrm
1209
 
 
1210
1259
% Subsection fonts (13.15pt).
1211
1260
\setfont\ssecrm\rmbshape{12}{\magstephalf}
1212
1261
\setfont\ssecit\itbshape{10}{1315}
1223
1272
 
1224
1273
% In order for the font changes to affect most math symbols and letters,
1225
1274
% we have to define the \textfont of the standard families.  Since
1226
 
% texinfo doesn't allow for producing subscripts and superscripts, we
1227
 
% don't bother to reset \scriptfont and \scriptscriptfont (which would
1228
 
% also require loading a lot more fonts).
 
1275
% texinfo doesn't allow for producing subscripts and superscripts except
 
1276
% in the main text, we don't bother to reset \scriptfont and
 
1277
% \scriptscriptfont (which would also require loading a lot more fonts).
1229
1278
%
1230
1279
\def\resetmathfonts{%
1231
 
  \textfont0 = \tenrm \textfont1 = \teni \textfont2 = \tensy
1232
 
  \textfont\itfam = \tenit \textfont\slfam = \tensl \textfont\bffam = \tenbf
1233
 
  \textfont\ttfam = \tentt \textfont\sffam = \tensf
 
1280
  \textfont0=\tenrm \textfont1=\teni \textfont2=\tensy
 
1281
  \textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf
 
1282
  \textfont\ttfam=\tentt \textfont\sffam=\tensf
1234
1283
}
1235
1284
 
1236
 
 
1237
1285
% The font-changing commands redefine the meanings of \tenSTYLE, instead
1238
1286
% of just \STYLE.  We do this so that font changes will continue to work
1239
1287
% in math mode, where it is the current \fam that is relevant in most
1244
1292
  \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl
1245
1293
  \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc
1246
1294
  \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy \let\tenttsl=\textttsl
1247
 
  \resetmathfonts}
 
1295
  \resetmathfonts \setleading{\textleading}}
1248
1296
\def\titlefonts{%
1249
1297
  \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl
1250
1298
  \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc
1273
1321
  \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc
1274
1322
  \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy
1275
1323
  \let\tenttsl=\smallttsl
1276
 
  \resetmathfonts \setleading{11pt}}
 
1324
  \resetmathfonts \setleading{10.5pt}}
 
1325
\def\smallerfonts{%
 
1326
  \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl
 
1327
  \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc
 
1328
  \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy
 
1329
  \let\tenttsl=\smallerttsl
 
1330
  \resetmathfonts \setleading{9.5pt}}
 
1331
\let\smallexamplefonts = \smallerfonts
1277
1332
 
1278
1333
% Set up the default fonts, so we can use them for creating boxes.
1279
1334
%
1387
1442
 
1388
1443
\def\realdash{-}
1389
1444
\def\codedash{-\discretionary{}{}{}}
1390
 
\def\codeunder{\ifusingtt{\normalunderscore\discretionary{}{}{}}{\_}}
 
1445
\def\codeunder{%
 
1446
  % this is all so @math{@code{var_name}+1} can work.  In math mode, _
 
1447
  % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.)
 
1448
  % will therefore expand the active definition of _, which is us
 
1449
  % (inside @code that is), therefore an endless loop.
 
1450
  \ifusingtt{\ifmmode
 
1451
               \mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_.
 
1452
             \else\normalunderscore \fi
 
1453
             \discretionary{}{}{}}%
 
1454
            {\_}%
 
1455
}
1391
1456
\def\codex #1{\tclose{#1}\endgroup}
1392
1457
 
1393
 
%\let\exp=\tclose  %Was temporary
1394
 
 
1395
1458
% @kbd is like @code, except that if the argument is just one @key command,
1396
1459
% then @kbd has no effect.
1397
1460
 
1576
1639
   \oldpage
1577
1640
   \endgroup
1578
1641
   %
 
1642
   % Need this before the \...aftertitlepage checks so that if they are
 
1643
   % in effect the toc pages will come out with page numbers.
 
1644
   \HEADINGSon
 
1645
   %
1579
1646
   % If they want short, they certainly want long too.
1580
1647
   \ifsetshortcontentsaftertitlepage
1581
1648
     \shortcontents
1589
1656
     \global\let\contents = \relax
1590
1657
     \global\let\shortcontents = \relax
1591
1658
   \fi
1592
 
   %
1593
 
   \ifpdf \pdfmakepagedesttrue \fi
1594
 
   %
1595
 
   \HEADINGSon
1596
1659
}
1597
1660
 
1598
1661
\def\finishtitlepage{%
2350
2413
  \let\item = \relax
2351
2414
}
2352
2415
 
2353
 
% Ignore @ignore ... @end ignore.
 
2416
% Ignore @ignore, @ifhtml, @ifinfo, @ifplaintext, @ifnottex, @html, @menu,
 
2417
% @direntry, and @documentdescription.
2354
2418
%
2355
2419
\def\ignore{\doignore{ignore}}
2356
 
 
2357
 
% Ignore @ifinfo, @ifhtml, @ifnottex, @html, @menu, and @direntry text.
2358
 
%
 
2420
\def\ifhtml{\doignore{ifhtml}}
2359
2421
\def\ifinfo{\doignore{ifinfo}}
2360
 
\def\ifhtml{\doignore{ifhtml}}
 
2422
\def\ifplaintext{\doignore{ifplaintext}}
2361
2423
\def\ifnottex{\doignore{ifnottex}}
2362
2424
\def\html{\doignore{html}}
2363
2425
\def\menu{\doignore{menu}}
2364
2426
\def\direntry{\doignore{direntry}}
 
2427
\def\documentdescription{\doignore{documentdescription}}
 
2428
\def\documentdescriptionword{documentdescription}
2365
2429
 
2366
2430
% @dircategory CATEGORY  -- specify a category of the dir file
2367
2431
% which this file should belong to.  Ignore this in TeX.
2388
2452
  % We must not have @c interpreted as a control sequence.
2389
2453
  \catcode`\@ = 12
2390
2454
  %
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
 
2455
  \def\ignoreword{#1}%
 
2456
  \ifx\ignoreword\documentdescriptionword
 
2457
    % The c kludge breaks documentdescription, since
 
2458
    % `documentdescription' contains a `c'.  Means not everything will
 
2459
    % be ignored inside @documentdescription, but oh well...
 
2460
  \else
 
2461
    % Make the letter c a comment character so that the rest of the line
 
2462
    % will be ignored. This way, the document can have (for example)
 
2463
    %   @c @end ifinfo
 
2464
    % and the @end ifinfo will be properly ignored.
 
2465
    % (We've just changed @ to catcode 12.)
 
2466
    \catcode`\c = 14
 
2467
  \fi
2397
2468
  %
2398
 
  % And now expand that command.
 
2469
  % And now expand the command defined above.
2399
2470
  \doignoretext
2400
2471
}
2401
2472
 
2467
2538
    \let\tenrm=\nullfont \let\tenit=\nullfont \let\tensl=\nullfont
2468
2539
    \let\tenbf=\nullfont \let\tentt=\nullfont \let\smallcaps=\nullfont
2469
2540
    \let\tensf=\nullfont
2470
 
    % Similarly for index fonts (mostly for their use in smallexample).
 
2541
    % Similarly for index fonts.
2471
2542
    \let\smallrm=\nullfont \let\smallit=\nullfont \let\smallsl=\nullfont
2472
2543
    \let\smallbf=\nullfont \let\smalltt=\nullfont \let\smallsc=\nullfont
2473
2544
    \let\smallsf=\nullfont
 
2545
    % Similarly for smallexample fonts.
 
2546
    \let\smallerrm=\nullfont \let\smallerit=\nullfont \let\smallersl=\nullfont
 
2547
    \let\smallerbf=\nullfont \let\smallertt=\nullfont \let\smallersc=\nullfont
 
2548
    \let\smallersf=\nullfont
2474
2549
    %
2475
2550
    % Don't complain when characters are missing from the fonts.
2476
2551
    \tracinglostchars = 0
2582
2657
\def\ifclearfail{\nestedignore{ifclear}}
2583
2658
\defineunmatchedend{ifclear}
2584
2659
 
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.
 
2660
% @iftex, @ifnothtml, @ifnotinfo, @ifnotplaintext always succeed; we
 
2661
% read the text following, through the first @end iftex (etc.).  Make
 
2662
% `@end iftex' (etc.) valid only after an @iftex.
2588
2663
%
2589
2664
\def\iftex{\conditionalsucceed{iftex}}
2590
2665
\def\ifnothtml{\conditionalsucceed{ifnothtml}}
2591
2666
\def\ifnotinfo{\conditionalsucceed{ifnotinfo}}
 
2667
\def\ifnotplaintext{\conditionalsucceed{ifnotplaintext}}
2592
2668
\defineunmatchedend{iftex}
2593
2669
\defineunmatchedend{ifnothtml}
2594
2670
\defineunmatchedend{ifnotinfo}
 
2671
\defineunmatchedend{ifnotplaintext}
2595
2672
 
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
 
2673
% We can't just want to start a group at @iftex (etc.) and end it at
 
2674
% @end iftex, since then @set commands inside the conditional have no
2598
2675
% effect (they'd get reverted at the end of the group).  So we must
2599
2676
% define \Eiftex to redefine itself to be its previous value.  (We can't
2600
2677
% just define it to fail again with an ``unmatched end'' error, since
2707
2784
\def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
2708
2785
\def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
2709
2786
 
 
2787
% Take care of texinfo commands likely to appear in an index entry.
 
2788
% (Must be a way to avoid doing expansion at all, and thus not have to
 
2789
% laboriously list every single command here.)
 
2790
2710
2791
\def\indexdummies{%
2711
2792
\def\ { }%
 
2793
\def\@{@}% change to @@ when we switch to @ as escape char in aux files.
 
2794
% Need these in case \tex is in effect and \{ is a \delimiter again.
 
2795
% But can't use \lbracecmd and \rbracecmd because texindex assumes
 
2796
% braces and backslashes are used only as delimiters.  
 
2797
\let\{ = \mylbrace
 
2798
\let\} = \myrbrace
 
2799
\def\_{{\realbackslash _}}%
 
2800
\normalturnoffactive
 
2801
%
2712
2802
% Take care of the plain tex accent commands.
 
2803
\def\,##1{\realbackslash ,{##1}}%
2713
2804
\def\"{\realbackslash "}%
2714
2805
\def\`{\realbackslash `}%
2715
2806
\def\'{\realbackslash '}%
2722
2813
\def\u{\realbackslash u}%
2723
2814
\def\v{\realbackslash v}%
2724
2815
\def\H{\realbackslash H}%
 
2816
\def\dotless##1{\realbackslash dotless {##1}}%
2725
2817
% Take care of the plain tex special European modified letters.
2726
 
\def\oe{\realbackslash oe}%
2727
 
\def\ae{\realbackslash ae}%
2728
 
\def\aa{\realbackslash aa}%
 
2818
\def\AA{\realbackslash AA}%
 
2819
\def\AE{\realbackslash AE}%
 
2820
\def\L{\realbackslash L}%
2729
2821
\def\OE{\realbackslash OE}%
2730
 
\def\AE{\realbackslash AE}%
2731
 
\def\AA{\realbackslash AA}%
2732
 
\def\o{\realbackslash o}%
2733
2822
\def\O{\realbackslash O}%
 
2823
\def\aa{\realbackslash aa}%
 
2824
\def\ae{\realbackslash ae}%
2734
2825
\def\l{\realbackslash l}%
2735
 
\def\L{\realbackslash L}%
 
2826
\def\oe{\realbackslash oe}%
 
2827
\def\o{\realbackslash o}%
2736
2828
\def\ss{\realbackslash ss}%
2737
 
% Take care of texinfo commands likely to appear in an index entry.
2738
 
% (Must be a way to avoid doing expansion at all, and thus not have to
2739
 
% laboriously list every single command here.)
2740
 
\def\@{@}% will be @@ when we switch to @ as escape char.
2741
 
% Need these in case \tex is in effect and \{ is a \delimiter again.
2742
 
% But can't use \lbracecmd and \rbracecmd because texindex assumes
2743
 
% braces and backslashes are used only as delimiters.  
2744
 
\let\{ = \mylbrace
2745
 
\let\} = \myrbrace
2746
 
\def\_{{\realbackslash _}}%
2747
 
\def\w{\realbackslash w }%
 
2829
%
 
2830
% Although these internals commands shouldn't show up, sometimes they do.
2748
2831
\def\bf{\realbackslash bf }%
 
2832
\def\gtr{\realbackslash gtr}%
 
2833
\def\hat{\realbackslash hat}%
 
2834
\def\less{\realbackslash less}%
2749
2835
%\def\rm{\realbackslash rm }%
 
2836
\def\sf{\realbackslash sf}%
2750
2837
\def\sl{\realbackslash sl }%
2751
 
\def\sf{\realbackslash sf}%
 
2838
\def\tclose##1{\realbackslash tclose {##1}}%
2752
2839
\def\tt{\realbackslash tt}%
2753
 
\def\gtr{\realbackslash gtr}%
2754
 
\def\less{\realbackslash less}%
2755
 
\def\hat{\realbackslash hat}%
 
2840
%
 
2841
\def\b##1{\realbackslash b {##1}}%
 
2842
\def\i##1{\realbackslash i {##1}}%
 
2843
\def\sc##1{\realbackslash sc {##1}}%
 
2844
\def\t##1{\realbackslash t {##1}}%
 
2845
\def\r##1{\realbackslash r {##1}}%
 
2846
%
2756
2847
\def\TeX{\realbackslash TeX}%
 
2848
\def\acronym##1{\realbackslash acronym {##1}}%
 
2849
\def\cite##1{\realbackslash cite {##1}}%
 
2850
\def\code##1{\realbackslash code {##1}}%
 
2851
\def\command##1{\realbackslash command {##1}}%
 
2852
\def\dfn##1{\realbackslash dfn {##1}}%
2757
2853
\def\dots{\realbackslash dots }%
2758
 
\def\result{\realbackslash result}%
2759
 
\def\equiv{\realbackslash equiv}%
2760
 
\def\expansion{\realbackslash expansion}%
2761
 
\def\print{\realbackslash print}%
2762
 
\def\error{\realbackslash error}%
2763
 
\def\point{\realbackslash point}%
2764
 
\def\copyright{\realbackslash copyright}%
2765
 
\def\tclose##1{\realbackslash tclose {##1}}%
2766
 
\def\code##1{\realbackslash code {##1}}%
2767
 
\def\uref##1{\realbackslash uref {##1}}%
2768
 
\def\url##1{\realbackslash url {##1}}%
 
2854
\def\emph##1{\realbackslash emph {##1}}%
2769
2855
\def\env##1{\realbackslash env {##1}}%
2770
 
\def\command##1{\realbackslash command {##1}}%
 
2856
\def\file##1{\realbackslash file {##1}}%
 
2857
\def\kbd##1{\realbackslash kbd {##1}}%
 
2858
\def\key##1{\realbackslash key {##1}}%
 
2859
\def\math##1{\realbackslash math {##1}}%
2771
2860
\def\option##1{\realbackslash option {##1}}%
2772
 
\def\dotless##1{\realbackslash dotless {##1}}%
2773
2861
\def\samp##1{\realbackslash samp {##1}}%
2774
 
\def\,##1{\realbackslash ,{##1}}%
2775
 
\def\t##1{\realbackslash t {##1}}%
2776
 
\def\r##1{\realbackslash r {##1}}%
2777
 
\def\i##1{\realbackslash i {##1}}%
2778
 
\def\b##1{\realbackslash b {##1}}%
2779
 
\def\sc##1{\realbackslash sc {##1}}%
2780
 
\def\cite##1{\realbackslash cite {##1}}%
2781
 
\def\key##1{\realbackslash key {##1}}%
2782
 
\def\file##1{\realbackslash file {##1}}%
 
2862
\def\strong##1{\realbackslash strong {##1}}%
 
2863
\def\uref##1{\realbackslash uref {##1}}%
 
2864
\def\url##1{\realbackslash url {##1}}%
2783
2865
\def\var##1{\realbackslash var {##1}}%
2784
 
\def\kbd##1{\realbackslash kbd {##1}}%
2785
 
\def\dfn##1{\realbackslash dfn {##1}}%
2786
 
\def\emph##1{\realbackslash emph {##1}}%
2787
 
\def\acronym##1{\realbackslash acronym {##1}}%
 
2866
\def\w{\realbackslash w }%
 
2867
%
 
2868
% These math commands don't seem likely to be used in index entries.
 
2869
\def\copyright{\realbackslash copyright}%
 
2870
\def\equiv{\realbackslash equiv}%
 
2871
\def\error{\realbackslash error}%
 
2872
\def\expansion{\realbackslash expansion}%
 
2873
\def\point{\realbackslash point}%
 
2874
\def\print{\realbackslash print}%
 
2875
\def\result{\realbackslash result}%
2788
2876
%
2789
2877
% Handle some cases of @value -- where the variable name does not
2790
2878
% contain - or _, and the value does not contain any
2798
2886
 
2799
2887
% If an index command is used in an @example environment, any spaces
2800
2888
% therein should become regular spaces in the raw index file, not the
2801
 
% expansion of \tie (\\leavevmode \penalty \@M \ ).
 
2889
% expansion of \tie (\leavevmode \penalty \@M \ ).
2802
2890
{\obeyspaces
2803
2891
 \gdef\unsepspaces{\obeyspaces\let =\space}}
2804
2892
 
2809
2897
\def\indexdummydots{...}
2810
2898
 
2811
2899
\def\indexnofonts{%
2812
 
% Just ignore accents.
 
2900
\def\@{@}%
 
2901
% how to handle braces?
 
2902
\def\_{\normalunderscore}%
 
2903
%
2813
2904
\let\,=\indexdummyfont
2814
2905
\let\"=\indexdummyfont
2815
2906
\let\`=\indexdummyfont
2825
2916
\let\H=\indexdummyfont
2826
2917
\let\dotless=\indexdummyfont
2827
2918
% Take care of the plain tex special European modified letters.
2828
 
\def\oe{oe}%
2829
 
\def\ae{ae}%
2830
 
\def\aa{aa}%
 
2919
\def\AA{AA}%
 
2920
\def\AE{AE}%
 
2921
\def\L{L}%
2831
2922
\def\OE{OE}%
2832
 
\def\AE{AE}%
2833
 
\def\AA{AA}%
2834
 
\def\o{o}%
2835
2923
\def\O{O}%
 
2924
\def\aa{aa}%
 
2925
\def\ae{ae}%
2836
2926
\def\l{l}%
2837
 
\def\L{L}%
 
2927
\def\oe{oe}%
 
2928
\def\o{o}%
2838
2929
\def\ss{ss}%
2839
 
\let\w=\indexdummyfont
 
2930
%
 
2931
% Don't no-op \tt, since it isn't a user-level command
 
2932
% and is used in the definitions of the active chars like <, >, |, etc.
 
2933
% Likewise with the other plain tex font commands.
 
2934
%\let\tt=\indexdummyfont
 
2935
%
 
2936
\let\b=\indexdummyfont
 
2937
\let\i=\indexdummyfont
 
2938
\let\r=\indexdummyfont
 
2939
\let\sc=\indexdummyfont
2840
2940
\let\t=\indexdummyfont
2841
 
\let\r=\indexdummyfont
2842
 
\let\i=\indexdummyfont
2843
 
\let\b=\indexdummyfont
2844
 
\let\emph=\indexdummyfont
2845
 
\let\strong=\indexdummyfont
 
2941
%
 
2942
\let\TeX=\indexdummytex
 
2943
\let\acronym=\indexdummyfont
2846
2944
\let\cite=\indexdummyfont
2847
 
\let\sc=\indexdummyfont
2848
 
%Don't no-op \tt, since it isn't a user-level command
2849
 
% and is used in the definitions of the active chars like <, >, |...
2850
 
%\let\tt=\indexdummyfont
2851
 
\let\tclose=\indexdummyfont
2852
2945
\let\code=\indexdummyfont
2853
 
\let\url=\indexdummyfont
2854
 
\let\uref=\indexdummyfont
 
2946
\let\command=\indexdummyfont
 
2947
\let\dfn=\indexdummyfont
 
2948
\let\dots=\indexdummydots
 
2949
\let\emph=\indexdummyfont
2855
2950
\let\env=\indexdummyfont
2856
 
\let\acronym=\indexdummyfont
2857
 
\let\command=\indexdummyfont
2858
 
\let\option=\indexdummyfont
2859
2951
\let\file=\indexdummyfont
2860
 
\let\samp=\indexdummyfont
2861
2952
\let\kbd=\indexdummyfont
2862
2953
\let\key=\indexdummyfont
 
2954
\let\math=\indexdummyfont
 
2955
\let\option=\indexdummyfont
 
2956
\let\samp=\indexdummyfont
 
2957
\let\strong=\indexdummyfont
 
2958
\let\uref=\indexdummyfont
 
2959
\let\url=\indexdummyfont
2863
2960
\let\var=\indexdummyfont
2864
 
\let\TeX=\indexdummytex
2865
 
\let\dots=\indexdummydots
2866
 
\def\@{@}%
 
2961
\let\w=\indexdummyfont
2867
2962
}
2868
2963
 
2869
2964
% To define \realbackslash, we must make \ not be an escape.
3465
3560
\gdef\thischaptername{#1}%
3466
3561
\xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}%
3467
3562
\toks0 = {#1}%
3468
 
\edef\temp{\noexpand\writetocentry{\realbackslash chapentry{\the\toks0}%
3469
 
                       {\putwordAppendix{} \appendixletter}}}%
 
3563
\edef\temp{\noexpand\writetocentry{\realbackslash appendixentry{\the\toks0}%
 
3564
                       {\appendixletter}}}%
3470
3565
\temp
3471
3566
\appendixnoderef
3472
3567
\global\let\section = \appendixsec
3543
3638
\def\unnumberedseczzz #1{%
3544
3639
\plainsecheading {#1}\gdef\thissection{#1}%
3545
3640
\toks0 = {#1}%
3546
 
\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsecentry{\the\toks0}}}%
 
3641
\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsecentry%
 
3642
  {\the\toks0}{\the\chapno}}}%
3547
3643
\temp
3548
3644
\unnumbnoderef
3549
3645
\nobreak
3582
3678
\plainsubsecheading {#1}\gdef\thissection{#1}%
3583
3679
\toks0 = {#1}%
3584
3680
\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsecentry%
3585
 
                                    {\the\toks0}}}%
 
3681
  {\the\toks0}{\the\chapno}{\the\secno}}}%
3586
3682
\temp
3587
3683
\unnumbnoderef
3588
3684
\nobreak
3623
3719
\plainsubsubsecheading {#1}\gdef\thissection{#1}%
3624
3720
\toks0 = {#1}%
3625
3721
\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsubsecentry%
3626
 
                                    {\the\toks0}}}%
 
3722
  {\the\toks0}{\the\chapno}{\the\secno}{\the\subsecno}}}%
3627
3723
\temp
3628
3724
\unnumbnoderef
3629
3725
\nobreak
3835
3931
% argument, which will end up as the last argument to the \...entry macro.
3836
3932
%
3837
3933
% We open the .toc file here instead of at @setfilename or any other
3838
 
% given time so that @contents can be put in the document anywhere.
 
3934
% fixed time so that @contents can be put in the document anywhere.
3839
3935
%
3840
3936
\newif\iftocfileopened
3841
3937
\def\writetocentry#1{%
3844
3940
    \global\tocfileopenedtrue
3845
3941
  \fi
3846
3942
  \iflinks \write\tocfile{#1{\folio}}\fi
 
3943
  %
 
3944
  % Tell \shipout to create a page destination if we're doing pdf, which
 
3945
  % will be the target of the links in the table of contents.  We can't
 
3946
  % just do it on every page because the title pages are numbered 1 and
 
3947
  % 2 (the page numbers aren't printed), and so are the first two pages
 
3948
  % of the document.  Thus, we'd have two destinations named `1', and
 
3949
  % two named `2'.
 
3950
  \ifpdf \pdfmakepagedesttrue \fi
3847
3951
}
3848
3952
 
3849
3953
\newskip\contentsrightmargin \contentsrightmargin=1in
3899
4003
   \startcontents{\putwordShortTOC}%
3900
4004
      %
3901
4005
      \let\chapentry = \shortchapentry
 
4006
      \let\appendixentry = \shortappendixentry
3902
4007
      \let\unnumbchapentry = \shortunnumberedentry
3903
4008
      % We want a true roman here for the page numbers.
3904
4009
      \secfonts
3907
4012
      \hyphenpenalty = 10000
3908
4013
      \advance\baselineskip by 1pt % Open it up a little.
3909
4014
      \def\secentry ##1##2##3##4{}
3910
 
      \def\unnumbsecentry ##1##2{}
 
4015
      \def\unnumbsecentry ##1##2##3{}
3911
4016
      \def\subsecentry ##1##2##3##4##5{}
3912
 
      \def\unnumbsubsecentry ##1##2{}
 
4017
      \def\unnumbsubsecentry ##1##2##3##4{}
3913
4018
      \def\subsubsecentry ##1##2##3##4##5##6{}
3914
 
      \def\unnumbsubsubsecentry ##1##2{}
 
4019
      \def\unnumbsubsubsecentry ##1##2##3##4##5{}
3915
4020
      \openin 1 \jobname.toc
3916
4021
      \ifeof 1 \else
3917
4022
        \closein 1
3934
4039
% The last argument is the page number.
3935
4040
% The arguments in between are the chapter number, section number, ...
3936
4041
 
3937
 
% Chapter-level things, for both the long and short contents.
 
4042
% Chapters, in the main contents.
3938
4043
\def\chapentry#1#2#3{\dochapentry{#2\labelspace#1}{#3}}
3939
 
 
3940
 
% See comments in \dochapentry re vbox and related settings
 
4044
%
 
4045
% Chapters, in the short toc.
 
4046
% See comments in \dochapentry re vbox and related settings.
3941
4047
\def\shortchapentry#1#2#3{%
3942
4048
  \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#3\egroup}%
3943
4049
}
3944
4050
 
 
4051
% Appendices, in the main contents.
 
4052
\def\appendixentry#1#2#3{\dochapentry{\putwordAppendix{} #2\labelspace#1}{#3}}
 
4053
%
 
4054
% Appendices, in the short toc.
 
4055
\let\shortappendixentry = \shortchapentry
 
4056
 
3945
4057
% Typeset the label for a chapter or appendix for the short contents.
3946
 
% The arg is, e.g. `Appendix A' for an appendix, or `3' for a chapter.
 
4058
% The arg is, e.g., `Appendix A' for an appendix, or `3' for a chapter.
3947
4059
% We could simplify the code here by writing out an \appendixentry
3948
4060
% command in the toc file for appendices, instead of using \chapentry
3949
4061
% for both, but it doesn't seem worth it.
3951
4063
\newdimen\shortappendixwidth
3952
4064
%
3953
4065
\def\shortchaplabel#1{%
3954
 
  % Compute width of word "Appendix", may change with language.
3955
 
  \setbox0 = \hbox{\shortcontrm \putwordAppendix}%
3956
 
  \shortappendixwidth = \wd0
3957
 
  %
3958
 
  % We typeset #1 in a box of constant width, regardless of the text of
3959
 
  % #1, so the chapter titles will come out aligned.
3960
 
  \setbox0 = \hbox{#1}%
3961
 
  \dimen0 = \ifdim\wd0 > \shortappendixwidth \shortappendixwidth \else 0pt \fi
3962
 
  %
3963
 
  % This space should be plenty, since a single number is .5em, and the
 
4066
  % This space should be enough, since a single number is .5em, and the
3964
4067
  % widest letter (M) is 1em, at least in the Computer Modern fonts.
 
4068
  % But use \hss just in case.
3965
4069
  % (This space doesn't include the extra space that gets added after
3966
4070
  % the label; that gets put in by \shortchapentry above.)
3967
 
  \advance\dimen0 by 1.1em
3968
 
  \hbox to \dimen0{#1\hfil}%
 
4071
  \dimen0 = 1em
 
4072
  \hbox to \dimen0{#1\hss}%
3969
4073
}
3970
4074
 
 
4075
% Unnumbered chapters.
3971
4076
\def\unnumbchapentry#1#2{\dochapentry{#1}{#2}}
3972
4077
\def\shortunnumberedentry#1#2{\tocentry{#1}{\doshortpageno\bgroup#2\egroup}}
3973
4078
 
3974
4079
% Sections.
3975
4080
\def\secentry#1#2#3#4{\dosecentry{#2.#3\labelspace#1}{#4}}
3976
 
\def\unnumbsecentry#1#2{\dosecentry{#1}{#2}}
 
4081
\def\unnumbsecentry#1#2#3{\dosecentry{#1}{#3}}
3977
4082
 
3978
4083
% Subsections.
3979
4084
\def\subsecentry#1#2#3#4#5{\dosubsecentry{#2.#3.#4\labelspace#1}{#5}}
3980
 
\def\unnumbsubsecentry#1#2{\dosubsecentry{#1}{#2}}
 
4085
\def\unnumbsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}}
3981
4086
 
3982
4087
% And subsubsections.
3983
4088
\def\subsubsecentry#1#2#3#4#5#6{%
3984
4089
  \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}{#6}}
3985
 
\def\unnumbsubsubsecentry#1#2{\dosubsubsecentry{#1}{#2}}
 
4090
\def\unnumbsubsubsecentry#1#2#3#4#5{\dosubsubsecentry{#1}{#5}}
3986
4091
 
3987
4092
% This parameter controls the indentation of the various levels.
3988
4093
\newdimen\tocindent \tocindent = 3pc
4023
4128
\def\tocentry#1#2{\begingroup
4024
4129
  \vskip 0pt plus1pt % allow a little stretch for the sake of nice page breaks
4025
4130
  % Do not use \turnoffactive in these arguments.  Since the toc is
4026
 
  % typeset in cmr, so characters such as _ would come out wrong; we
 
4131
  % typeset in cmr, characters such as _ would come out wrong; we
4027
4132
  % have to do the usual translation tricks.
4028
4133
  \entry{#1}{#2}%
4029
4134
\endgroup}
4043
4148
\message{environments,}
4044
4149
% @foo ... @end foo.
4045
4150
 
 
4151
% @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
 
4152
4046
4153
% Since these characters are used in examples, it should be an even number of
4047
4154
% \tt widths. Each \tt character is 1en, so two makes it 1em.
4048
 
% Furthermore, these definitions must come after we define our fonts.
4049
 
\newbox\dblarrowbox    \newbox\longdblarrowbox
4050
 
\newbox\pushcharbox    \newbox\bullbox
4051
 
\newbox\equivbox       \newbox\errorbox
4052
 
 
4053
 
%{\tentt
4054
 
%\global\setbox\dblarrowbox = \hbox to 1em{\hfil$\Rightarrow$\hfil}
4055
 
%\global\setbox\longdblarrowbox = \hbox to 1em{\hfil$\mapsto$\hfil}
4056
 
%\global\setbox\pushcharbox = \hbox to 1em{\hfil$\dashv$\hfil}
4057
 
%\global\setbox\equivbox = \hbox to 1em{\hfil$\ptexequiv$\hfil}
4058
 
% Adapted from the manmac format (p.420 of TeXbook)
4059
 
%\global\setbox\bullbox = \hbox to 1em{\kern.15em\vrule height .75ex width .85ex
4060
 
%                                      depth .1ex\hfil}
4061
 
%}
4062
 
 
4063
 
% @point{}, @result{}, @expansion{}, @print{}, @equiv{}.
 
4155
%
4064
4156
\def\point{$\star$}
4065
4157
\def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}}
4066
4158
\def\expansion{\leavevmode\raise.1ex\hbox to 1em{\hfil$\mapsto$\hfil}}
4067
4159
\def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}}
4068
4160
\def\equiv{\leavevmode\lower.1ex\hbox to 1em{\hfil$\ptexequiv$\hfil}}
4069
4161
 
 
4162
% The @error{} command.
4070
4163
% Adapted from the TeXbook's \boxit.
 
4164
 
4165
\newbox\errorbox
 
4166
%
4071
4167
{\tentt \global\dimen0 = 3em}% Width of the box.
4072
4168
\dimen2 = .55pt % Thickness of rules
4073
4169
% The text. (`r' is open on the right, `e' somewhat less so on the left.)
4074
4170
\setbox0 = \hbox{\kern-.75pt \tensf error\kern-1.5pt}
4075
 
 
 
4171
%
4076
4172
\global\setbox\errorbox=\hbox to \dimen0{\hfil
4077
4173
   \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right.
4078
4174
   \advance\hsize by -2\dimen2 % Rules.
4083
4179
         \kern3pt\vrule width\dimen2}% Space to right.
4084
4180
      \hrule height\dimen2}
4085
4181
    \hfil}
4086
 
 
4087
 
% The @error{} command.
 
4182
%
4088
4183
\def\error{\leavevmode\lower.7ex\copy\errorbox}
4089
4184
 
4090
4185
% @tex ... @end tex    escapes into raw Tex temporarily.
4124
4219
  \def\@{@}%
4125
4220
\let\Etex=\endgroup}
4126
4221
 
4127
 
% Define @lisp ... @endlisp.
 
4222
% Define @lisp ... @end lisp.
4128
4223
% @lisp does a \begingroup so it can rebind things,
4129
 
% including the definition of @endlisp (which normally is erroneous).
 
4224
% including the definition of @end lisp (which normally is erroneous).
4130
4225
 
4131
4226
% Amount to narrow the margins by for @lisp.
4132
4227
\newskip\lispnarrowing \lispnarrowing=0.4in
4299
4394
\def\smalllispx{\begingroup
4300
4395
  \def\Esmalllisp{\nonfillfinish\endgroup}%
4301
4396
  \def\Esmallexample{\nonfillfinish\endgroup}%
4302
 
  \smallfonts
 
4397
  \smallexamplefonts
4303
4398
  \lisp
4304
4399
}
4305
4400
 
4310
4405
  \let\Edisplay = \nonfillfinish
4311
4406
  \gobble
4312
4407
}
4313
 
 
 
4408
%
4314
4409
% @smalldisplay (when @smallbook): @display plus smaller fonts.
4315
4410
%
4316
4411
\def\smalldisplayx{\begingroup
4317
4412
  \def\Esmalldisplay{\nonfillfinish\endgroup}%
4318
 
  \smallfonts \rm
 
4413
  \smallexamplefonts \rm
4319
4414
  \display
4320
4415
}
4321
4416
 
4327
4422
  \let\Eformat = \nonfillfinish
4328
4423
  \gobble
4329
4424
}
4330
 
 
 
4425
%
4331
4426
% @smallformat (when @smallbook): @format plus smaller fonts.
4332
4427
%
4333
4428
\def\smallformatx{\begingroup
4334
4429
  \def\Esmallformat{\nonfillfinish\endgroup}%
4335
 
  \smallfonts \rm
 
4430
  \smallexamplefonts \rm
4336
4431
  \format
4337
4432
}
4338
4433
 
4524
4619
  \endgroup\nonfillfinish\endgroup
4525
4620
}
4526
4621
 
 
4622
% @copying ... @end copying.
 
4623
% Save the text away for @insertcopying later.
 
4624
 
4625
\newbox\copyingbox
 
4626
%
 
4627
\def\copying{\begingroup
 
4628
  \parindent = 0pt  % looks wrong on title page
 
4629
  \def\Ecopying{\egroup\endgroup}%
 
4630
  \global\setbox\copyingbox = \vbox\bgroup
 
4631
}
 
4632
 
 
4633
% @insertcopying.
 
4634
 
4635
\def\insertcopying{\unvcopy\copyingbox}
 
4636
 
4527
4637
 
4528
4638
\message{defuns,}
4529
4639
% @defun etc.
4620
4730
{\df #1}\enskip        % Generate function name
4621
4731
}
4622
4732
 
4623
 
% Actually process the body of a definition
4624
 
% #1 should be the terminating control sequence, such as \Edefun.
4625
 
% #2 should be the "another name" control sequence, such as \defunx.
4626
 
% #3 should be the control sequence that actually processes the header,
4627
 
%    such as \defunheader.
4628
 
 
4629
 
\def\defparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
4630
 
\medbreak %
4631
 
% Define the end token that this defining construct specifies
4632
 
% so that it will exit this group.
4633
 
\def#1{\endgraf\endgroup\medbreak}%
4634
 
\def#2{\begingroup\obeylines\activeparens\spacesplit#3}%
4635
 
\parindent=0in
4636
 
\advance\leftskip by \defbodyindent
4637
 
\exdentamount=\defbodyindent
4638
 
\begingroup %
4639
 
\catcode 61=\active % 61 is `='
4640
 
\obeylines\activeparens\spacesplit#3}
4641
 
 
 
4733
% Common pieces to start any @def...
4642
4734
% #1 is the \E... control sequence to end the definition (which we define).
4643
 
% #2 is the \...x control sequence for consecutive fns (which we define).
4644
 
% #3 is the control sequence to call to resume processing.
 
4735
% #2 is the \...x control sequence (which our caller defines).
 
4736
% #3 is the control sequence to process the header, such as \defunheader.
 
4737
 
4738
\def\parsebodycommon#1#2#3{%
 
4739
  \begingroup\inENV
 
4740
  % If there are two @def commands in a row, we'll have a \nobreak,
 
4741
  % which is there to keep the function description together with its
 
4742
  % header.  But if there's nothing but headers, we want to allow a
 
4743
  % break after all.
 
4744
  \ifnum\lastpenalty = 10000 \penalty0 \fi
 
4745
  \medbreak
 
4746
  %
 
4747
  % Define the \E... end token that this defining construct specifies
 
4748
  % so that it will exit this group.
 
4749
  \def#1{\endgraf\endgroup\medbreak}%
 
4750
  %
 
4751
  \parindent=0in
 
4752
  \advance\leftskip by \defbodyindent
 
4753
  \exdentamount=\defbodyindent
 
4754
}
 
4755
 
 
4756
% Process body of @defun, @deffn, @defmac, etc.
 
4757
%
 
4758
\def\defparsebody#1#2#3{%
 
4759
  \parsebodycommon{#1}{#2}{#3}%
 
4760
  \def#2{\begingroup\obeylines\activeparens\spacesplit#3}%
 
4761
  \catcode61=\active % 61 is `='
 
4762
  \begingroup\obeylines\activeparens
 
4763
  \spacesplit#3%
 
4764
}
 
4765
 
 
4766
% #1, #2, #3 are the common arguments (see \defparsebody).
4645
4767
% #4, delimited by the space, is the class name.
4646
4768
%
4647
 
\def\defmethparsebody#1#2#3#4 {\begingroup\inENV %
4648
 
\medbreak %
4649
 
% Define the end token that this defining construct specifies
4650
 
% so that it will exit this group.
4651
 
\def#1{\endgraf\endgroup\medbreak}%
4652
 
\def#2##1 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}}}%
4653
 
\parindent=0in
4654
 
\advance\leftskip by \defbodyindent
4655
 
\exdentamount=\defbodyindent
4656
 
\begingroup\obeylines\activeparens\spacesplit{#3{#4}}}
 
4769
\def\defmethparsebody#1#2#3#4 {%
 
4770
  \parsebodycommon{#1}{#2}{#3}%
 
4771
  \def#2##1 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}}}%
 
4772
  \begingroup\obeylines\activeparens
 
4773
  \spacesplit{#3{#4}}%
 
4774
}
4657
4775
 
4658
4776
% Used for @deftypemethod and @deftypeivar.
4659
 
% #1 is the \E... control sequence to end the definition (which we define).
4660
 
% #2 is the \...x control sequence for consecutive fns (which we define).
4661
 
% #3 is the control sequence to call to resume processing.
 
4777
% #1, #2, #3 are the common arguments (see \defparsebody).
4662
4778
% #4, delimited by a space, is the class name.
4663
4779
% #5 is the method's return type.
4664
4780
%
4665
 
\def\deftypemethparsebody#1#2#3#4 #5 {\begingroup\inENV
4666
 
  \medbreak
4667
 
  \def#1{\endgraf\endgroup\medbreak}%
 
4781
\def\deftypemethparsebody#1#2#3#4 #5 {%
 
4782
  \parsebodycommon{#1}{#2}{#3}%
4668
4783
  \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}}}
 
4784
  \begingroup\obeylines\activeparens
 
4785
  \spacesplit{#3{#4}{#5}}%
 
4786
}
4673
4787
 
4674
4788
% Used for @deftypeop.  The change from \deftypemethparsebody is an
4675
4789
% extra argument at the beginning which is the `category', instead of it
4678
4792
% input at hand.  Thus also need a control sequence (passed as #5) for
4679
4793
% the \E... definition to assign the category name to.
4680
4794
4681
 
\def\deftypeopparsebody#1#2#3#4#5 #6 {\begingroup\inENV
4682
 
  \medbreak
4683
 
  \def#1{\endgraf\endgroup\medbreak}%
 
4795
\def\deftypeopparsebody#1#2#3#4#5 #6 {%
 
4796
  \parsebodycommon{#1}{#2}{#3}%
4684
4797
  \def#2##1 ##2 ##3 {%
4685
4798
    \def#4{##1}%
4686
4799
    \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}}}
 
4800
  \begingroup\obeylines\activeparens
 
4801
  \spacesplit{#3{#5}{#6}}%
 
4802
}
4691
4803
 
4692
 
\def\defopparsebody #1#2#3#4#5 {\begingroup\inENV %
4693
 
\medbreak %
4694
 
% Define the end token that this defining construct specifies
4695
 
% so that it will exit this group.
4696
 
\def#1{\endgraf\endgroup\medbreak}%
4697
 
\def#2##1 ##2 {\def#4{##1}%
4698
 
\begingroup\obeylines\activeparens\spacesplit{#3{##2}}}%
4699
 
\parindent=0in
4700
 
\advance\leftskip by \defbodyindent
4701
 
\exdentamount=\defbodyindent
4702
 
\begingroup\obeylines\activeparens\spacesplit{#3{#5}}}
 
4804
% For @defop.
 
4805
\def\defopparsebody #1#2#3#4#5 {%
 
4806
  \parsebodycommon{#1}{#2}{#3}%
 
4807
  \def#2##1 ##2 {\def#4{##1}%
 
4808
    \begingroup\obeylines\activeparens\spacesplit{#3{##2}}}%
 
4809
  \begingroup\obeylines\activeparens
 
4810
  \spacesplit{#3{#5}}%
 
4811
}
4703
4812
 
4704
4813
% These parsing functions are similar to the preceding ones
4705
4814
% except that they do not make parens into active characters.
4706
4815
% These are used for "variables" since they have no arguments.
4707
 
 
4708
 
\def\defvarparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
4709
 
\medbreak %
4710
 
% Define the end token that this defining construct specifies
4711
 
% so that it will exit this group.
4712
 
\def#1{\endgraf\endgroup\medbreak}%
4713
 
\def#2{\begingroup\obeylines\spacesplit#3}%
4714
 
\parindent=0in
4715
 
\advance\leftskip by \defbodyindent
4716
 
\exdentamount=\defbodyindent
4717
 
\begingroup %
4718
 
\catcode 61=\active %
4719
 
\obeylines\spacesplit#3}
4720
 
 
4721
 
% This is used for \def{tp,vr}parsebody.  It could probably be used for
4722
 
% some of the others, too, with some judicious conditionals.
4723
4816
%
4724
 
\def\parsebodycommon#1#2#3{%
4725
 
  \begingroup\inENV %
4726
 
  \medbreak %
4727
 
  % Define the end token that this defining construct specifies
4728
 
  % so that it will exit this group.
4729
 
  \def#1{\endgraf\endgroup\medbreak}%
4730
 
  \def#2##1 {\begingroup\obeylines\spacesplit{#3{##1}}}%
4731
 
  \parindent=0in
4732
 
  \advance\leftskip by \defbodyindent
4733
 
  \exdentamount=\defbodyindent
4734
 
  \begingroup\obeylines
 
4817
\def\defvarparsebody #1#2#3{%
 
4818
  \parsebodycommon{#1}{#2}{#3}%
 
4819
  \def#2{\begingroup\obeylines\spacesplit#3}%
 
4820
  \catcode61=\active %
 
4821
  \begingroup\obeylines
 
4822
  \spacesplit#3%
 
4823
}
 
4824
 
 
4825
% @defopvar.
 
4826
\def\defopvarparsebody #1#2#3#4#5 {%
 
4827
  \parsebodycommon{#1}{#2}{#3}%
 
4828
  \def#2##1 ##2 {\def#4{##1}%
 
4829
    \begingroup\obeylines\spacesplit{#3{##2}}}%
 
4830
  \begingroup\obeylines
 
4831
  \spacesplit{#3{#5}}%
4735
4832
}
4736
4833
 
4737
4834
\def\defvrparsebody#1#2#3#4 {%
4738
4835
  \parsebodycommon{#1}{#2}{#3}%
 
4836
  \def#2##1 {\begingroup\obeylines\spacesplit{#3{##1}}}%
 
4837
  \begingroup\obeylines
4739
4838
  \spacesplit{#3{#4}}%
4740
4839
}
4741
4840
 
4750
4849
%
4751
4850
\def\deftpparsebody #1#2#3#4 {%
4752
4851
  \parsebodycommon{#1}{#2}{#3}%
 
4852
  \def#2##1 {\begingroup\obeylines\spacesplit{#3{##1}}}%
 
4853
  \begingroup\obeylines
4753
4854
  \spacesplit{\parsetpheaderline{#3{#4}}}\empty
4754
4855
}
4755
4856
 
4766
4867
  #1{\removeemptybraces#2\relax}{#3}%
4767
4868
}%
4768
4869
 
4769
 
\def\defopvarparsebody #1#2#3#4#5 {\begingroup\inENV %
4770
 
\medbreak %
4771
 
% Define the end token that this defining construct specifies
4772
 
% so that it will exit this group.
4773
 
\def#1{\endgraf\endgroup\medbreak}%
4774
 
\def#2##1 ##2 {\def#4{##1}%
4775
 
\begingroup\obeylines\spacesplit{#3{##2}}}%
4776
 
\parindent=0in
4777
 
\advance\leftskip by \defbodyindent
4778
 
\exdentamount=\defbodyindent
4779
 
\begingroup\obeylines\spacesplit{#3{#5}}}
4780
 
 
4781
4870
% Split up #2 at the first space token.
4782
4871
% call #1 with two arguments:
4783
4872
%  the first is all of #2 before the space token,
4784
4873
%  the second is all of #2 after that space token.
4785
4874
% If #2 contains no space token, all of it is passed as the first arg
4786
4875
% and the second is passed as empty.
4787
 
 
 
4876
%
4788
4877
{\obeylines
4789
4878
\gdef\spacesplit#1#2^^M{\endgroup\spacesplitfoo{#1}#2 \relax\spacesplitfoo}%
4790
4879
\long\gdef\spacesplitfoo#1#2 #3#4\spacesplitfoo{%
4791
4880
\ifx\relax #3%
4792
4881
#1{#2}{}\else #1{#2}{#3#4}\fi}}
4793
4882
 
4794
 
% So much for the things common to all kinds of definitions.
4795
 
 
4796
4883
% Define @defun.
4797
4884
 
4798
4885
% First, define the processing that is wanted for arguments of \defun
4852
4939
% #1 is the data type, #2 the name, #3 the args.
4853
4940
\def\deftypefunheaderx #1#2 #3\relax{%
4854
4941
\doind {fn}{\code{#2}}% Make entry in function index
4855
 
\begingroup\defname {\defheaderxcond#1\relax$$$#2}{\putwordDeftypefun}%
 
4942
\begingroup\defname {\defheaderxcond#1\relax$.$#2}{\putwordDeftypefun}%
4856
4943
\deftypefunargs {#3}\endgroup %
4857
4944
\catcode 61=\other % Turn off change made in \defparsebody
4858
4945
}
4861
4948
 
4862
4949
\def\deftypefn{\defmethparsebody\Edeftypefn\deftypefnx\deftypefnheader}
4863
4950
 
4864
 
% \defheaderxcond#1\relax$$$
 
4951
% \defheaderxcond#1\relax$.$
4865
4952
% puts #1 in @code, followed by a space, but does nothing if #1 is null.
4866
 
\def\defheaderxcond#1#2$$${\ifx#1\relax\else\code{#1#2} \fi}
 
4953
\def\defheaderxcond#1#2$.${\ifx#1\relax\else\code{#1#2} \fi}
4867
4954
 
4868
4955
% #1 is the classification.  #2 is the data type.  #3 is the name and args.
4869
4956
\def\deftypefnheader #1#2#3{\deftypefnheaderx{#1}{#2}#3 \relax}
4873
4960
\begingroup
4874
4961
\normalparens % notably, turn off `&' magic, which prevents
4875
4962
%               at least some C++ text from working
4876
 
\defname {\defheaderxcond#2\relax$$$#3}{#1}%
 
4963
\defname {\defheaderxcond#2\relax$.$#3}{#1}%
4877
4964
\deftypefunargs {#4}\endgroup %
4878
4965
\catcode 61=\other % Turn off change made in \defparsebody
4879
4966
}
4919
5006
\def\deftypeopheader#1#2#3#4{%
4920
5007
  \dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index
4921
5008
  \begingroup
4922
 
    \defname{\defheaderxcond#2\relax$$$#3}
 
5009
    \defname{\defheaderxcond#2\relax$.$#3}
4923
5010
            {\deftypeopcategory\ \putwordon\ \code{#1}}%
4924
5011
    \deftypefunargs{#4}%
4925
5012
  \endgroup
4934
5021
\def\deftypemethodheader#1#2#3#4{%
4935
5022
  \dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index
4936
5023
  \begingroup
4937
 
    \defname{\defheaderxcond#2\relax$$$#3}{\putwordMethodon\ \code{#1}}%
 
5024
    \defname{\defheaderxcond#2\relax$.$#3}{\putwordMethodon\ \code{#1}}%
4938
5025
    \deftypefunargs{#4}%
4939
5026
  \endgroup
4940
5027
}
4948
5035
\def\deftypeivarheader#1#2#3{%
4949
5036
  \dosubind{vr}{\code{#3}}{\putwordof\ \code{#1}}% entry in variable index
4950
5037
  \begingroup
4951
 
    \defname{\defheaderxcond#2\relax$$$#3}
 
5038
    \defname{\defheaderxcond#2\relax$.$#3}
4952
5039
            {\putwordInstanceVariableof\ \code{#1}}%
4953
5040
    \defvarargs{#3}%
4954
5041
  \endgroup
5031
5118
% is actually part of the data type, which should not be put into the index.
5032
5119
\def\deftypevarheader #1#2{%
5033
5120
\dovarind#2 \relax% Make entry in variables index
5034
 
\begingroup\defname {\defheaderxcond#1\relax$$$#2}{\putwordDeftypevar}%
 
5121
\begingroup\defname {\defheaderxcond#1\relax$.$#2}{\putwordDeftypevar}%
5035
5122
\interlinepenalty=10000
5036
5123
\endgraf\nobreak\vskip -\parskip\nobreak
5037
5124
\endgroup}
5042
5129
\def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader}
5043
5130
 
5044
5131
\def\deftypevrheader #1#2#3{\dovarind#3 \relax%
5045
 
\begingroup\defname {\defheaderxcond#2\relax$$$#3}{#1}
 
5132
\begingroup\defname {\defheaderxcond#2\relax$.$#3}{#1}
5046
5133
\interlinepenalty=10000
5047
5134
\endgraf\nobreak\vskip -\parskip\nobreak
5048
5135
\endgroup}
5202
5289
     \message{Warning: redefining \the\macname}%
5203
5290
  \else
5204
5291
     \expandafter\ifx\csname \the\macname\endcsname \relax
5205
 
     \else \errmessage{The name \the\macname\space is reserved}\fi
 
5292
     \else \errmessage{Macro name \the\macname\space already defined}\fi
5206
5293
     \global\cslet{macsave.\the\macname}{\the\macname}%
5207
5294
     \global\expandafter\let\csname ismacro.\the\macname\endcsname=1%
5208
5295
     % Add the macroname to \macrolist
5483
5570
  \ifpdf
5484
5571
    \leavevmode
5485
5572
    \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
 
5573
    {\normalturnoffactive
 
5574
     \ifnum\filenamelength>0
 
5575
       \startlink attr{/Border [0 0 0]}%
 
5576
         goto file{\the\filename.pdf} name{#1}%
 
5577
     \else
 
5578
       \startlink attr{/Border [0 0 0]}%
 
5579
         goto name{#1}%
 
5580
     \fi
 
5581
    }%
5493
5582
    \linkcolor
5494
5583
  \fi
5495
5584
  %
5751
5840
  %
5752
5841
  \smallfonts \rm
5753
5842
  %
5754
 
  % Hang the footnote text off the number.
5755
 
  \hang
 
5843
  % Because we use hanging indentation in footnotes, a @noindent appears
 
5844
  % to exdent this text, so make it be a no-op.  makeinfo does not use
 
5845
  % hanging indentation so @noindent can still be needed within footnote
 
5846
  % text after an @example or the like (not that this is good style).
 
5847
  \let\noindent = \relax
 
5848
  %
 
5849
  % Hang the footnote text off the number.  Use \everypar in case the
 
5850
  % footnote extends for more than one paragraph.
 
5851
  \everypar = {\hang}%
5756
5852
  \textindent{\thisfootno}%
5757
5853
  %
5758
5854
  % Don't crash into the line above the footnote text.  Since this
5769
5865
 
5770
5866
}%end \catcode `\@=11
5771
5867
 
5772
 
% Set the baselineskip to #1, and the lineskip and strut size
5773
 
% correspondingly.  There is no deep meaning behind these magic numbers
5774
 
% used as factors; they just match (closely enough) what Knuth defined.
5775
 
%
5776
 
\def\lineskipfactor{.08333}
5777
 
\def\strutheightpercent{.70833}
5778
 
\def\strutdepthpercent {.29167}
5779
 
%
5780
 
\def\setleading#1{%
5781
 
  \normalbaselineskip = #1\relax
5782
 
  \normallineskip = \lineskipfactor\normalbaselineskip
5783
 
  \normalbaselines
5784
 
  \setbox\strutbox =\hbox{%
5785
 
    \vrule width0pt height\strutheightpercent\baselineskip
5786
 
                    depth \strutdepthpercent \baselineskip
5787
 
  }%
5788
 
}
5789
 
 
5790
5868
% @| inserts a changebar to the left of the current line.  It should
5791
5869
% surround any changed text.  This approach does *not* work if the
5792
5870
% change spans more than two lines of output.  To handle that, we would
5851
5929
      \global\warnednoepsftrue
5852
5930
    \fi
5853
5931
  \else
5854
 
    \imagexxx #1,,,\finish
 
5932
    \imagexxx #1,,,,,\finish
5855
5933
  \fi
5856
5934
}
5857
5935
%
5858
5936
% Arguments to @image:
5859
5937
% #1 is (mandatory) image filename; we tack on .eps extension.
5860
5938
% #2 is (optional) width, #3 is (optional) height.
5861
 
% #4 is just the usual extra ignored arg for parsing this stuff.
5862
 
\def\imagexxx#1,#2,#3,#4\finish{%
 
5939
% #4 is (ignored optional) html alt text.
 
5940
% #5 is (ignored optional) extension.
 
5941
% #6 is just the usual extra ignored arg for parsing this stuff.
 
5942
\newif\ifimagevmode
 
5943
\def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup
 
5944
  \catcode`\^^M = 5     % in case we're inside an example
 
5945
  \normalturnoffactive  % allow _ et al. in names
 
5946
  % If the image is by itself, center it.
 
5947
  \ifvmode
 
5948
    \imagevmodetrue
 
5949
    \nobreak\bigskip
 
5950
    % Usually we'll have text after the image which will insert
 
5951
    % \parskip glue, so insert it here too to equalize the space
 
5952
    % above and below. 
 
5953
    \nobreak\vskip\parskip
 
5954
    \nobreak
 
5955
    \line\bgroup\hss
 
5956
  \fi
 
5957
  %
 
5958
  % Output the image.
5863
5959
  \ifpdf
5864
 
    \centerline{\dopdfimage{#1}{#2}{#3}}%
 
5960
    \dopdfimage{#1}{#2}{#3}%
5865
5961
  \else
5866
5962
    % \epsfbox itself resets \epsf?size at each figure.
5867
5963
    \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi
5868
5964
    \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
 
5965
    \epsfbox{#1.eps}%
5887
5966
  \fi
5888
 
}
 
5967
  %
 
5968
  \ifimagevmode \hss \egroup \bigbreak \fi  % space after the image
 
5969
\endgroup}
5889
5970
 
5890
5971
 
5891
5972
\message{localization,}
5954
6035
}
5955
6036
 
5956
6037
% Parameters in order: 1) textheight; 2) textwidth; 3) voffset;
5957
 
% 4) hoffset; 5) binding offset; 6) topskip.  Then whoever calls us can
5958
 
% set \parskip and call \setleading for \baselineskip.
 
6038
% 4) hoffset; 5) binding offset; 6) topskip.  We also call
 
6039
% \setleading{\textleading}, so the caller should define \textleading.
 
6040
% The caller should also set \parskip.
5959
6041
%
5960
6042
\def\internalpagesizes#1#2#3#4#5#6{%
5961
6043
  \voffset = #3\relax
5976
6058
  \normaloffset = #4\relax
5977
6059
  \bindingoffset = #5\relax
5978
6060
  %
 
6061
  \setleading{\textleading}
 
6062
  %
5979
6063
  \parindent = \defaultparindent
5980
6064
  \setemergencystretch
5981
6065
}
5992
6076
% @letterpaper (the default).
5993
6077
\def\letterpaper{{\globaldefs = 1
5994
6078
  \parskip = 3pt plus 2pt minus 1pt
5995
 
  \setleading{13.2pt}%
 
6079
  \textleading = 13.2pt
5996
6080
  %
5997
6081
  % If page is nothing but text, make it come out even.
5998
6082
  \internalpagesizes{46\baselineskip}{6in}{\voffset}{.25in}{\bindingoffset}{36pt}%
6001
6085
% Use @smallbook to reset parameters for 7x9.5 (or so) format.
6002
6086
\def\smallbook{{\globaldefs = 1
6003
6087
  \parskip = 2pt plus 1pt
6004
 
  \setleading{12pt}%
 
6088
  \textleading = 12pt
6005
6089
  %
6006
6090
  \internalpagesizes{7.5in}{5.in}{\voffset}{.25in}{\bindingoffset}{16pt}%
6007
6091
  %
6016
6100
 
6017
6101
% Use @afourpaper to print on European A4 paper.
6018
6102
\def\afourpaper{{\globaldefs = 1
6019
 
  \setleading{12pt}%
6020
6103
  \parskip = 3pt plus 2pt minus 1pt
 
6104
  \textleading = 12pt
6021
6105
  %
6022
6106
  \internalpagesizes{53\baselineskip}{160mm}{\voffset}{4mm}{\bindingoffset}{44pt}%
6023
6107
  %
6029
6113
% From romildo@urano.iceb.ufop.br, 2 July 2000.
6030
6114
% He also recommends making @example and @lisp be small.
6031
6115
\def\afivepaper{{\globaldefs = 1
6032
 
  \setleading{12.5pt}%
6033
6116
  \parskip = 2pt plus 1pt minus 0.1pt
 
6117
  \textleading = 12.5pt
6034
6118
  %
6035
6119
  \internalpagesizes{166mm}{120mm}{\voffset}{-8mm}{\bindingoffset}{8pt}%
6036
6120
  %
6048
6132
% A specific text layout, 24x15cm overall, intended for A4 paper.  Top margin
6049
6133
% 29mm, hence bottom margin 28mm, nominal side margin 3cm.
6050
6134
\def\afourlatex{{\globaldefs = 1
6051
 
  \setleading{13.6pt}%
 
6135
  \textleading = 13.6pt
6052
6136
  %
6053
6137
  \afourpaper
6054
6138
  \internalpagesizes{237mm}{150mm}{3.6mm}{3.6mm}{3mm}{7mm}%
6055
6139
  %
 
6140
  % Must explicitly reset to 0 because we call \afourpaper, apparently,
 
6141
  % although this does not entirely make sense.
6056
6142
  \globaldefs = 0
6057
6143
}}
6058
6144
 
6060
6146
\def\afourwide{%
6061
6147
  \afourpaper
6062
6148
  \internalpagesizes{6.5in}{9.5in}{\hoffset}{\normaloffset}{\bindingoffset}{7mm}%
6063
 
  %
6064
 
  \globaldefs = 0
6065
6149
}
6066
6150
 
6067
6151
% @pagesizes TEXTHEIGHT[,TEXTWIDTH]
6075
6159
  \globaldefs = 1
6076
6160
  %
6077
6161
  \parskip = 3pt plus 2pt minus 1pt
6078
 
  \setleading{13.2pt}%
 
6162
  \setleading{\textleading}%
6079
6163
  %
6080
6164
  \internalpagesizes{#1}{\hsize}{\voffset}{\normaloffset}{\bindingoffset}{44pt}%
6081
6165
}}
6105
6189
\def\normalless{<}
6106
6190
\def\normalgreater{>}
6107
6191
\def\normalplus{+}
6108
 
\def\normaldollar{$}
 
6192
\def\normaldollar{$}%$ font-lock fix
6109
6193
 
6110
6194
% This macro is used to make a character print one way in ttfont
6111
6195
% where it can probably just be output, and another way in other fonts,
6154
6238
\catcode`\+=\active
6155
6239
\def+{{\tt \char 43}}
6156
6240
\catcode`\$=\active
6157
 
\def${\ifusingit{{\sl\$}}\normaldollar}
 
6241
\def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix
6158
6242
%\catcode 27=\active
6159
6243
%\def^^[{$\diamondsuit$}
6160
6244
 
6199
6283
@let<=@normalless
6200
6284
@let>=@normalgreater
6201
6285
@let+=@normalplus
6202
 
@let$=@normaldollar}
 
6286
@let$=@normaldollar}%$ font-lock fix
6203
6287
 
6204
6288
@def@normalturnoffactive{@let"=@normaldoublequote
6205
6289
@let\=@normalbackslash
6210
6294
@let<=@normalless
6211
6295
@let>=@normalgreater
6212
6296
@let+=@normalplus
6213
 
@let$=@normaldollar}
 
6297
@let$=@normaldollar}%$ font-lock fix
6214
6298
 
6215
6299
% Make _ and + \other characters, temporarily.
6216
6300
% This is canceled by @fixbackslash.