Mercurial > emacs
comparison lispintro/texinfo.tex @ 47006:f267224443ae
Update to version 4.2
author | Robert J. Chassell <bob@rattlesnake.com> |
---|---|
date | Fri, 23 Aug 2002 19:47:41 +0000 |
parents | a8ee89e61d20 |
children | 23a1cea22d13 |
comparison
equal
deleted
inserted
replaced
47005:186a9c64b0fd | 47006:f267224443ae |
---|---|
1 % texinfo.tex -- TeX macros to handle Texinfo files. | 1 % texinfo.tex -- TeX macros to handle Texinfo files. |
2 % | 2 % |
3 % Load plain if necessary, i.e., if running under initex. | 3 % Load plain if necessary, i.e., if running under initex. |
4 \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi | 4 \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi |
5 % | 5 % |
6 \def\texinfoversion{2001-05-24.08} | 6 \def\texinfoversion{2002-06-07.15} |
7 % | 7 % |
8 % Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, | 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 % This texinfo.tex file is free software; you can redistribute it and/or | 11 % This texinfo.tex file is free software; you can redistribute it and/or |
12 % modify it under the terms of the GNU General Public License as | 12 % modify it under the terms of the GNU General Public License as |
13 % published by the Free Software Foundation; either version 2, or (at | 13 % published by the Free Software Foundation; either version 2, or (at |
14 % your option) any later version. | 14 % your option) any later version. |
28 % what you give them. Help stamp out software-hoarding! | 28 % what you give them. Help stamp out software-hoarding! |
29 % | 29 % |
30 % Please try the latest version of texinfo.tex before submitting bug | 30 % Please try the latest version of texinfo.tex before submitting bug |
31 % reports; you can get the latest version from: | 31 % reports; you can get the latest version from: |
32 % ftp://ftp.gnu.org/gnu/texinfo.tex | 32 % ftp://ftp.gnu.org/gnu/texinfo.tex |
33 % (and all GNU mirrors, see http://www.gnu.org/order/ftp.html) | 33 % (and all GNU mirrors, see http://www.gnu.org/order/ftp.html) |
34 % ftp://texinfo.org/tex/texinfo.tex | 34 % ftp://texinfo.org/texinfo/texinfo.tex |
35 % ftp://us.ctan.org/macros/texinfo/texinfo.tex | 35 % ftp://tug.org/tex/texinfo.tex |
36 % (and all CTAN mirrors, finger ctan@us.ctan.org for a list). | 36 % (and all CTAN mirrors, see http://www.ctan.org), |
37 % /home/gd/gnu/doc/texinfo.tex on the GNU machines. | 37 % and /home/gd/gnu/doc/texinfo.tex on the GNU machines. |
38 % | |
38 % The texinfo.tex in any given Texinfo distribution could well be out | 39 % The texinfo.tex in any given Texinfo distribution could well be out |
39 % of date, so if that's what you're using, please check. | 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 % Send bug reports to bug-texinfo@gnu.org. Please include including a | 45 % 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 | 46 % complete document in each bug report with which we can reproduce the |
44 % problem. Patches are, of course, greatly appreciated. | 47 % problem. Patches are, of course, greatly appreciated. |
45 % | 48 % |
48 % manual foo.texi, however, you can get away with this: | 51 % manual foo.texi, however, you can get away with this: |
49 % tex foo.texi | 52 % tex foo.texi |
50 % texindex foo.?? | 53 % texindex foo.?? |
51 % tex foo.texi | 54 % tex foo.texi |
52 % tex foo.texi | 55 % tex foo.texi |
53 % dvips foo.dvi -o # or whatever, to process the dvi file; this makes foo.ps. | 56 % dvips foo.dvi -o # or whatever; this makes foo.ps. |
54 % The extra runs of TeX get the cross-reference information correct. | 57 % The extra TeX runs get the cross-reference information correct. |
55 % Sometimes one run after texindex suffices, and sometimes you need more | 58 % Sometimes one run after texindex suffices, and sometimes you need more |
56 % than two; texi2dvi does it as many times as necessary. | 59 % than two; texi2dvi does it as many times as necessary. |
57 % | 60 % |
58 % It is possible to adapt texinfo.tex for other languages. You can get | 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 \message{Loading texinfo [version \texinfoversion]:} | 64 \message{Loading texinfo [version \texinfoversion]:} |
62 | 65 |
63 % If in a .fmt file, print the version number | 66 % If in a .fmt file, print the version number |
64 % and turn on active characters that we couldn't do earlier because | 67 % and turn on active characters that we couldn't do earlier because |
439 \def\singlespace{% | 442 \def\singlespace{% |
440 % Why was this kern here? It messes up equalizing space above and below | 443 % Why was this kern here? It messes up equalizing space above and below |
441 % environments. --karl, 6may93 | 444 % environments. --karl, 6may93 |
442 %{\advance \baselineskip by -\singlespaceskip | 445 %{\advance \baselineskip by -\singlespaceskip |
443 %\kern \baselineskip}% | 446 %\kern \baselineskip}% |
444 \setleading \singlespaceskip | 447 \setleading\singlespaceskip |
445 } | 448 } |
446 | 449 |
447 %% Simple single-character @ commands | 450 %% Simple single-character @ commands |
448 | 451 |
449 % @@ prints an @ | 452 % @@ prints an @ |
831 | 834 |
832 % @asis just yields its argument. Used with @table, for example. | 835 % @asis just yields its argument. Used with @table, for example. |
833 % | 836 % |
834 \def\asis#1{#1} | 837 \def\asis#1{#1} |
835 | 838 |
836 % @math means output in math mode. | 839 % @math outputs its argument in math mode. |
837 % We don't use $'s directly in the definition of \math because control | 840 % We don't use $'s directly in the definition of \math because we need |
838 % sequences like \math are expanded when the toc file is written. Then, | 841 % to set catcodes according to plain TeX first, to allow for subscripts, |
839 % we read the toc file back, the $'s will be normal characters (as they | 842 % superscripts, special math chars, etc. |
840 % should be, according to the definition of Texinfo). So we must use a | 843 % |
841 % control sequence to switch into and out of math mode. | 844 % @math does not do math typesetting in section titles, index |
842 % | 845 % entries, and other such contexts where the catcodes are set before |
843 % This isn't quite enough for @math to work properly in indices, but it | 846 % @math gets a chance to work. This could perhaps be fixed, but for now |
844 % seems unlikely it will ever be needed there. | 847 % at least we can have real math in the main text, where it's needed most. |
845 % | 848 % |
846 \let\implicitmath = $ | 849 \let\implicitmath = $%$ font-lock fix |
847 \def\math#1{\implicitmath #1\implicitmath} | 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 % @bullet and @minus need the same treatment as @math, just above. | 877 % @bullet and @minus need the same treatment as @math, just above. |
850 \def\bullet{\implicitmath\ptexbullet\implicitmath} | 878 \def\bullet{\implicitmath\ptexbullet\implicitmath} |
851 \def\minus{\implicitmath-\implicitmath} | 879 \def\minus{\implicitmath-\implicitmath} |
852 | 880 |
925 \pdfoutput = 1 | 953 \pdfoutput = 1 |
926 \input pdfcolor | 954 \input pdfcolor |
927 \def\dopdfimage#1#2#3{% | 955 \def\dopdfimage#1#2#3{% |
928 \def\imagewidth{#2}% | 956 \def\imagewidth{#2}% |
929 \def\imageheight{#3}% | 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 \ifnum\pdftexversion < 14 | 960 \ifnum\pdftexversion < 14 |
931 \pdfimage | 961 \immediate\pdfimage |
932 \else | 962 \else |
933 \pdfximage | 963 \immediate\pdfximage |
934 \fi | 964 \fi |
935 \ifx\empty\imagewidth\else width \imagewidth \fi | 965 \ifx\empty\imagewidth\else width \imagewidth \fi |
936 \ifx\empty\imageheight\else height \imageheight \fi | 966 \ifx\empty\imageheight\else height \imageheight \fi |
937 \ifnum\pdftexversion<13 | 967 \ifnum\pdftexversion<13 |
938 #1.pdf% | 968 #1.pdf% |
940 {#1.pdf}% | 970 {#1.pdf}% |
941 \fi | 971 \fi |
942 \ifnum\pdftexversion < 14 \else | 972 \ifnum\pdftexversion < 14 \else |
943 \pdfrefximage \pdflastximage | 973 \pdfrefximage \pdflastximage |
944 \fi} | 974 \fi} |
945 \def\pdfmkdest#1{\pdfdest name{#1} xyz} | 975 \def\pdfmkdest#1{{\normalturnoffactive \pdfdest name{#1} xyz}} |
946 \def\pdfmkpgn#1{#1@} | 976 \def\pdfmkpgn#1{#1} |
947 \let\linkcolor = \Blue % was Cyan, but that seems light? | 977 \let\linkcolor = \Blue % was Cyan, but that seems light? |
948 \def\endlink{\Black\pdfendlink} | 978 \def\endlink{\Black\pdfendlink} |
949 % Adding outlines to PDF; macros for calculating structure of outlines | 979 % Adding outlines to PDF; macros for calculating structure of outlines |
950 % come from Petr Olsak | 980 % come from Petr Olsak |
951 \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0% | 981 \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0% |
953 \def\advancenumber#1{\tempnum=\expnumber{#1}\relax | 983 \def\advancenumber#1{\tempnum=\expnumber{#1}\relax |
954 \advance\tempnum by1 | 984 \advance\tempnum by1 |
955 \expandafter\xdef\csname#1\endcsname{\the\tempnum}} | 985 \expandafter\xdef\csname#1\endcsname{\the\tempnum}} |
956 \def\pdfmakeoutlines{{% | 986 \def\pdfmakeoutlines{{% |
957 \openin 1 \jobname.toc | 987 \openin 1 \jobname.toc |
958 \ifeof 1\else\bgroup | 988 \ifeof 1\else\begingroup |
959 \closein 1 | 989 \closein 1 |
960 \indexnofonts | 990 \indexnofonts |
961 \def\tt{} | 991 \def\tt{} |
962 \let\_ = \normalunderscore | 992 \let\_ = \normalunderscore |
963 % Thanh's hack / proper braces in bookmarks | 993 % Thanh's hack / proper braces in bookmarks |
964 \edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace | 994 \edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace |
965 \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace | 995 \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace |
966 % | 996 % |
967 \def\chapentry ##1##2##3{} | 997 \def\chapentry ##1##2##3{} |
998 \let\appendixentry = \chapentry | |
968 \def\unnumbchapentry ##1##2{} | 999 \def\unnumbchapentry ##1##2{} |
969 \def\secentry ##1##2##3##4{\advancenumber{chap##2}} | 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 \def\subsecentry ##1##2##3##4##5{\advancenumber{sec##2.##3}} | 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 \def\subsubsecentry ##1##2##3##4##5##6{\advancenumber{subsec##2.##3.##4}} | 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 \input \jobname.toc | 1006 \input \jobname.toc |
976 \def\chapentry ##1##2##3{% | 1007 \def\chapentry ##1##2##3{% |
977 \pdfoutline goto name{\pdfmkpgn{##3}}count-\expnumber{chap##2}{##1}} | 1008 \pdfoutline goto name{\pdfmkpgn{##3}}count-\expnumber{chap##2}{##1}} |
1009 \let\appendixentry = \chapentry | |
978 \def\unnumbchapentry ##1##2{% | 1010 \def\unnumbchapentry ##1##2{% |
979 \pdfoutline goto name{\pdfmkpgn{##2}}{##1}} | 1011 \pdfoutline goto name{\pdfmkpgn{##2}}{##1}} |
980 \def\secentry ##1##2##3##4{% | 1012 \def\secentry ##1##2##3##4{% |
981 \pdfoutline goto name{\pdfmkpgn{##4}}count-\expnumber{sec##2.##3}{##1}} | 1013 \pdfoutline goto name{\pdfmkpgn{##4}}count-\expnumber{sec##2.##3}{##1}} |
982 \def\unnumbsecentry ##1##2{% | 1014 \def\unnumbsecentry ##1##2##3{% |
983 \pdfoutline goto name{\pdfmkpgn{##2}}{##1}} | 1015 \pdfoutline goto name{\pdfmkpgn{##3}}{##1}} |
984 \def\subsecentry ##1##2##3##4##5{% | 1016 \def\subsecentry ##1##2##3##4##5{% |
985 \pdfoutline goto name{\pdfmkpgn{##5}}count-\expnumber{subsec##2.##3.##4}{##1}} | 1017 \pdfoutline goto name{\pdfmkpgn{##5}}count-\expnumber{subsec##2.##3.##4}{##1}} |
986 \def\unnumbsubsecentry ##1##2{% | 1018 \def\unnumbsubsecentry ##1##2##3##4{% |
987 \pdfoutline goto name{\pdfmkpgn{##2}}{##1}} | 1019 \pdfoutline goto name{\pdfmkpgn{##4}}{##1}} |
988 \def\subsubsecentry ##1##2##3##4##5##6{% | 1020 \def\subsubsecentry ##1##2##3##4##5##6{% |
989 \pdfoutline goto name{\pdfmkpgn{##6}}{##1}} | 1021 \pdfoutline goto name{\pdfmkpgn{##6}}{##1}} |
990 \def\unnumbsubsubsecentry ##1##2{% | 1022 \def\unnumbsubsubsecentry ##1##2##3##4##5{% |
991 \pdfoutline goto name{\pdfmkpgn{##2}}{##1}} | 1023 \pdfoutline goto name{\pdfmkpgn{##5}}{##1}} |
992 \input \jobname.toc | 1024 \input \jobname.toc |
993 \egroup\fi | 1025 \endgroup\fi |
994 }} | 1026 }} |
995 \def\makelinks #1,{% | 1027 \def\makelinks #1,{% |
996 \def\params{#1}\def\E{END}% | 1028 \def\params{#1}\def\E{END}% |
997 \ifx\params\E | 1029 \ifx\params\E |
998 \let\nextmakelinks=\relax | 1030 \let\nextmakelinks=\relax |
1066 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi | 1098 \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi |
1067 \next} | 1099 \next} |
1068 \def\makelink{\addtokens{\toksB}% | 1100 \def\makelink{\addtokens{\toksB}% |
1069 {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0} | 1101 {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0} |
1070 \def\pdflink#1{% | 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 \linkcolor #1\endlink} | 1104 \linkcolor #1\endlink} |
1073 \def\mkpgn#1{#1@} | |
1074 \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} | 1105 \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} |
1075 \fi % \ifx\pdfoutput | 1106 \fi % \ifx\pdfoutput |
1076 | 1107 |
1077 | 1108 |
1078 \message{fonts,} | 1109 \message{fonts,} |
1085 \let\li = \sf % Sometimes we call it \li, not \sf. | 1116 \let\li = \sf % Sometimes we call it \li, not \sf. |
1086 | 1117 |
1087 % We don't need math for this one. | 1118 % We don't need math for this one. |
1088 \def\ttsl{\tenttsl} | 1119 \def\ttsl{\tenttsl} |
1089 | 1120 |
1090 % Use Computer Modern fonts at \magstephalf (11pt). | 1121 % Default leading. |
1091 \newcount\mainmagstep | 1122 \newdimen\textleading \textleading = 13.2pt |
1092 \mainmagstep=\magstephalf | 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 % Set the font macro #1 to the font named #2, adding on the | 1142 % Set the font macro #1 to the font named #2, adding on the |
1095 % specified font prefix (normally `cm'). | 1143 % specified font prefix (normally `cm'). |
1096 % #3 is the font's design size, #4 is a scale factor | 1144 % #3 is the font's design size, #4 is a scale factor |
1097 \def\setfont#1#2#3#4{\font#1=\fontprefix#2#3 scaled #4} | 1145 \def\setfont#1#2#3#4{\font#1=\fontprefix#2#3 scaled #4} |
1117 \def\sfshape{ss} | 1165 \def\sfshape{ss} |
1118 \def\sfbshape{ss} | 1166 \def\sfbshape{ss} |
1119 \def\scshape{csc} | 1167 \def\scshape{csc} |
1120 \def\scbshape{csc} | 1168 \def\scbshape{csc} |
1121 | 1169 |
1170 \newcount\mainmagstep | |
1122 \ifx\bigger\relax | 1171 \ifx\bigger\relax |
1123 \let\mainmagstep=\magstep1 | 1172 % not really supported. |
1124 \setfont\textrm\rmshape{12}{1000} | 1173 \let\mainmagstep=\magstep1 |
1125 \setfont\texttt\ttshape{12}{1000} | 1174 \setfont\textrm\rmshape{12}{1000} |
1175 \setfont\texttt\ttshape{12}{1000} | |
1126 \else | 1176 \else |
1127 \setfont\textrm\rmshape{10}{\mainmagstep} | 1177 % \mainmagstep=\magstephalf |
1128 \setfont\texttt\ttshape{10}{\mainmagstep} | 1178 \mainmagstep=\magstep1 |
1179 \setfont\textrm\rmshape{10}{\mainmagstep} | |
1180 \setfont\texttt\ttshape{10}{\mainmagstep} | |
1129 \fi | 1181 \fi |
1130 % Instead of cmb10, you many want to use cmbx10. | 1182 % Instead of cmb10, you many want to use cmbx10. |
1131 % cmbx10 is a prettier font on its own, but cmb10 | 1183 % cmbx10 is a prettier font on its own, but cmb10 |
1132 % looks better when embedded in a line with cmr10. | 1184 % looks better when embedded in a line with cmr10. |
1133 \setfont\textbf\bfshape{10}{\mainmagstep} | 1185 \setfont\textbf\bfshape{10}{\mainmagstep} |
1154 \setfont\smallsc\scshape{10}{900} | 1206 \setfont\smallsc\scshape{10}{900} |
1155 \setfont\smallttsl\ttslshape{10}{900} | 1207 \setfont\smallttsl\ttslshape{10}{900} |
1156 \font\smalli=cmmi9 | 1208 \font\smalli=cmmi9 |
1157 \font\smallsy=cmsy9 | 1209 \font\smallsy=cmsy9 |
1158 | 1210 |
1211 % Fonts for small examples (8pt). | |
1212 \setfont\smallerrm\rmshape{8}{1000} | |
1213 \setfont\smallertt\ttshape{8}{1000} | |
1214 \setfont\smallerbf\bfshape{10}{800} | |
1215 \setfont\smallerit\itshape{8}{1000} | |
1216 \setfont\smallersl\slshape{8}{1000} | |
1217 \setfont\smallersf\sfshape{8}{1000} | |
1218 \setfont\smallersc\scshape{10}{800} | |
1219 \setfont\smallerttsl\ttslshape{10}{800} | |
1220 \font\smalleri=cmmi8 | |
1221 \font\smallersy=cmsy8 | |
1222 | |
1159 % Fonts for title page: | 1223 % Fonts for title page: |
1160 \setfont\titlerm\rmbshape{12}{\magstep3} | 1224 \setfont\titlerm\rmbshape{12}{\magstep3} |
1161 \setfont\titleit\itbshape{10}{\magstep4} | 1225 \setfont\titleit\itbshape{10}{\magstep4} |
1162 \setfont\titlesl\slbshape{10}{\magstep4} | 1226 \setfont\titlesl\slbshape{10}{\magstep4} |
1163 \setfont\titlett\ttbshape{12}{\magstep3} | 1227 \setfont\titlett\ttbshape{12}{\magstep3} |
1190 \setfont\secsf\sfbshape{12}{\magstep1} | 1254 \setfont\secsf\sfbshape{12}{\magstep1} |
1191 \let\secbf\secrm | 1255 \let\secbf\secrm |
1192 \setfont\secsc\scbshape{10}{\magstep2} | 1256 \setfont\secsc\scbshape{10}{\magstep2} |
1193 \font\seci=cmmi12 scaled \magstep1 | 1257 \font\seci=cmmi12 scaled \magstep1 |
1194 \font\secsy=cmsy10 scaled \magstep2 | 1258 \font\secsy=cmsy10 scaled \magstep2 |
1195 | |
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 | 1259 |
1210 % Subsection fonts (13.15pt). | 1260 % Subsection fonts (13.15pt). |
1211 \setfont\ssecrm\rmbshape{12}{\magstephalf} | 1261 \setfont\ssecrm\rmbshape{12}{\magstephalf} |
1212 \setfont\ssecit\itbshape{10}{1315} | 1262 \setfont\ssecit\itbshape{10}{1315} |
1213 \setfont\ssecsl\slbshape{10}{1315} | 1263 \setfont\ssecsl\slbshape{10}{1315} |
1221 % The smallcaps and symbol fonts should actually be scaled \magstep1.5, | 1271 % The smallcaps and symbol fonts should actually be scaled \magstep1.5, |
1222 % but that is not a standard magnification. | 1272 % but that is not a standard magnification. |
1223 | 1273 |
1224 % In order for the font changes to affect most math symbols and letters, | 1274 % In order for the font changes to affect most math symbols and letters, |
1225 % we have to define the \textfont of the standard families. Since | 1275 % we have to define the \textfont of the standard families. Since |
1226 % texinfo doesn't allow for producing subscripts and superscripts, we | 1276 % texinfo doesn't allow for producing subscripts and superscripts except |
1227 % don't bother to reset \scriptfont and \scriptscriptfont (which would | 1277 % in the main text, we don't bother to reset \scriptfont and |
1228 % also require loading a lot more fonts). | 1278 % \scriptscriptfont (which would also require loading a lot more fonts). |
1229 % | 1279 % |
1230 \def\resetmathfonts{% | 1280 \def\resetmathfonts{% |
1231 \textfont0 = \tenrm \textfont1 = \teni \textfont2 = \tensy | 1281 \textfont0=\tenrm \textfont1=\teni \textfont2=\tensy |
1232 \textfont\itfam = \tenit \textfont\slfam = \tensl \textfont\bffam = \tenbf | 1282 \textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf |
1233 \textfont\ttfam = \tentt \textfont\sffam = \tensf | 1283 \textfont\ttfam=\tentt \textfont\sffam=\tensf |
1234 } | 1284 } |
1235 | |
1236 | 1285 |
1237 % The font-changing commands redefine the meanings of \tenSTYLE, instead | 1286 % The font-changing commands redefine the meanings of \tenSTYLE, instead |
1238 % of just \STYLE. We do this so that font changes will continue to work | 1287 % of just \STYLE. We do this so that font changes will continue to work |
1239 % in math mode, where it is the current \fam that is relevant in most | 1288 % in math mode, where it is the current \fam that is relevant in most |
1240 % cases, not the current font. Plain TeX does \def\bf{\fam=\bffam | 1289 % cases, not the current font. Plain TeX does \def\bf{\fam=\bffam |
1242 % redefine \bf itself. | 1291 % redefine \bf itself. |
1243 \def\textfonts{% | 1292 \def\textfonts{% |
1244 \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl | 1293 \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl |
1245 \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc | 1294 \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc |
1246 \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy \let\tenttsl=\textttsl | 1295 \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy \let\tenttsl=\textttsl |
1247 \resetmathfonts} | 1296 \resetmathfonts \setleading{\textleading}} |
1248 \def\titlefonts{% | 1297 \def\titlefonts{% |
1249 \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl | 1298 \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl |
1250 \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc | 1299 \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc |
1251 \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy | 1300 \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy |
1252 \let\tenttsl=\titlettsl | 1301 \let\tenttsl=\titlettsl |
1271 \def\smallfonts{% | 1320 \def\smallfonts{% |
1272 \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl | 1321 \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl |
1273 \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc | 1322 \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc |
1274 \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy | 1323 \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy |
1275 \let\tenttsl=\smallttsl | 1324 \let\tenttsl=\smallttsl |
1276 \resetmathfonts \setleading{11pt}} | 1325 \resetmathfonts \setleading{10.5pt}} |
1326 \def\smallerfonts{% | |
1327 \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl | |
1328 \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc | |
1329 \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy | |
1330 \let\tenttsl=\smallerttsl | |
1331 \resetmathfonts \setleading{9.5pt}} | |
1332 \let\smallexamplefonts = \smallerfonts | |
1277 | 1333 |
1278 % Set up the default fonts, so we can use them for creating boxes. | 1334 % Set up the default fonts, so we can use them for creating boxes. |
1279 % | 1335 % |
1280 \textfonts | 1336 \textfonts |
1281 | 1337 |
1385 \global\def\indexbreaks{\catcode`\-=\active \let-\realdash} | 1441 \global\def\indexbreaks{\catcode`\-=\active \let-\realdash} |
1386 } | 1442 } |
1387 | 1443 |
1388 \def\realdash{-} | 1444 \def\realdash{-} |
1389 \def\codedash{-\discretionary{}{}{}} | 1445 \def\codedash{-\discretionary{}{}{}} |
1390 \def\codeunder{\ifusingtt{\normalunderscore\discretionary{}{}{}}{\_}} | 1446 \def\codeunder{% |
1447 % this is all so @math{@code{var_name}+1} can work. In math mode, _ | |
1448 % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.) | |
1449 % will therefore expand the active definition of _, which is us | |
1450 % (inside @code that is), therefore an endless loop. | |
1451 \ifusingtt{\ifmmode | |
1452 \mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_. | |
1453 \else\normalunderscore \fi | |
1454 \discretionary{}{}{}}% | |
1455 {\_}% | |
1456 } | |
1391 \def\codex #1{\tclose{#1}\endgroup} | 1457 \def\codex #1{\tclose{#1}\endgroup} |
1392 | |
1393 %\let\exp=\tclose %Was temporary | |
1394 | 1458 |
1395 % @kbd is like @code, except that if the argument is just one @key command, | 1459 % @kbd is like @code, except that if the argument is just one @key command, |
1396 % then @kbd has no effect. | 1460 % then @kbd has no effect. |
1397 | 1461 |
1398 % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always), | 1462 % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always), |
1574 % If we use the new definition of \page, we always get a blank page | 1638 % If we use the new definition of \page, we always get a blank page |
1575 % after the title page, which we certainly don't want. | 1639 % after the title page, which we certainly don't want. |
1576 \oldpage | 1640 \oldpage |
1577 \endgroup | 1641 \endgroup |
1578 % | 1642 % |
1643 % Need this before the \...aftertitlepage checks so that if they are | |
1644 % in effect the toc pages will come out with page numbers. | |
1645 \HEADINGSon | |
1646 % | |
1579 % If they want short, they certainly want long too. | 1647 % If they want short, they certainly want long too. |
1580 \ifsetshortcontentsaftertitlepage | 1648 \ifsetshortcontentsaftertitlepage |
1581 \shortcontents | 1649 \shortcontents |
1582 \contents | 1650 \contents |
1583 \global\let\shortcontents = \relax | 1651 \global\let\shortcontents = \relax |
1587 \ifsetcontentsaftertitlepage | 1655 \ifsetcontentsaftertitlepage |
1588 \contents | 1656 \contents |
1589 \global\let\contents = \relax | 1657 \global\let\contents = \relax |
1590 \global\let\shortcontents = \relax | 1658 \global\let\shortcontents = \relax |
1591 \fi | 1659 \fi |
1592 % | |
1593 \ifpdf \pdfmakepagedesttrue \fi | |
1594 % | |
1595 \HEADINGSon | |
1596 } | 1660 } |
1597 | 1661 |
1598 \def\finishtitlepage{% | 1662 \def\finishtitlepage{% |
1599 \vskip4pt \hrule height 2pt width \hsize | 1663 \vskip4pt \hrule height 2pt width \hsize |
1600 \vskip\titlepagebottomglue | 1664 \vskip\titlepagebottomglue |
2348 \let\set = \relax | 2412 \let\set = \relax |
2349 \let\clear = \relax | 2413 \let\clear = \relax |
2350 \let\item = \relax | 2414 \let\item = \relax |
2351 } | 2415 } |
2352 | 2416 |
2353 % Ignore @ignore ... @end ignore. | 2417 % Ignore @ignore, @ifhtml, @ifinfo, @ifplaintext, @ifnottex, @html, @menu, |
2418 % @direntry, and @documentdescription. | |
2354 % | 2419 % |
2355 \def\ignore{\doignore{ignore}} | 2420 \def\ignore{\doignore{ignore}} |
2356 | 2421 \def\ifhtml{\doignore{ifhtml}} |
2357 % Ignore @ifinfo, @ifhtml, @ifnottex, @html, @menu, and @direntry text. | |
2358 % | |
2359 \def\ifinfo{\doignore{ifinfo}} | 2422 \def\ifinfo{\doignore{ifinfo}} |
2360 \def\ifhtml{\doignore{ifhtml}} | 2423 \def\ifplaintext{\doignore{ifplaintext}} |
2361 \def\ifnottex{\doignore{ifnottex}} | 2424 \def\ifnottex{\doignore{ifnottex}} |
2362 \def\html{\doignore{html}} | 2425 \def\html{\doignore{html}} |
2363 \def\menu{\doignore{menu}} | 2426 \def\menu{\doignore{menu}} |
2364 \def\direntry{\doignore{direntry}} | 2427 \def\direntry{\doignore{direntry}} |
2428 \def\documentdescription{\doignore{documentdescription}} | |
2429 \def\documentdescriptionword{documentdescription} | |
2365 | 2430 |
2366 % @dircategory CATEGORY -- specify a category of the dir file | 2431 % @dircategory CATEGORY -- specify a category of the dir file |
2367 % which this file should belong to. Ignore this in TeX. | 2432 % which this file should belong to. Ignore this in TeX. |
2368 \let\dircategory = \comment | 2433 \let\dircategory = \comment |
2369 | 2434 |
2386 \catcode`\} = 9 | 2451 \catcode`\} = 9 |
2387 % | 2452 % |
2388 % We must not have @c interpreted as a control sequence. | 2453 % We must not have @c interpreted as a control sequence. |
2389 \catcode`\@ = 12 | 2454 \catcode`\@ = 12 |
2390 % | 2455 % |
2391 % Make the letter c a comment character so that the rest of the line | 2456 \def\ignoreword{#1}% |
2392 % will be ignored. This way, the document can have (for example) | 2457 \ifx\ignoreword\documentdescriptionword |
2393 % @c @end ifinfo | 2458 % The c kludge breaks documentdescription, since |
2394 % and the @end ifinfo will be properly ignored. | 2459 % `documentdescription' contains a `c'. Means not everything will |
2395 % (We've just changed @ to catcode 12.) | 2460 % be ignored inside @documentdescription, but oh well... |
2396 \catcode`\c = 14 | 2461 \else |
2397 % | 2462 % Make the letter c a comment character so that the rest of the line |
2398 % And now expand that command. | 2463 % will be ignored. This way, the document can have (for example) |
2464 % @c @end ifinfo | |
2465 % and the @end ifinfo will be properly ignored. | |
2466 % (We've just changed @ to catcode 12.) | |
2467 \catcode`\c = 14 | |
2468 \fi | |
2469 % | |
2470 % And now expand the command defined above. | |
2399 \doignoretext | 2471 \doignoretext |
2400 } | 2472 } |
2401 | 2473 |
2402 % What we do to finish off ignored text. | 2474 % What we do to finish off ignored text. |
2403 % | 2475 % |
2465 % | 2537 % |
2466 \nullfont | 2538 \nullfont |
2467 \let\tenrm=\nullfont \let\tenit=\nullfont \let\tensl=\nullfont | 2539 \let\tenrm=\nullfont \let\tenit=\nullfont \let\tensl=\nullfont |
2468 \let\tenbf=\nullfont \let\tentt=\nullfont \let\smallcaps=\nullfont | 2540 \let\tenbf=\nullfont \let\tentt=\nullfont \let\smallcaps=\nullfont |
2469 \let\tensf=\nullfont | 2541 \let\tensf=\nullfont |
2470 % Similarly for index fonts (mostly for their use in smallexample). | 2542 % Similarly for index fonts. |
2471 \let\smallrm=\nullfont \let\smallit=\nullfont \let\smallsl=\nullfont | 2543 \let\smallrm=\nullfont \let\smallit=\nullfont \let\smallsl=\nullfont |
2472 \let\smallbf=\nullfont \let\smalltt=\nullfont \let\smallsc=\nullfont | 2544 \let\smallbf=\nullfont \let\smalltt=\nullfont \let\smallsc=\nullfont |
2473 \let\smallsf=\nullfont | 2545 \let\smallsf=\nullfont |
2546 % Similarly for smallexample fonts. | |
2547 \let\smallerrm=\nullfont \let\smallerit=\nullfont \let\smallersl=\nullfont | |
2548 \let\smallerbf=\nullfont \let\smallertt=\nullfont \let\smallersc=\nullfont | |
2549 \let\smallersf=\nullfont | |
2474 % | 2550 % |
2475 % Don't complain when characters are missing from the fonts. | 2551 % Don't complain when characters are missing from the fonts. |
2476 \tracinglostchars = 0 | 2552 \tracinglostchars = 0 |
2477 % | 2553 % |
2478 % Don't bother to do space factor calculations. | 2554 % Don't bother to do space factor calculations. |
2580 } | 2656 } |
2581 \def\ifclearsucceed{\conditionalsucceed{ifclear}} | 2657 \def\ifclearsucceed{\conditionalsucceed{ifclear}} |
2582 \def\ifclearfail{\nestedignore{ifclear}} | 2658 \def\ifclearfail{\nestedignore{ifclear}} |
2583 \defineunmatchedend{ifclear} | 2659 \defineunmatchedend{ifclear} |
2584 | 2660 |
2585 % @iftex, @ifnothtml, @ifnotinfo always succeed; we read the text | 2661 % @iftex, @ifnothtml, @ifnotinfo, @ifnotplaintext always succeed; we |
2586 % following, through the first @end iftex (etc.). Make `@end iftex' | 2662 % read the text following, through the first @end iftex (etc.). Make |
2587 % (etc.) valid only after an @iftex. | 2663 % `@end iftex' (etc.) valid only after an @iftex. |
2588 % | 2664 % |
2589 \def\iftex{\conditionalsucceed{iftex}} | 2665 \def\iftex{\conditionalsucceed{iftex}} |
2590 \def\ifnothtml{\conditionalsucceed{ifnothtml}} | 2666 \def\ifnothtml{\conditionalsucceed{ifnothtml}} |
2591 \def\ifnotinfo{\conditionalsucceed{ifnotinfo}} | 2667 \def\ifnotinfo{\conditionalsucceed{ifnotinfo}} |
2668 \def\ifnotplaintext{\conditionalsucceed{ifnotplaintext}} | |
2592 \defineunmatchedend{iftex} | 2669 \defineunmatchedend{iftex} |
2593 \defineunmatchedend{ifnothtml} | 2670 \defineunmatchedend{ifnothtml} |
2594 \defineunmatchedend{ifnotinfo} | 2671 \defineunmatchedend{ifnotinfo} |
2595 | 2672 \defineunmatchedend{ifnotplaintext} |
2596 % We can't just want to start a group at @iftex (for example) and end it | 2673 |
2597 % at @end iftex, since then @set commands inside the conditional have no | 2674 % We can't just want to start a group at @iftex (etc.) and end it at |
2675 % @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 | 2676 % 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 | 2677 % 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 | 2678 % just define it to fail again with an ``unmatched end'' error, since |
2601 % the @ifset might be nested.) | 2679 % the @ifset might be nested.) |
2602 % | 2680 % |
2705 | 2783 |
2706 % like the previous two, but they put @code around the argument. | 2784 % like the previous two, but they put @code around the argument. |
2707 \def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer} | 2785 \def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer} |
2708 \def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}} | 2786 \def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}} |
2709 | 2787 |
2788 % Take care of texinfo commands likely to appear in an index entry. | |
2789 % (Must be a way to avoid doing expansion at all, and thus not have to | |
2790 % laboriously list every single command here.) | |
2791 % | |
2710 \def\indexdummies{% | 2792 \def\indexdummies{% |
2711 \def\ { }% | 2793 \def\ { }% |
2794 \def\@{@}% change to @@ when we switch to @ as escape char in aux files. | |
2795 % Need these in case \tex is in effect and \{ is a \delimiter again. | |
2796 % But can't use \lbracecmd and \rbracecmd because texindex assumes | |
2797 % braces and backslashes are used only as delimiters. | |
2798 \let\{ = \mylbrace | |
2799 \let\} = \myrbrace | |
2800 \def\_{{\realbackslash _}}% | |
2801 \normalturnoffactive | |
2802 % | |
2712 % Take care of the plain tex accent commands. | 2803 % Take care of the plain tex accent commands. |
2804 \def\,##1{\realbackslash ,{##1}}% | |
2713 \def\"{\realbackslash "}% | 2805 \def\"{\realbackslash "}% |
2714 \def\`{\realbackslash `}% | 2806 \def\`{\realbackslash `}% |
2715 \def\'{\realbackslash '}% | 2807 \def\'{\realbackslash '}% |
2716 \def\^{\realbackslash ^}% | 2808 \def\^{\realbackslash ^}% |
2717 \def\~{\realbackslash ~}% | 2809 \def\~{\realbackslash ~}% |
2720 \def\c{\realbackslash c}% | 2812 \def\c{\realbackslash c}% |
2721 \def\d{\realbackslash d}% | 2813 \def\d{\realbackslash d}% |
2722 \def\u{\realbackslash u}% | 2814 \def\u{\realbackslash u}% |
2723 \def\v{\realbackslash v}% | 2815 \def\v{\realbackslash v}% |
2724 \def\H{\realbackslash H}% | 2816 \def\H{\realbackslash H}% |
2817 \def\dotless##1{\realbackslash dotless {##1}}% | |
2725 % Take care of the plain tex special European modified letters. | 2818 % Take care of the plain tex special European modified letters. |
2819 \def\AA{\realbackslash AA}% | |
2820 \def\AE{\realbackslash AE}% | |
2821 \def\L{\realbackslash L}% | |
2822 \def\OE{\realbackslash OE}% | |
2823 \def\O{\realbackslash O}% | |
2824 \def\aa{\realbackslash aa}% | |
2825 \def\ae{\realbackslash ae}% | |
2826 \def\l{\realbackslash l}% | |
2726 \def\oe{\realbackslash oe}% | 2827 \def\oe{\realbackslash oe}% |
2727 \def\ae{\realbackslash ae}% | |
2728 \def\aa{\realbackslash aa}% | |
2729 \def\OE{\realbackslash OE}% | |
2730 \def\AE{\realbackslash AE}% | |
2731 \def\AA{\realbackslash AA}% | |
2732 \def\o{\realbackslash o}% | 2828 \def\o{\realbackslash o}% |
2733 \def\O{\realbackslash O}% | |
2734 \def\l{\realbackslash l}% | |
2735 \def\L{\realbackslash L}% | |
2736 \def\ss{\realbackslash ss}% | 2829 \def\ss{\realbackslash ss}% |
2737 % Take care of texinfo commands likely to appear in an index entry. | 2830 % |
2738 % (Must be a way to avoid doing expansion at all, and thus not have to | 2831 % Although these internals commands shouldn't show up, sometimes they do. |
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 }% | |
2748 \def\bf{\realbackslash bf }% | 2832 \def\bf{\realbackslash bf }% |
2833 \def\gtr{\realbackslash gtr}% | |
2834 \def\hat{\realbackslash hat}% | |
2835 \def\less{\realbackslash less}% | |
2749 %\def\rm{\realbackslash rm }% | 2836 %\def\rm{\realbackslash rm }% |
2837 \def\sf{\realbackslash sf}% | |
2750 \def\sl{\realbackslash sl }% | 2838 \def\sl{\realbackslash sl }% |
2751 \def\sf{\realbackslash sf}% | 2839 \def\tclose##1{\realbackslash tclose {##1}}% |
2752 \def\tt{\realbackslash tt}% | 2840 \def\tt{\realbackslash tt}% |
2753 \def\gtr{\realbackslash gtr}% | 2841 % |
2754 \def\less{\realbackslash less}% | 2842 \def\b##1{\realbackslash b {##1}}% |
2755 \def\hat{\realbackslash hat}% | 2843 \def\i##1{\realbackslash i {##1}}% |
2844 \def\sc##1{\realbackslash sc {##1}}% | |
2845 \def\t##1{\realbackslash t {##1}}% | |
2846 \def\r##1{\realbackslash r {##1}}% | |
2847 % | |
2756 \def\TeX{\realbackslash TeX}% | 2848 \def\TeX{\realbackslash TeX}% |
2849 \def\acronym##1{\realbackslash acronym {##1}}% | |
2850 \def\cite##1{\realbackslash cite {##1}}% | |
2851 \def\code##1{\realbackslash code {##1}}% | |
2852 \def\command##1{\realbackslash command {##1}}% | |
2853 \def\dfn##1{\realbackslash dfn {##1}}% | |
2757 \def\dots{\realbackslash dots }% | 2854 \def\dots{\realbackslash dots }% |
2758 \def\result{\realbackslash result}% | 2855 \def\emph##1{\realbackslash emph {##1}}% |
2759 \def\equiv{\realbackslash equiv}% | 2856 \def\env##1{\realbackslash env {##1}}% |
2760 \def\expansion{\realbackslash expansion}% | 2857 \def\file##1{\realbackslash file {##1}}% |
2761 \def\print{\realbackslash print}% | 2858 \def\kbd##1{\realbackslash kbd {##1}}% |
2762 \def\error{\realbackslash error}% | 2859 \def\key##1{\realbackslash key {##1}}% |
2763 \def\point{\realbackslash point}% | 2860 \def\math##1{\realbackslash math {##1}}% |
2764 \def\copyright{\realbackslash copyright}% | 2861 \def\option##1{\realbackslash option {##1}}% |
2765 \def\tclose##1{\realbackslash tclose {##1}}% | 2862 \def\samp##1{\realbackslash samp {##1}}% |
2766 \def\code##1{\realbackslash code {##1}}% | 2863 \def\strong##1{\realbackslash strong {##1}}% |
2767 \def\uref##1{\realbackslash uref {##1}}% | 2864 \def\uref##1{\realbackslash uref {##1}}% |
2768 \def\url##1{\realbackslash url {##1}}% | 2865 \def\url##1{\realbackslash url {##1}}% |
2769 \def\env##1{\realbackslash env {##1}}% | |
2770 \def\command##1{\realbackslash command {##1}}% | |
2771 \def\option##1{\realbackslash option {##1}}% | |
2772 \def\dotless##1{\realbackslash dotless {##1}}% | |
2773 \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}}% | |
2783 \def\var##1{\realbackslash var {##1}}% | 2866 \def\var##1{\realbackslash var {##1}}% |
2784 \def\kbd##1{\realbackslash kbd {##1}}% | 2867 \def\w{\realbackslash w }% |
2785 \def\dfn##1{\realbackslash dfn {##1}}% | 2868 % |
2786 \def\emph##1{\realbackslash emph {##1}}% | 2869 % These math commands don't seem likely to be used in index entries. |
2787 \def\acronym##1{\realbackslash acronym {##1}}% | 2870 \def\copyright{\realbackslash copyright}% |
2871 \def\equiv{\realbackslash equiv}% | |
2872 \def\error{\realbackslash error}% | |
2873 \def\expansion{\realbackslash expansion}% | |
2874 \def\point{\realbackslash point}% | |
2875 \def\print{\realbackslash print}% | |
2876 \def\result{\realbackslash result}% | |
2788 % | 2877 % |
2789 % Handle some cases of @value -- where the variable name does not | 2878 % Handle some cases of @value -- where the variable name does not |
2790 % contain - or _, and the value does not contain any | 2879 % contain - or _, and the value does not contain any |
2791 % (non-fully-expandable) commands. | 2880 % (non-fully-expandable) commands. |
2792 \let\value = \expandablevalue | 2881 \let\value = \expandablevalue |
2796 \turnoffmacros | 2885 \turnoffmacros |
2797 } | 2886 } |
2798 | 2887 |
2799 % If an index command is used in an @example environment, any spaces | 2888 % If an index command is used in an @example environment, any spaces |
2800 % therein should become regular spaces in the raw index file, not the | 2889 % therein should become regular spaces in the raw index file, not the |
2801 % expansion of \tie (\\leavevmode \penalty \@M \ ). | 2890 % expansion of \tie (\leavevmode \penalty \@M \ ). |
2802 {\obeyspaces | 2891 {\obeyspaces |
2803 \gdef\unsepspaces{\obeyspaces\let =\space}} | 2892 \gdef\unsepspaces{\obeyspaces\let =\space}} |
2804 | 2893 |
2805 % \indexnofonts no-ops all font-change commands. | 2894 % \indexnofonts no-ops all font-change commands. |
2806 % This is used when outputting the strings to sort the index by. | 2895 % This is used when outputting the strings to sort the index by. |
2807 \def\indexdummyfont#1{#1} | 2896 \def\indexdummyfont#1{#1} |
2808 \def\indexdummytex{TeX} | 2897 \def\indexdummytex{TeX} |
2809 \def\indexdummydots{...} | 2898 \def\indexdummydots{...} |
2810 | 2899 |
2811 \def\indexnofonts{% | 2900 \def\indexnofonts{% |
2812 % Just ignore accents. | 2901 \def\@{@}% |
2902 % how to handle braces? | |
2903 \def\_{\normalunderscore}% | |
2904 % | |
2813 \let\,=\indexdummyfont | 2905 \let\,=\indexdummyfont |
2814 \let\"=\indexdummyfont | 2906 \let\"=\indexdummyfont |
2815 \let\`=\indexdummyfont | 2907 \let\`=\indexdummyfont |
2816 \let\'=\indexdummyfont | 2908 \let\'=\indexdummyfont |
2817 \let\^=\indexdummyfont | 2909 \let\^=\indexdummyfont |
2823 \let\u=\indexdummyfont | 2915 \let\u=\indexdummyfont |
2824 \let\v=\indexdummyfont | 2916 \let\v=\indexdummyfont |
2825 \let\H=\indexdummyfont | 2917 \let\H=\indexdummyfont |
2826 \let\dotless=\indexdummyfont | 2918 \let\dotless=\indexdummyfont |
2827 % Take care of the plain tex special European modified letters. | 2919 % Take care of the plain tex special European modified letters. |
2920 \def\AA{AA}% | |
2921 \def\AE{AE}% | |
2922 \def\L{L}% | |
2923 \def\OE{OE}% | |
2924 \def\O{O}% | |
2925 \def\aa{aa}% | |
2926 \def\ae{ae}% | |
2927 \def\l{l}% | |
2828 \def\oe{oe}% | 2928 \def\oe{oe}% |
2829 \def\ae{ae}% | |
2830 \def\aa{aa}% | |
2831 \def\OE{OE}% | |
2832 \def\AE{AE}% | |
2833 \def\AA{AA}% | |
2834 \def\o{o}% | 2929 \def\o{o}% |
2835 \def\O{O}% | |
2836 \def\l{l}% | |
2837 \def\L{L}% | |
2838 \def\ss{ss}% | 2930 \def\ss{ss}% |
2839 \let\w=\indexdummyfont | 2931 % |
2932 % Don't no-op \tt, since it isn't a user-level command | |
2933 % and is used in the definitions of the active chars like <, >, |, etc. | |
2934 % Likewise with the other plain tex font commands. | |
2935 %\let\tt=\indexdummyfont | |
2936 % | |
2937 \let\b=\indexdummyfont | |
2938 \let\i=\indexdummyfont | |
2939 \let\r=\indexdummyfont | |
2940 \let\sc=\indexdummyfont | |
2840 \let\t=\indexdummyfont | 2941 \let\t=\indexdummyfont |
2841 \let\r=\indexdummyfont | 2942 % |
2842 \let\i=\indexdummyfont | 2943 \let\TeX=\indexdummytex |
2843 \let\b=\indexdummyfont | 2944 \let\acronym=\indexdummyfont |
2945 \let\cite=\indexdummyfont | |
2946 \let\code=\indexdummyfont | |
2947 \let\command=\indexdummyfont | |
2948 \let\dfn=\indexdummyfont | |
2949 \let\dots=\indexdummydots | |
2844 \let\emph=\indexdummyfont | 2950 \let\emph=\indexdummyfont |
2845 \let\strong=\indexdummyfont | |
2846 \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 \let\code=\indexdummyfont | |
2853 \let\url=\indexdummyfont | |
2854 \let\uref=\indexdummyfont | |
2855 \let\env=\indexdummyfont | 2951 \let\env=\indexdummyfont |
2856 \let\acronym=\indexdummyfont | |
2857 \let\command=\indexdummyfont | |
2858 \let\option=\indexdummyfont | |
2859 \let\file=\indexdummyfont | 2952 \let\file=\indexdummyfont |
2860 \let\samp=\indexdummyfont | |
2861 \let\kbd=\indexdummyfont | 2953 \let\kbd=\indexdummyfont |
2862 \let\key=\indexdummyfont | 2954 \let\key=\indexdummyfont |
2955 \let\math=\indexdummyfont | |
2956 \let\option=\indexdummyfont | |
2957 \let\samp=\indexdummyfont | |
2958 \let\strong=\indexdummyfont | |
2959 \let\uref=\indexdummyfont | |
2960 \let\url=\indexdummyfont | |
2863 \let\var=\indexdummyfont | 2961 \let\var=\indexdummyfont |
2864 \let\TeX=\indexdummytex | 2962 \let\w=\indexdummyfont |
2865 \let\dots=\indexdummydots | |
2866 \def\@{@}% | |
2867 } | 2963 } |
2868 | 2964 |
2869 % To define \realbackslash, we must make \ not be an escape. | 2965 % To define \realbackslash, we must make \ not be an escape. |
2870 % We must first make another character (@) an escape | 2966 % We must first make another character (@) an escape |
2871 % so we do not become unable to do a definition. | 2967 % so we do not become unable to do a definition. |
3463 \chapmacro {#1}{\putwordAppendix{} \appendixletter}% | 3559 \chapmacro {#1}{\putwordAppendix{} \appendixletter}% |
3464 \gdef\thissection{#1}% | 3560 \gdef\thissection{#1}% |
3465 \gdef\thischaptername{#1}% | 3561 \gdef\thischaptername{#1}% |
3466 \xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}% | 3562 \xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}% |
3467 \toks0 = {#1}% | 3563 \toks0 = {#1}% |
3468 \edef\temp{\noexpand\writetocentry{\realbackslash chapentry{\the\toks0}% | 3564 \edef\temp{\noexpand\writetocentry{\realbackslash appendixentry{\the\toks0}% |
3469 {\putwordAppendix{} \appendixletter}}}% | 3565 {\appendixletter}}}% |
3470 \temp | 3566 \temp |
3471 \appendixnoderef | 3567 \appendixnoderef |
3472 \global\let\section = \appendixsec | 3568 \global\let\section = \appendixsec |
3473 \global\let\subsection = \appendixsubsec | 3569 \global\let\subsection = \appendixsubsec |
3474 \global\let\subsubsection = \appendixsubsubsec | 3570 \global\let\subsubsection = \appendixsubsubsec |
3541 \outer\def\unnumberedsec{\parsearg\unnumberedsecyyy} | 3637 \outer\def\unnumberedsec{\parsearg\unnumberedsecyyy} |
3542 \def\unnumberedsecyyy #1{\unnmhead1{#1}} % normally calls unnumberedseczzz | 3638 \def\unnumberedsecyyy #1{\unnmhead1{#1}} % normally calls unnumberedseczzz |
3543 \def\unnumberedseczzz #1{% | 3639 \def\unnumberedseczzz #1{% |
3544 \plainsecheading {#1}\gdef\thissection{#1}% | 3640 \plainsecheading {#1}\gdef\thissection{#1}% |
3545 \toks0 = {#1}% | 3641 \toks0 = {#1}% |
3546 \edef\temp{\noexpand\writetocentry{\realbackslash unnumbsecentry{\the\toks0}}}% | 3642 \edef\temp{\noexpand\writetocentry{\realbackslash unnumbsecentry% |
3643 {\the\toks0}{\the\chapno}}}% | |
3547 \temp | 3644 \temp |
3548 \unnumbnoderef | 3645 \unnumbnoderef |
3549 \nobreak | 3646 \nobreak |
3550 } | 3647 } |
3551 | 3648 |
3580 \def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz | 3677 \def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz |
3581 \def\unnumberedsubseczzz #1{% | 3678 \def\unnumberedsubseczzz #1{% |
3582 \plainsubsecheading {#1}\gdef\thissection{#1}% | 3679 \plainsubsecheading {#1}\gdef\thissection{#1}% |
3583 \toks0 = {#1}% | 3680 \toks0 = {#1}% |
3584 \edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsecentry% | 3681 \edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsecentry% |
3585 {\the\toks0}}}% | 3682 {\the\toks0}{\the\chapno}{\the\secno}}}% |
3586 \temp | 3683 \temp |
3587 \unnumbnoderef | 3684 \unnumbnoderef |
3588 \nobreak | 3685 \nobreak |
3589 } | 3686 } |
3590 | 3687 |
3621 \def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz | 3718 \def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz |
3622 \def\unnumberedsubsubseczzz #1{% | 3719 \def\unnumberedsubsubseczzz #1{% |
3623 \plainsubsubsecheading {#1}\gdef\thissection{#1}% | 3720 \plainsubsubsecheading {#1}\gdef\thissection{#1}% |
3624 \toks0 = {#1}% | 3721 \toks0 = {#1}% |
3625 \edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsubsecentry% | 3722 \edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsubsecentry% |
3626 {\the\toks0}}}% | 3723 {\the\toks0}{\the\chapno}{\the\secno}{\the\subsecno}}}% |
3627 \temp | 3724 \temp |
3628 \unnumbnoderef | 3725 \unnumbnoderef |
3629 \nobreak | 3726 \nobreak |
3630 } | 3727 } |
3631 | 3728 |
3833 % Write an entry to the toc file, opening it if necessary. | 3930 % Write an entry to the toc file, opening it if necessary. |
3834 % Called from @chapter, etc. We supply {\folio} at the end of the | 3931 % Called from @chapter, etc. We supply {\folio} at the end of the |
3835 % argument, which will end up as the last argument to the \...entry macro. | 3932 % argument, which will end up as the last argument to the \...entry macro. |
3836 % | 3933 % |
3837 % We open the .toc file here instead of at @setfilename or any other | 3934 % 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. | 3935 % fixed time so that @contents can be put in the document anywhere. |
3839 % | 3936 % |
3840 \newif\iftocfileopened | 3937 \newif\iftocfileopened |
3841 \def\writetocentry#1{% | 3938 \def\writetocentry#1{% |
3842 \iftocfileopened\else | 3939 \iftocfileopened\else |
3843 \immediate\openout\tocfile = \jobname.toc | 3940 \immediate\openout\tocfile = \jobname.toc |
3844 \global\tocfileopenedtrue | 3941 \global\tocfileopenedtrue |
3845 \fi | 3942 \fi |
3846 \iflinks \write\tocfile{#1{\folio}}\fi | 3943 \iflinks \write\tocfile{#1{\folio}}\fi |
3944 % | |
3945 % Tell \shipout to create a page destination if we're doing pdf, which | |
3946 % will be the target of the links in the table of contents. We can't | |
3947 % just do it on every page because the title pages are numbered 1 and | |
3948 % 2 (the page numbers aren't printed), and so are the first two pages | |
3949 % of the document. Thus, we'd have two destinations named `1', and | |
3950 % two named `2'. | |
3951 \ifpdf \pdfmakepagedesttrue \fi | |
3847 } | 3952 } |
3848 | 3953 |
3849 \newskip\contentsrightmargin \contentsrightmargin=1in | 3954 \newskip\contentsrightmargin \contentsrightmargin=1in |
3850 \newcount\savepageno | 3955 \newcount\savepageno |
3851 \newcount\lastnegativepageno \lastnegativepageno = -1 | 3956 \newcount\lastnegativepageno \lastnegativepageno = -1 |
3897 % And just the chapters. | 4002 % And just the chapters. |
3898 \def\summarycontents{% | 4003 \def\summarycontents{% |
3899 \startcontents{\putwordShortTOC}% | 4004 \startcontents{\putwordShortTOC}% |
3900 % | 4005 % |
3901 \let\chapentry = \shortchapentry | 4006 \let\chapentry = \shortchapentry |
4007 \let\appendixentry = \shortappendixentry | |
3902 \let\unnumbchapentry = \shortunnumberedentry | 4008 \let\unnumbchapentry = \shortunnumberedentry |
3903 % We want a true roman here for the page numbers. | 4009 % We want a true roman here for the page numbers. |
3904 \secfonts | 4010 \secfonts |
3905 \let\rm=\shortcontrm \let\bf=\shortcontbf \let\sl=\shortcontsl | 4011 \let\rm=\shortcontrm \let\bf=\shortcontbf \let\sl=\shortcontsl |
3906 \rm | 4012 \rm |
3907 \hyphenpenalty = 10000 | 4013 \hyphenpenalty = 10000 |
3908 \advance\baselineskip by 1pt % Open it up a little. | 4014 \advance\baselineskip by 1pt % Open it up a little. |
3909 \def\secentry ##1##2##3##4{} | 4015 \def\secentry ##1##2##3##4{} |
3910 \def\unnumbsecentry ##1##2{} | 4016 \def\unnumbsecentry ##1##2##3{} |
3911 \def\subsecentry ##1##2##3##4##5{} | 4017 \def\subsecentry ##1##2##3##4##5{} |
3912 \def\unnumbsubsecentry ##1##2{} | 4018 \def\unnumbsubsecentry ##1##2##3##4{} |
3913 \def\subsubsecentry ##1##2##3##4##5##6{} | 4019 \def\subsubsecentry ##1##2##3##4##5##6{} |
3914 \def\unnumbsubsubsecentry ##1##2{} | 4020 \def\unnumbsubsubsecentry ##1##2##3##4##5{} |
3915 \openin 1 \jobname.toc | 4021 \openin 1 \jobname.toc |
3916 \ifeof 1 \else | 4022 \ifeof 1 \else |
3917 \closein 1 | 4023 \closein 1 |
3918 \input \jobname.toc | 4024 \input \jobname.toc |
3919 \fi | 4025 \fi |
3932 % These macros generate individual entries in the table of contents. | 4038 % These macros generate individual entries in the table of contents. |
3933 % The first argument is the chapter or section name. | 4039 % The first argument is the chapter or section name. |
3934 % The last argument is the page number. | 4040 % The last argument is the page number. |
3935 % The arguments in between are the chapter number, section number, ... | 4041 % The arguments in between are the chapter number, section number, ... |
3936 | 4042 |
3937 % Chapter-level things, for both the long and short contents. | 4043 % Chapters, in the main contents. |
3938 \def\chapentry#1#2#3{\dochapentry{#2\labelspace#1}{#3}} | 4044 \def\chapentry#1#2#3{\dochapentry{#2\labelspace#1}{#3}} |
3939 | 4045 % |
3940 % See comments in \dochapentry re vbox and related settings | 4046 % Chapters, in the short toc. |
4047 % See comments in \dochapentry re vbox and related settings. | |
3941 \def\shortchapentry#1#2#3{% | 4048 \def\shortchapentry#1#2#3{% |
3942 \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#3\egroup}% | 4049 \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#3\egroup}% |
3943 } | 4050 } |
3944 | 4051 |
4052 % Appendices, in the main contents. | |
4053 \def\appendixentry#1#2#3{\dochapentry{\putwordAppendix{} #2\labelspace#1}{#3}} | |
4054 % | |
4055 % Appendices, in the short toc. | |
4056 \let\shortappendixentry = \shortchapentry | |
4057 | |
3945 % Typeset the label for a chapter or appendix for the short contents. | 4058 % 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. | 4059 % The arg is, e.g., `Appendix A' for an appendix, or `3' for a chapter. |
3947 % We could simplify the code here by writing out an \appendixentry | 4060 % We could simplify the code here by writing out an \appendixentry |
3948 % command in the toc file for appendices, instead of using \chapentry | 4061 % command in the toc file for appendices, instead of using \chapentry |
3949 % for both, but it doesn't seem worth it. | 4062 % for both, but it doesn't seem worth it. |
3950 % | 4063 % |
3951 \newdimen\shortappendixwidth | 4064 \newdimen\shortappendixwidth |
3952 % | 4065 % |
3953 \def\shortchaplabel#1{% | 4066 \def\shortchaplabel#1{% |
3954 % Compute width of word "Appendix", may change with language. | 4067 % This space should be enough, since a single number is .5em, and the |
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 | |
3964 % widest letter (M) is 1em, at least in the Computer Modern fonts. | 4068 % widest letter (M) is 1em, at least in the Computer Modern fonts. |
4069 % But use \hss just in case. | |
3965 % (This space doesn't include the extra space that gets added after | 4070 % (This space doesn't include the extra space that gets added after |
3966 % the label; that gets put in by \shortchapentry above.) | 4071 % the label; that gets put in by \shortchapentry above.) |
3967 \advance\dimen0 by 1.1em | 4072 \dimen0 = 1em |
3968 \hbox to \dimen0{#1\hfil}% | 4073 \hbox to \dimen0{#1\hss}% |
3969 } | 4074 } |
3970 | 4075 |
4076 % Unnumbered chapters. | |
3971 \def\unnumbchapentry#1#2{\dochapentry{#1}{#2}} | 4077 \def\unnumbchapentry#1#2{\dochapentry{#1}{#2}} |
3972 \def\shortunnumberedentry#1#2{\tocentry{#1}{\doshortpageno\bgroup#2\egroup}} | 4078 \def\shortunnumberedentry#1#2{\tocentry{#1}{\doshortpageno\bgroup#2\egroup}} |
3973 | 4079 |
3974 % Sections. | 4080 % Sections. |
3975 \def\secentry#1#2#3#4{\dosecentry{#2.#3\labelspace#1}{#4}} | 4081 \def\secentry#1#2#3#4{\dosecentry{#2.#3\labelspace#1}{#4}} |
3976 \def\unnumbsecentry#1#2{\dosecentry{#1}{#2}} | 4082 \def\unnumbsecentry#1#2#3{\dosecentry{#1}{#3}} |
3977 | 4083 |
3978 % Subsections. | 4084 % Subsections. |
3979 \def\subsecentry#1#2#3#4#5{\dosubsecentry{#2.#3.#4\labelspace#1}{#5}} | 4085 \def\subsecentry#1#2#3#4#5{\dosubsecentry{#2.#3.#4\labelspace#1}{#5}} |
3980 \def\unnumbsubsecentry#1#2{\dosubsecentry{#1}{#2}} | 4086 \def\unnumbsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}} |
3981 | 4087 |
3982 % And subsubsections. | 4088 % And subsubsections. |
3983 \def\subsubsecentry#1#2#3#4#5#6{% | 4089 \def\subsubsecentry#1#2#3#4#5#6{% |
3984 \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}{#6}} | 4090 \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}{#6}} |
3985 \def\unnumbsubsubsecentry#1#2{\dosubsubsecentry{#1}{#2}} | 4091 \def\unnumbsubsubsecentry#1#2#3#4#5{\dosubsubsecentry{#1}{#5}} |
3986 | 4092 |
3987 % This parameter controls the indentation of the various levels. | 4093 % This parameter controls the indentation of the various levels. |
3988 \newdimen\tocindent \tocindent = 3pc | 4094 \newdimen\tocindent \tocindent = 3pc |
3989 | 4095 |
3990 % Now for the actual typesetting. In all these, #1 is the text and #2 is the | 4096 % Now for the actual typesetting. In all these, #1 is the text and #2 is the |
4021 % can't do that in the \entry macro, since index entries might consist | 4127 % can't do that in the \entry macro, since index entries might consist |
4022 % of hyphenated-identifiers-that-do-not-fit-on-a-line-and-nothing-else.) | 4128 % of hyphenated-identifiers-that-do-not-fit-on-a-line-and-nothing-else.) |
4023 \def\tocentry#1#2{\begingroup | 4129 \def\tocentry#1#2{\begingroup |
4024 \vskip 0pt plus1pt % allow a little stretch for the sake of nice page breaks | 4130 \vskip 0pt plus1pt % allow a little stretch for the sake of nice page breaks |
4025 % Do not use \turnoffactive in these arguments. Since the toc is | 4131 % Do not use \turnoffactive in these arguments. Since the toc is |
4026 % typeset in cmr, so characters such as _ would come out wrong; we | 4132 % typeset in cmr, characters such as _ would come out wrong; we |
4027 % have to do the usual translation tricks. | 4133 % have to do the usual translation tricks. |
4028 \entry{#1}{#2}% | 4134 \entry{#1}{#2}% |
4029 \endgroup} | 4135 \endgroup} |
4030 | 4136 |
4031 % Space between chapter (or whatever) number and the title. | 4137 % Space between chapter (or whatever) number and the title. |
4041 | 4147 |
4042 | 4148 |
4043 \message{environments,} | 4149 \message{environments,} |
4044 % @foo ... @end foo. | 4150 % @foo ... @end foo. |
4045 | 4151 |
4152 % @point{}, @result{}, @expansion{}, @print{}, @equiv{}. | |
4153 % | |
4046 % Since these characters are used in examples, it should be an even number of | 4154 % Since these characters are used in examples, it should be an even number of |
4047 % \tt widths. Each \tt character is 1en, so two makes it 1em. | 4155 % \tt widths. Each \tt character is 1en, so two makes it 1em. |
4048 % Furthermore, these definitions must come after we define our fonts. | 4156 % |
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{}. | |
4064 \def\point{$\star$} | 4157 \def\point{$\star$} |
4065 \def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}} | 4158 \def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}} |
4066 \def\expansion{\leavevmode\raise.1ex\hbox to 1em{\hfil$\mapsto$\hfil}} | 4159 \def\expansion{\leavevmode\raise.1ex\hbox to 1em{\hfil$\mapsto$\hfil}} |
4067 \def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}} | 4160 \def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}} |
4068 \def\equiv{\leavevmode\lower.1ex\hbox to 1em{\hfil$\ptexequiv$\hfil}} | 4161 \def\equiv{\leavevmode\lower.1ex\hbox to 1em{\hfil$\ptexequiv$\hfil}} |
4069 | 4162 |
4163 % The @error{} command. | |
4070 % Adapted from the TeXbook's \boxit. | 4164 % Adapted from the TeXbook's \boxit. |
4165 % | |
4166 \newbox\errorbox | |
4167 % | |
4071 {\tentt \global\dimen0 = 3em}% Width of the box. | 4168 {\tentt \global\dimen0 = 3em}% Width of the box. |
4072 \dimen2 = .55pt % Thickness of rules | 4169 \dimen2 = .55pt % Thickness of rules |
4073 % The text. (`r' is open on the right, `e' somewhat less so on the left.) | 4170 % The text. (`r' is open on the right, `e' somewhat less so on the left.) |
4074 \setbox0 = \hbox{\kern-.75pt \tensf error\kern-1.5pt} | 4171 \setbox0 = \hbox{\kern-.75pt \tensf error\kern-1.5pt} |
4075 | 4172 % |
4076 \global\setbox\errorbox=\hbox to \dimen0{\hfil | 4173 \global\setbox\errorbox=\hbox to \dimen0{\hfil |
4077 \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right. | 4174 \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right. |
4078 \advance\hsize by -2\dimen2 % Rules. | 4175 \advance\hsize by -2\dimen2 % Rules. |
4079 \vbox{ | 4176 \vbox{ |
4080 \hrule height\dimen2 | 4177 \hrule height\dimen2 |
4081 \hbox{\vrule width\dimen2 \kern3pt % Space to left of text. | 4178 \hbox{\vrule width\dimen2 \kern3pt % Space to left of text. |
4082 \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below. | 4179 \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below. |
4083 \kern3pt\vrule width\dimen2}% Space to right. | 4180 \kern3pt\vrule width\dimen2}% Space to right. |
4084 \hrule height\dimen2} | 4181 \hrule height\dimen2} |
4085 \hfil} | 4182 \hfil} |
4086 | 4183 % |
4087 % The @error{} command. | |
4088 \def\error{\leavevmode\lower.7ex\copy\errorbox} | 4184 \def\error{\leavevmode\lower.7ex\copy\errorbox} |
4089 | 4185 |
4090 % @tex ... @end tex escapes into raw Tex temporarily. | 4186 % @tex ... @end tex escapes into raw Tex temporarily. |
4091 % One exception: @ is still an escape character, so that @end tex works. | 4187 % One exception: @ is still an escape character, so that @end tex works. |
4092 % But \@ or @@ will get a plain tex @ character. | 4188 % But \@ or @@ will get a plain tex @ character. |
4122 \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}% | 4218 \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}% |
4123 \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}% | 4219 \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}% |
4124 \def\@{@}% | 4220 \def\@{@}% |
4125 \let\Etex=\endgroup} | 4221 \let\Etex=\endgroup} |
4126 | 4222 |
4127 % Define @lisp ... @endlisp. | 4223 % Define @lisp ... @end lisp. |
4128 % @lisp does a \begingroup so it can rebind things, | 4224 % @lisp does a \begingroup so it can rebind things, |
4129 % including the definition of @endlisp (which normally is erroneous). | 4225 % including the definition of @end lisp (which normally is erroneous). |
4130 | 4226 |
4131 % Amount to narrow the margins by for @lisp. | 4227 % Amount to narrow the margins by for @lisp. |
4132 \newskip\lispnarrowing \lispnarrowing=0.4in | 4228 \newskip\lispnarrowing \lispnarrowing=0.4in |
4133 | 4229 |
4134 % This is the definition that ^^M gets inside @lisp, @example, and other | 4230 % This is the definition that ^^M gets inside @lisp, @example, and other |
4297 % Real @smallexample and @smalllisp (when @smallbook): use smaller fonts. | 4393 % Real @smallexample and @smalllisp (when @smallbook): use smaller fonts. |
4298 % Originally contributed by Pavel@xerox. | 4394 % Originally contributed by Pavel@xerox. |
4299 \def\smalllispx{\begingroup | 4395 \def\smalllispx{\begingroup |
4300 \def\Esmalllisp{\nonfillfinish\endgroup}% | 4396 \def\Esmalllisp{\nonfillfinish\endgroup}% |
4301 \def\Esmallexample{\nonfillfinish\endgroup}% | 4397 \def\Esmallexample{\nonfillfinish\endgroup}% |
4302 \smallfonts | 4398 \smallexamplefonts |
4303 \lisp | 4399 \lisp |
4304 } | 4400 } |
4305 | 4401 |
4306 % @display: same as @lisp except keep current font. | 4402 % @display: same as @lisp except keep current font. |
4307 % | 4403 % |
4308 \def\display{\begingroup | 4404 \def\display{\begingroup |
4309 \nonfillstart | 4405 \nonfillstart |
4310 \let\Edisplay = \nonfillfinish | 4406 \let\Edisplay = \nonfillfinish |
4311 \gobble | 4407 \gobble |
4312 } | 4408 } |
4313 | 4409 % |
4314 % @smalldisplay (when @smallbook): @display plus smaller fonts. | 4410 % @smalldisplay (when @smallbook): @display plus smaller fonts. |
4315 % | 4411 % |
4316 \def\smalldisplayx{\begingroup | 4412 \def\smalldisplayx{\begingroup |
4317 \def\Esmalldisplay{\nonfillfinish\endgroup}% | 4413 \def\Esmalldisplay{\nonfillfinish\endgroup}% |
4318 \smallfonts \rm | 4414 \smallexamplefonts \rm |
4319 \display | 4415 \display |
4320 } | 4416 } |
4321 | 4417 |
4322 % @format: same as @display except don't narrow margins. | 4418 % @format: same as @display except don't narrow margins. |
4323 % | 4419 % |
4325 \let\nonarrowing = t | 4421 \let\nonarrowing = t |
4326 \nonfillstart | 4422 \nonfillstart |
4327 \let\Eformat = \nonfillfinish | 4423 \let\Eformat = \nonfillfinish |
4328 \gobble | 4424 \gobble |
4329 } | 4425 } |
4330 | 4426 % |
4331 % @smallformat (when @smallbook): @format plus smaller fonts. | 4427 % @smallformat (when @smallbook): @format plus smaller fonts. |
4332 % | 4428 % |
4333 \def\smallformatx{\begingroup | 4429 \def\smallformatx{\begingroup |
4334 \def\Esmallformat{\nonfillfinish\endgroup}% | 4430 \def\Esmallformat{\nonfillfinish\endgroup}% |
4335 \smallfonts \rm | 4431 \smallexamplefonts \rm |
4336 \format | 4432 \format |
4337 } | 4433 } |
4338 | 4434 |
4339 % @flushleft (same as @format). | 4435 % @flushleft (same as @format). |
4340 % | 4436 % |
4522 \def\thisfile{#1}% | 4618 \def\thisfile{#1}% |
4523 \expandafter\expandafter\setupverbatiminclude\input\thisfile | 4619 \expandafter\expandafter\setupverbatiminclude\input\thisfile |
4524 \endgroup\nonfillfinish\endgroup | 4620 \endgroup\nonfillfinish\endgroup |
4525 } | 4621 } |
4526 | 4622 |
4623 % @copying ... @end copying. | |
4624 % Save the text away for @insertcopying later. | |
4625 % | |
4626 \newbox\copyingbox | |
4627 % | |
4628 \def\copying{\begingroup | |
4629 \parindent = 0pt % looks wrong on title page | |
4630 \def\Ecopying{\egroup\endgroup}% | |
4631 \global\setbox\copyingbox = \vbox\bgroup | |
4632 } | |
4633 | |
4634 % @insertcopying. | |
4635 % | |
4636 \def\insertcopying{\unvcopy\copyingbox} | |
4637 | |
4527 | 4638 |
4528 \message{defuns,} | 4639 \message{defuns,} |
4529 % @defun etc. | 4640 % @defun etc. |
4530 | 4641 |
4531 % Allow user to change definition object font (\df) internally | 4642 % Allow user to change definition object font (\df) internally |
4850 % #1 is the data type. #2 is the name and args. | 4961 % #1 is the data type. #2 is the name and args. |
4851 \def\deftypefunheader #1#2{\deftypefunheaderx{#1}#2 \relax} | 4962 \def\deftypefunheader #1#2{\deftypefunheaderx{#1}#2 \relax} |
4852 % #1 is the data type, #2 the name, #3 the args. | 4963 % #1 is the data type, #2 the name, #3 the args. |
4853 \def\deftypefunheaderx #1#2 #3\relax{% | 4964 \def\deftypefunheaderx #1#2 #3\relax{% |
4854 \doind {fn}{\code{#2}}% Make entry in function index | 4965 \doind {fn}{\code{#2}}% Make entry in function index |
4855 \begingroup\defname {\defheaderxcond#1\relax$$$#2}{\putwordDeftypefun}% | 4966 \begingroup\defname {\defheaderxcond#1\relax$.$#2}{\putwordDeftypefun}% |
4856 \deftypefunargs {#3}\endgroup % | 4967 \deftypefunargs {#3}\endgroup % |
4857 \catcode 61=\other % Turn off change made in \defparsebody | 4968 \catcode 61=\other % Turn off change made in \defparsebody |
4858 } | 4969 } |
4859 | 4970 |
4860 % @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar}) | 4971 % @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar}) |
4861 | 4972 |
4862 \def\deftypefn{\defmethparsebody\Edeftypefn\deftypefnx\deftypefnheader} | 4973 \def\deftypefn{\defmethparsebody\Edeftypefn\deftypefnx\deftypefnheader} |
4863 | 4974 |
4864 % \defheaderxcond#1\relax$$$ | 4975 % \defheaderxcond#1\relax$.$ |
4865 % puts #1 in @code, followed by a space, but does nothing if #1 is null. | 4976 % 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} | 4977 \def\defheaderxcond#1#2$.${\ifx#1\relax\else\code{#1#2} \fi} |
4867 | 4978 |
4868 % #1 is the classification. #2 is the data type. #3 is the name and args. | 4979 % #1 is the classification. #2 is the data type. #3 is the name and args. |
4869 \def\deftypefnheader #1#2#3{\deftypefnheaderx{#1}{#2}#3 \relax} | 4980 \def\deftypefnheader #1#2#3{\deftypefnheaderx{#1}{#2}#3 \relax} |
4870 % #1 is the classification, #2 the data type, #3 the name, #4 the args. | 4981 % #1 is the classification, #2 the data type, #3 the name, #4 the args. |
4871 \def\deftypefnheaderx #1#2#3 #4\relax{% | 4982 \def\deftypefnheaderx #1#2#3 #4\relax{% |
4872 \doind {fn}{\code{#3}}% Make entry in function index | 4983 \doind {fn}{\code{#3}}% Make entry in function index |
4873 \begingroup | 4984 \begingroup |
4874 \normalparens % notably, turn off `&' magic, which prevents | 4985 \normalparens % notably, turn off `&' magic, which prevents |
4875 % at least some C++ text from working | 4986 % at least some C++ text from working |
4876 \defname {\defheaderxcond#2\relax$$$#3}{#1}% | 4987 \defname {\defheaderxcond#2\relax$.$#3}{#1}% |
4877 \deftypefunargs {#4}\endgroup % | 4988 \deftypefunargs {#4}\endgroup % |
4878 \catcode 61=\other % Turn off change made in \defparsebody | 4989 \catcode 61=\other % Turn off change made in \defparsebody |
4879 } | 4990 } |
4880 | 4991 |
4881 % @defmac == @deffn Macro | 4992 % @defmac == @deffn Macro |
4917 % | 5028 % |
4918 % #1 is the class name, #2 the data type, #3 the operation name, #4 the args. | 5029 % #1 is the class name, #2 the data type, #3 the operation name, #4 the args. |
4919 \def\deftypeopheader#1#2#3#4{% | 5030 \def\deftypeopheader#1#2#3#4{% |
4920 \dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index | 5031 \dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index |
4921 \begingroup | 5032 \begingroup |
4922 \defname{\defheaderxcond#2\relax$$$#3} | 5033 \defname{\defheaderxcond#2\relax$.$#3} |
4923 {\deftypeopcategory\ \putwordon\ \code{#1}}% | 5034 {\deftypeopcategory\ \putwordon\ \code{#1}}% |
4924 \deftypefunargs{#4}% | 5035 \deftypefunargs{#4}% |
4925 \endgroup | 5036 \endgroup |
4926 } | 5037 } |
4927 | 5038 |
4932 % | 5043 % |
4933 % #1 is the class name, #2 the data type, #3 the method name, #4 the args. | 5044 % #1 is the class name, #2 the data type, #3 the method name, #4 the args. |
4934 \def\deftypemethodheader#1#2#3#4{% | 5045 \def\deftypemethodheader#1#2#3#4{% |
4935 \dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index | 5046 \dosubind{fn}{\code{#3}}{\putwordon\ \code{#1}}% entry in function index |
4936 \begingroup | 5047 \begingroup |
4937 \defname{\defheaderxcond#2\relax$$$#3}{\putwordMethodon\ \code{#1}}% | 5048 \defname{\defheaderxcond#2\relax$.$#3}{\putwordMethodon\ \code{#1}}% |
4938 \deftypefunargs{#4}% | 5049 \deftypefunargs{#4}% |
4939 \endgroup | 5050 \endgroup |
4940 } | 5051 } |
4941 | 5052 |
4942 % @deftypeivar CLASS TYPE VARNAME | 5053 % @deftypeivar CLASS TYPE VARNAME |
4946 % | 5057 % |
4947 % #1 is the class name, #2 the data type, #3 the variable name. | 5058 % #1 is the class name, #2 the data type, #3 the variable name. |
4948 \def\deftypeivarheader#1#2#3{% | 5059 \def\deftypeivarheader#1#2#3{% |
4949 \dosubind{vr}{\code{#3}}{\putwordof\ \code{#1}}% entry in variable index | 5060 \dosubind{vr}{\code{#3}}{\putwordof\ \code{#1}}% entry in variable index |
4950 \begingroup | 5061 \begingroup |
4951 \defname{\defheaderxcond#2\relax$$$#3} | 5062 \defname{\defheaderxcond#2\relax$.$#3} |
4952 {\putwordInstanceVariableof\ \code{#1}}% | 5063 {\putwordInstanceVariableof\ \code{#1}}% |
4953 \defvarargs{#3}% | 5064 \defvarargs{#3}% |
4954 \endgroup | 5065 \endgroup |
4955 } | 5066 } |
4956 | 5067 |
5029 | 5140 |
5030 % #1 is the data type. #2 is the name, perhaps followed by text that | 5141 % #1 is the data type. #2 is the name, perhaps followed by text that |
5031 % is actually part of the data type, which should not be put into the index. | 5142 % is actually part of the data type, which should not be put into the index. |
5032 \def\deftypevarheader #1#2{% | 5143 \def\deftypevarheader #1#2{% |
5033 \dovarind#2 \relax% Make entry in variables index | 5144 \dovarind#2 \relax% Make entry in variables index |
5034 \begingroup\defname {\defheaderxcond#1\relax$$$#2}{\putwordDeftypevar}% | 5145 \begingroup\defname {\defheaderxcond#1\relax$.$#2}{\putwordDeftypevar}% |
5035 \interlinepenalty=10000 | 5146 \interlinepenalty=10000 |
5036 \endgraf\nobreak\vskip -\parskip\nobreak | 5147 \endgraf\nobreak\vskip -\parskip\nobreak |
5037 \endgroup} | 5148 \endgroup} |
5038 \def\dovarind#1 #2\relax{\doind{vr}{\code{#1}}} | 5149 \def\dovarind#1 #2\relax{\doind{vr}{\code{#1}}} |
5039 | 5150 |
5040 % @deftypevr {Global Flag} int enable | 5151 % @deftypevr {Global Flag} int enable |
5041 | 5152 |
5042 \def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader} | 5153 \def\deftypevr{\defvrparsebody\Edeftypevr\deftypevrx\deftypevrheader} |
5043 | 5154 |
5044 \def\deftypevrheader #1#2#3{\dovarind#3 \relax% | 5155 \def\deftypevrheader #1#2#3{\dovarind#3 \relax% |
5045 \begingroup\defname {\defheaderxcond#2\relax$$$#3}{#1} | 5156 \begingroup\defname {\defheaderxcond#2\relax$.$#3}{#1} |
5046 \interlinepenalty=10000 | 5157 \interlinepenalty=10000 |
5047 \endgraf\nobreak\vskip -\parskip\nobreak | 5158 \endgraf\nobreak\vskip -\parskip\nobreak |
5048 \endgroup} | 5159 \endgroup} |
5049 | 5160 |
5050 % Now define @deftp | 5161 % Now define @deftp |
5200 \fi | 5311 \fi |
5201 \if1\csname ismacro.\the\macname\endcsname | 5312 \if1\csname ismacro.\the\macname\endcsname |
5202 \message{Warning: redefining \the\macname}% | 5313 \message{Warning: redefining \the\macname}% |
5203 \else | 5314 \else |
5204 \expandafter\ifx\csname \the\macname\endcsname \relax | 5315 \expandafter\ifx\csname \the\macname\endcsname \relax |
5205 \else \errmessage{The name \the\macname\space is reserved}\fi | 5316 \else \errmessage{Macro name \the\macname\space already defined}\fi |
5206 \global\cslet{macsave.\the\macname}{\the\macname}% | 5317 \global\cslet{macsave.\the\macname}{\the\macname}% |
5207 \global\expandafter\let\csname ismacro.\the\macname\endcsname=1% | 5318 \global\expandafter\let\csname ismacro.\the\macname\endcsname=1% |
5208 % Add the macroname to \macrolist | 5319 % Add the macroname to \macrolist |
5209 \toks0 = \expandafter{\macrolist\do}% | 5320 \toks0 = \expandafter{\macrolist\do}% |
5210 \xdef\macrolist{\the\toks0 | 5321 \xdef\macrolist{\the\toks0 |
5481 % is a loss. Therefore, we give the text of the node name again, so it | 5592 % is a loss. Therefore, we give the text of the node name again, so it |
5482 % is as if TeX is seeing it for the first time. | 5593 % is as if TeX is seeing it for the first time. |
5483 \ifpdf | 5594 \ifpdf |
5484 \leavevmode | 5595 \leavevmode |
5485 \getfilename{#4}% | 5596 \getfilename{#4}% |
5486 \ifnum\filenamelength>0 | 5597 {\normalturnoffactive |
5487 \startlink attr{/Border [0 0 0]}% | 5598 \ifnum\filenamelength>0 |
5488 goto file{\the\filename.pdf} name{#1@}% | 5599 \startlink attr{/Border [0 0 0]}% |
5489 \else | 5600 goto file{\the\filename.pdf} name{#1}% |
5490 \startlink attr{/Border [0 0 0]}% | 5601 \else |
5491 goto name{#1@}% | 5602 \startlink attr{/Border [0 0 0]}% |
5492 \fi | 5603 goto name{#1}% |
5604 \fi | |
5605 }% | |
5493 \linkcolor | 5606 \linkcolor |
5494 \fi | 5607 \fi |
5495 % | 5608 % |
5496 \ifdim \wd1 > 0pt | 5609 \ifdim \wd1 > 0pt |
5497 \putwordsection{} ``\printednodename'' \putwordin{} \cite{\printedmanual}% | 5610 \putwordsection{} ``\printednodename'' \putwordin{} \cite{\printedmanual}% |
5749 \xspaceskip\z@skip | 5862 \xspaceskip\z@skip |
5750 \parindent\defaultparindent | 5863 \parindent\defaultparindent |
5751 % | 5864 % |
5752 \smallfonts \rm | 5865 \smallfonts \rm |
5753 % | 5866 % |
5754 % Hang the footnote text off the number. | 5867 % Because we use hanging indentation in footnotes, a @noindent appears |
5755 \hang | 5868 % to exdent this text, so make it be a no-op. makeinfo does not use |
5869 % hanging indentation so @noindent can still be needed within footnote | |
5870 % text after an @example or the like (not that this is good style). | |
5871 \let\noindent = \relax | |
5872 % | |
5873 % Hang the footnote text off the number. Use \everypar in case the | |
5874 % footnote extends for more than one paragraph. | |
5875 \everypar = {\hang}% | |
5756 \textindent{\thisfootno}% | 5876 \textindent{\thisfootno}% |
5757 % | 5877 % |
5758 % Don't crash into the line above the footnote text. Since this | 5878 % Don't crash into the line above the footnote text. Since this |
5759 % expands into a box, it must come within the paragraph, lest it | 5879 % expands into a box, it must come within the paragraph, lest it |
5760 % provide a place where TeX can split the footnote. | 5880 % provide a place where TeX can split the footnote. |
5766 \def\f@@t{\bgroup\aftergroup\@foot\let\next} | 5886 \def\f@@t{\bgroup\aftergroup\@foot\let\next} |
5767 \def\f@t#1{#1\@foot} | 5887 \def\f@t#1{#1\@foot} |
5768 \def\@foot{\strut\par\egroup} | 5888 \def\@foot{\strut\par\egroup} |
5769 | 5889 |
5770 }%end \catcode `\@=11 | 5890 }%end \catcode `\@=11 |
5771 | |
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 | 5891 |
5790 % @| inserts a changebar to the left of the current line. It should | 5892 % @| inserts a changebar to the left of the current line. It should |
5791 % surround any changed text. This approach does *not* work if the | 5893 % surround any changed text. This approach does *not* work if the |
5792 % change spans more than two lines of output. To handle that, we would | 5894 % change spans more than two lines of output. To handle that, we would |
5793 % have adopt a much more difficult approach (putting marks into the main | 5895 % have adopt a much more difficult approach (putting marks into the main |
5849 \errhelp = \noepsfhelp | 5951 \errhelp = \noepsfhelp |
5850 \errmessage{epsf.tex not found, images will be ignored}% | 5952 \errmessage{epsf.tex not found, images will be ignored}% |
5851 \global\warnednoepsftrue | 5953 \global\warnednoepsftrue |
5852 \fi | 5954 \fi |
5853 \else | 5955 \else |
5854 \imagexxx #1,,,\finish | 5956 \imagexxx #1,,,,,\finish |
5855 \fi | 5957 \fi |
5856 } | 5958 } |
5857 % | 5959 % |
5858 % Arguments to @image: | 5960 % Arguments to @image: |
5859 % #1 is (mandatory) image filename; we tack on .eps extension. | 5961 % #1 is (mandatory) image filename; we tack on .eps extension. |
5860 % #2 is (optional) width, #3 is (optional) height. | 5962 % #2 is (optional) width, #3 is (optional) height. |
5861 % #4 is just the usual extra ignored arg for parsing this stuff. | 5963 % #4 is (ignored optional) html alt text. |
5862 \def\imagexxx#1,#2,#3,#4\finish{% | 5964 % #5 is (ignored optional) extension. |
5965 % #6 is just the usual extra ignored arg for parsing this stuff. | |
5966 \newif\ifimagevmode | |
5967 \def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup | |
5968 \catcode`\^^M = 5 % in case we're inside an example | |
5969 \normalturnoffactive % allow _ et al. in names | |
5970 % If the image is by itself, center it. | |
5971 \ifvmode | |
5972 \imagevmodetrue | |
5973 \nobreak\bigskip | |
5974 % Usually we'll have text after the image which will insert | |
5975 % \parskip glue, so insert it here too to equalize the space | |
5976 % above and below. | |
5977 \nobreak\vskip\parskip | |
5978 \nobreak | |
5979 \line\bgroup\hss | |
5980 \fi | |
5981 % | |
5982 % Output the image. | |
5863 \ifpdf | 5983 \ifpdf |
5864 \centerline{\dopdfimage{#1}{#2}{#3}}% | 5984 \dopdfimage{#1}{#2}{#3}% |
5865 \else | 5985 \else |
5866 % \epsfbox itself resets \epsf?size at each figure. | 5986 % \epsfbox itself resets \epsf?size at each figure. |
5867 \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi | 5987 \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi |
5868 \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi | 5988 \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi |
5869 \begingroup | 5989 \epsfbox{#1.eps}% |
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 | 5990 \fi |
5888 } | 5991 % |
5992 \ifimagevmode \hss \egroup \bigbreak \fi % space after the image | |
5993 \endgroup} | |
5889 | 5994 |
5890 | 5995 |
5891 \message{localization,} | 5996 \message{localization,} |
5892 % and i18n. | 5997 % and i18n. |
5893 | 5998 |
5952 \emergencystretch = .15\hsize | 6057 \emergencystretch = .15\hsize |
5953 \fi | 6058 \fi |
5954 } | 6059 } |
5955 | 6060 |
5956 % Parameters in order: 1) textheight; 2) textwidth; 3) voffset; | 6061 % Parameters in order: 1) textheight; 2) textwidth; 3) voffset; |
5957 % 4) hoffset; 5) binding offset; 6) topskip. Then whoever calls us can | 6062 % 4) hoffset; 5) binding offset; 6) topskip. We also call |
5958 % set \parskip and call \setleading for \baselineskip. | 6063 % \setleading{\textleading}, so the caller should define \textleading. |
6064 % The caller should also set \parskip. | |
5959 % | 6065 % |
5960 \def\internalpagesizes#1#2#3#4#5#6{% | 6066 \def\internalpagesizes#1#2#3#4#5#6{% |
5961 \voffset = #3\relax | 6067 \voffset = #3\relax |
5962 \topskip = #6\relax | 6068 \topskip = #6\relax |
5963 \splittopskip = \topskip | 6069 \splittopskip = \topskip |
5973 \advance\outerhsize by 0.5in | 6079 \advance\outerhsize by 0.5in |
5974 \pagewidth = \hsize | 6080 \pagewidth = \hsize |
5975 % | 6081 % |
5976 \normaloffset = #4\relax | 6082 \normaloffset = #4\relax |
5977 \bindingoffset = #5\relax | 6083 \bindingoffset = #5\relax |
6084 % | |
6085 \setleading{\textleading} | |
5978 % | 6086 % |
5979 \parindent = \defaultparindent | 6087 \parindent = \defaultparindent |
5980 \setemergencystretch | 6088 \setemergencystretch |
5981 } | 6089 } |
5982 | 6090 |
5990 } | 6098 } |
5991 | 6099 |
5992 % @letterpaper (the default). | 6100 % @letterpaper (the default). |
5993 \def\letterpaper{{\globaldefs = 1 | 6101 \def\letterpaper{{\globaldefs = 1 |
5994 \parskip = 3pt plus 2pt minus 1pt | 6102 \parskip = 3pt plus 2pt minus 1pt |
5995 \setleading{13.2pt}% | 6103 \textleading = 13.2pt |
5996 % | 6104 % |
5997 % If page is nothing but text, make it come out even. | 6105 % If page is nothing but text, make it come out even. |
5998 \internalpagesizes{46\baselineskip}{6in}{\voffset}{.25in}{\bindingoffset}{36pt}% | 6106 \internalpagesizes{46\baselineskip}{6in}{\voffset}{.25in}{\bindingoffset}{36pt}% |
5999 }} | 6107 }} |
6000 | 6108 |
6001 % Use @smallbook to reset parameters for 7x9.5 (or so) format. | 6109 % Use @smallbook to reset parameters for 7x9.5 (or so) format. |
6002 \def\smallbook{{\globaldefs = 1 | 6110 \def\smallbook{{\globaldefs = 1 |
6003 \parskip = 2pt plus 1pt | 6111 \parskip = 2pt plus 1pt |
6004 \setleading{12pt}% | 6112 \textleading = 12pt |
6005 % | 6113 % |
6006 \internalpagesizes{7.5in}{5.in}{\voffset}{.25in}{\bindingoffset}{16pt}% | 6114 \internalpagesizes{7.5in}{5.in}{\voffset}{.25in}{\bindingoffset}{16pt}% |
6007 % | 6115 % |
6008 \lispnarrowing = 0.3in | 6116 \lispnarrowing = 0.3in |
6009 \tolerance = 700 | 6117 \tolerance = 700 |
6014 \smallenvironments | 6122 \smallenvironments |
6015 }} | 6123 }} |
6016 | 6124 |
6017 % Use @afourpaper to print on European A4 paper. | 6125 % Use @afourpaper to print on European A4 paper. |
6018 \def\afourpaper{{\globaldefs = 1 | 6126 \def\afourpaper{{\globaldefs = 1 |
6019 \setleading{12pt}% | |
6020 \parskip = 3pt plus 2pt minus 1pt | 6127 \parskip = 3pt plus 2pt minus 1pt |
6128 \textleading = 12pt | |
6021 % | 6129 % |
6022 \internalpagesizes{53\baselineskip}{160mm}{\voffset}{4mm}{\bindingoffset}{44pt}% | 6130 \internalpagesizes{53\baselineskip}{160mm}{\voffset}{4mm}{\bindingoffset}{44pt}% |
6023 % | 6131 % |
6024 \tolerance = 700 | 6132 \tolerance = 700 |
6025 \hfuzz = 1pt | 6133 \hfuzz = 1pt |
6027 | 6135 |
6028 % Use @afivepaper to print on European A5 paper. | 6136 % Use @afivepaper to print on European A5 paper. |
6029 % From romildo@urano.iceb.ufop.br, 2 July 2000. | 6137 % From romildo@urano.iceb.ufop.br, 2 July 2000. |
6030 % He also recommends making @example and @lisp be small. | 6138 % He also recommends making @example and @lisp be small. |
6031 \def\afivepaper{{\globaldefs = 1 | 6139 \def\afivepaper{{\globaldefs = 1 |
6032 \setleading{12.5pt}% | |
6033 \parskip = 2pt plus 1pt minus 0.1pt | 6140 \parskip = 2pt plus 1pt minus 0.1pt |
6141 \textleading = 12.5pt | |
6034 % | 6142 % |
6035 \internalpagesizes{166mm}{120mm}{\voffset}{-8mm}{\bindingoffset}{8pt}% | 6143 \internalpagesizes{166mm}{120mm}{\voffset}{-8mm}{\bindingoffset}{8pt}% |
6036 % | 6144 % |
6037 \lispnarrowing = 0.2in | 6145 \lispnarrowing = 0.2in |
6038 \tolerance = 800 | 6146 \tolerance = 800 |
6046 }} | 6154 }} |
6047 | 6155 |
6048 % A specific text layout, 24x15cm overall, intended for A4 paper. Top margin | 6156 % A specific text layout, 24x15cm overall, intended for A4 paper. Top margin |
6049 % 29mm, hence bottom margin 28mm, nominal side margin 3cm. | 6157 % 29mm, hence bottom margin 28mm, nominal side margin 3cm. |
6050 \def\afourlatex{{\globaldefs = 1 | 6158 \def\afourlatex{{\globaldefs = 1 |
6051 \setleading{13.6pt}% | 6159 \textleading = 13.6pt |
6052 % | 6160 % |
6053 \afourpaper | 6161 \afourpaper |
6054 \internalpagesizes{237mm}{150mm}{3.6mm}{3.6mm}{3mm}{7mm}% | 6162 \internalpagesizes{237mm}{150mm}{3.6mm}{3.6mm}{3mm}{7mm}% |
6055 % | 6163 % |
6164 % Must explicitly reset to 0 because we call \afourpaper, apparently, | |
6165 % although this does not entirely make sense. | |
6056 \globaldefs = 0 | 6166 \globaldefs = 0 |
6057 }} | 6167 }} |
6058 | 6168 |
6059 % Use @afourwide to print on European A4 paper in wide format. | 6169 % Use @afourwide to print on European A4 paper in wide format. |
6060 \def\afourwide{% | 6170 \def\afourwide{% |
6061 \afourpaper | 6171 \afourpaper |
6062 \internalpagesizes{6.5in}{9.5in}{\hoffset}{\normaloffset}{\bindingoffset}{7mm}% | 6172 \internalpagesizes{6.5in}{9.5in}{\hoffset}{\normaloffset}{\bindingoffset}{7mm}% |
6063 % | |
6064 \globaldefs = 0 | |
6065 } | 6173 } |
6066 | 6174 |
6067 % @pagesizes TEXTHEIGHT[,TEXTWIDTH] | 6175 % @pagesizes TEXTHEIGHT[,TEXTWIDTH] |
6068 % Perhaps we should allow setting the margins, \topskip, \parskip, | 6176 % Perhaps we should allow setting the margins, \topskip, \parskip, |
6069 % and/or leading, also. Or perhaps we should compute them somehow. | 6177 % and/or leading, also. Or perhaps we should compute them somehow. |
6073 \def\pagesizesyyy#1,#2,#3\finish{{% | 6181 \def\pagesizesyyy#1,#2,#3\finish{{% |
6074 \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi | 6182 \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi |
6075 \globaldefs = 1 | 6183 \globaldefs = 1 |
6076 % | 6184 % |
6077 \parskip = 3pt plus 2pt minus 1pt | 6185 \parskip = 3pt plus 2pt minus 1pt |
6078 \setleading{13.2pt}% | 6186 \setleading{\textleading}% |
6079 % | 6187 % |
6080 \internalpagesizes{#1}{\hsize}{\voffset}{\normaloffset}{\bindingoffset}{44pt}% | 6188 \internalpagesizes{#1}{\hsize}{\voffset}{\normaloffset}{\bindingoffset}{44pt}% |
6081 }} | 6189 }} |
6082 | 6190 |
6083 % Set default to letter. | 6191 % Set default to letter. |
6103 \def\normalunderscore{_} | 6211 \def\normalunderscore{_} |
6104 \def\normalverticalbar{|} | 6212 \def\normalverticalbar{|} |
6105 \def\normalless{<} | 6213 \def\normalless{<} |
6106 \def\normalgreater{>} | 6214 \def\normalgreater{>} |
6107 \def\normalplus{+} | 6215 \def\normalplus{+} |
6108 \def\normaldollar{$} | 6216 \def\normaldollar{$}%$ font-lock fix |
6109 | 6217 |
6110 % This macro is used to make a character print one way in ttfont | 6218 % This macro is used to make a character print one way in ttfont |
6111 % where it can probably just be output, and another way in other fonts, | 6219 % where it can probably just be output, and another way in other fonts, |
6112 % where something hairier probably needs to be done. | 6220 % where something hairier probably needs to be done. |
6113 % | 6221 % |
6152 \catcode`\>=\active | 6260 \catcode`\>=\active |
6153 \def>{{\tt \gtr}} | 6261 \def>{{\tt \gtr}} |
6154 \catcode`\+=\active | 6262 \catcode`\+=\active |
6155 \def+{{\tt \char 43}} | 6263 \def+{{\tt \char 43}} |
6156 \catcode`\$=\active | 6264 \catcode`\$=\active |
6157 \def${\ifusingit{{\sl\$}}\normaldollar} | 6265 \def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix |
6158 %\catcode 27=\active | 6266 %\catcode 27=\active |
6159 %\def^^[{$\diamondsuit$} | 6267 %\def^^[{$\diamondsuit$} |
6160 | 6268 |
6161 % Set up an active definition for =, but don't enable it most of the time. | 6269 % Set up an active definition for =, but don't enable it most of the time. |
6162 {\catcode`\==\active | 6270 {\catcode`\==\active |
6197 @let_=@normalunderscore | 6305 @let_=@normalunderscore |
6198 @let|=@normalverticalbar | 6306 @let|=@normalverticalbar |
6199 @let<=@normalless | 6307 @let<=@normalless |
6200 @let>=@normalgreater | 6308 @let>=@normalgreater |
6201 @let+=@normalplus | 6309 @let+=@normalplus |
6202 @let$=@normaldollar} | 6310 @let$=@normaldollar}%$ font-lock fix |
6203 | 6311 |
6204 @def@normalturnoffactive{@let"=@normaldoublequote | 6312 @def@normalturnoffactive{@let"=@normaldoublequote |
6205 @let\=@normalbackslash | 6313 @let\=@normalbackslash |
6206 @let~=@normaltilde | 6314 @let~=@normaltilde |
6207 @let^=@normalcaret | 6315 @let^=@normalcaret |
6208 @let_=@normalunderscore | 6316 @let_=@normalunderscore |
6209 @let|=@normalverticalbar | 6317 @let|=@normalverticalbar |
6210 @let<=@normalless | 6318 @let<=@normalless |
6211 @let>=@normalgreater | 6319 @let>=@normalgreater |
6212 @let+=@normalplus | 6320 @let+=@normalplus |
6213 @let$=@normaldollar} | 6321 @let$=@normaldollar}%$ font-lock fix |
6214 | 6322 |
6215 % Make _ and + \other characters, temporarily. | 6323 % Make _ and + \other characters, temporarily. |
6216 % This is canceled by @fixbackslash. | 6324 % This is canceled by @fixbackslash. |
6217 @otherifyactive | 6325 @otherifyactive |
6218 | 6326 |