diff options
Diffstat (limited to 'doc/texinfo.tex')
-rw-r--r-- | doc/texinfo.tex | 1874 |
1 files changed, 1248 insertions, 626 deletions
diff --git a/doc/texinfo.tex b/doc/texinfo.tex index 91408263..2abda0f3 100644 --- a/doc/texinfo.tex +++ b/doc/texinfo.tex | |||
@@ -3,11 +3,11 @@ | |||
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{2009-08-14.15} | 6 | \def\texinfoversion{2012-01-03.09} |
7 | % | 7 | % |
8 | % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, | 8 | % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, |
9 | % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, | 9 | % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, |
10 | % 2007, 2008, 2009 Free Software Foundation, Inc. | 10 | % 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. |
11 | % | 11 | % |
12 | % This texinfo.tex file is free software: you can redistribute it and/or | 12 | % This texinfo.tex file is free software: you can redistribute it and/or |
13 | % modify it under the terms of the GNU General Public License as | 13 | % modify it under the terms of the GNU General Public License as |
@@ -65,7 +65,6 @@ | |||
65 | \everyjob{\message{[Texinfo version \texinfoversion]}% | 65 | \everyjob{\message{[Texinfo version \texinfoversion]}% |
66 | \catcode`+=\active \catcode`\_=\active} | 66 | \catcode`+=\active \catcode`\_=\active} |
67 | 67 | ||
68 | |||
69 | \chardef\other=12 | 68 | \chardef\other=12 |
70 | 69 | ||
71 | % We never want plain's \outer definition of \+ in Texinfo. | 70 | % We never want plain's \outer definition of \+ in Texinfo. |
@@ -93,14 +92,13 @@ | |||
93 | \let\ptexnewwrite\newwrite | 92 | \let\ptexnewwrite\newwrite |
94 | \let\ptexnoindent=\noindent | 93 | \let\ptexnoindent=\noindent |
95 | \let\ptexplus=+ | 94 | \let\ptexplus=+ |
95 | \let\ptexraggedright=\raggedright | ||
96 | \let\ptexrbrace=\} | 96 | \let\ptexrbrace=\} |
97 | \let\ptexslash=\/ | 97 | \let\ptexslash=\/ |
98 | \let\ptexstar=\* | 98 | \let\ptexstar=\* |
99 | \let\ptext=\t | 99 | \let\ptext=\t |
100 | \let\ptextop=\top | 100 | \let\ptextop=\top |
101 | {\catcode`\'=\active | 101 | {\catcode`\'=\active \global\let\ptexquoteright'}% active in plain's math mode |
102 | \global\let\ptexquoteright'}% Math-mode def from plain.tex. | ||
103 | \let\ptexraggedright=\raggedright | ||
104 | 102 | ||
105 | % If this character appears in an error message or help string, it | 103 | % If this character appears in an error message or help string, it |
106 | % starts a new line in the output. | 104 | % starts a new line in the output. |
@@ -118,10 +116,11 @@ | |||
118 | % Set up fixed words for English if not already set. | 116 | % Set up fixed words for English if not already set. |
119 | \ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi | 117 | \ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi |
120 | \ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi | 118 | \ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi |
119 | \ifx\putworderror\undefined \gdef\putworderror{error}\fi | ||
121 | \ifx\putwordfile\undefined \gdef\putwordfile{file}\fi | 120 | \ifx\putwordfile\undefined \gdef\putwordfile{file}\fi |
122 | \ifx\putwordin\undefined \gdef\putwordin{in}\fi | 121 | \ifx\putwordin\undefined \gdef\putwordin{in}\fi |
123 | \ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi | 122 | \ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi |
124 | \ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi | 123 | \ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi |
125 | \ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi | 124 | \ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi |
126 | \ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi | 125 | \ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi |
127 | \ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi | 126 | \ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi |
@@ -160,15 +159,18 @@ | |||
160 | \def\spaceisspace{\catcode`\ =\spacecat} | 159 | \def\spaceisspace{\catcode`\ =\spacecat} |
161 | 160 | ||
162 | % sometimes characters are active, so we need control sequences. | 161 | % sometimes characters are active, so we need control sequences. |
162 | \chardef\ampChar = `\& | ||
163 | \chardef\colonChar = `\: | 163 | \chardef\colonChar = `\: |
164 | \chardef\commaChar = `\, | 164 | \chardef\commaChar = `\, |
165 | \chardef\dashChar = `\- | 165 | \chardef\dashChar = `\- |
166 | \chardef\dotChar = `\. | 166 | \chardef\dotChar = `\. |
167 | \chardef\exclamChar= `\! | 167 | \chardef\exclamChar= `\! |
168 | \chardef\hashChar = `\# | ||
168 | \chardef\lquoteChar= `\` | 169 | \chardef\lquoteChar= `\` |
169 | \chardef\questChar = `\? | 170 | \chardef\questChar = `\? |
170 | \chardef\rquoteChar= `\' | 171 | \chardef\rquoteChar= `\' |
171 | \chardef\semiChar = `\; | 172 | \chardef\semiChar = `\; |
173 | \chardef\slashChar = `\/ | ||
172 | \chardef\underChar = `\_ | 174 | \chardef\underChar = `\_ |
173 | 175 | ||
174 | % Ignore a token. | 176 | % Ignore a token. |
@@ -199,36 +201,7 @@ | |||
199 | % that mark overfull boxes (in case you have decided | 201 | % that mark overfull boxes (in case you have decided |
200 | % that the text looks ok even though it passes the margin). | 202 | % that the text looks ok even though it passes the margin). |
201 | % | 203 | % |
202 | \def\finalout{\overfullrule=0pt} | 204 | \def\finalout{\overfullrule=0pt } |
203 | |||
204 | % @| inserts a changebar to the left of the current line. It should | ||
205 | % surround any changed text. This approach does *not* work if the | ||
206 | % change spans more than two lines of output. To handle that, we would | ||
207 | % have adopt a much more difficult approach (putting marks into the main | ||
208 | % vertical list for the beginning and end of each change). | ||
209 | % | ||
210 | \def\|{% | ||
211 | % \vadjust can only be used in horizontal mode. | ||
212 | \leavevmode | ||
213 | % | ||
214 | % Append this vertical mode material after the current line in the output. | ||
215 | \vadjust{% | ||
216 | % We want to insert a rule with the height and depth of the current | ||
217 | % leading; that is exactly what \strutbox is supposed to record. | ||
218 | \vskip-\baselineskip | ||
219 | % | ||
220 | % \vadjust-items are inserted at the left edge of the type. So | ||
221 | % the \llap here moves out into the left-hand margin. | ||
222 | \llap{% | ||
223 | % | ||
224 | % For a thicker or thinner bar, change the `1pt'. | ||
225 | \vrule height\baselineskip width1pt | ||
226 | % | ||
227 | % This is the space between the bar and the text. | ||
228 | \hskip 12pt | ||
229 | }% | ||
230 | }% | ||
231 | } | ||
232 | 205 | ||
233 | % Sometimes it is convenient to have everything in the transcript file | 206 | % Sometimes it is convenient to have everything in the transcript file |
234 | % and nothing on the terminal. We don't just call \tracingall here, | 207 | % and nothing on the terminal. We don't just call \tracingall here, |
@@ -246,7 +219,7 @@ | |||
246 | \tracingmacros2 | 219 | \tracingmacros2 |
247 | \tracingrestores1 | 220 | \tracingrestores1 |
248 | \showboxbreadth\maxdimen \showboxdepth\maxdimen | 221 | \showboxbreadth\maxdimen \showboxdepth\maxdimen |
249 | \ifx\eTeXversion\undefined\else % etex gives us more logging | 222 | \ifx\eTeXversion\thisisundefined\else % etex gives us more logging |
250 | \tracingscantokens1 | 223 | \tracingscantokens1 |
251 | \tracingifs1 | 224 | \tracingifs1 |
252 | \tracinggroups1 | 225 | \tracinggroups1 |
@@ -257,6 +230,13 @@ | |||
257 | \errorcontextlines16 | 230 | \errorcontextlines16 |
258 | }% | 231 | }% |
259 | 232 | ||
233 | % @errormsg{MSG}. Do the index-like expansions on MSG, but if things | ||
234 | % aren't perfect, it's not the end of the world, being an error message, | ||
235 | % after all. | ||
236 | % | ||
237 | \def\errormsg{\begingroup \indexnofonts \doerrormsg} | ||
238 | \def\doerrormsg#1{\errmessage{#1}} | ||
239 | |||
260 | % add check for \lastpenalty to plain's definitions. If the last thing | 240 | % add check for \lastpenalty to plain's definitions. If the last thing |
261 | % we did was a \nobreak, we don't want to insert more space. | 241 | % we did was a \nobreak, we don't want to insert more space. |
262 | % | 242 | % |
@@ -267,7 +247,6 @@ | |||
267 | \def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount | 247 | \def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount |
268 | \removelastskip\penalty-200\bigskip\fi\fi} | 248 | \removelastskip\penalty-200\bigskip\fi\fi} |
269 | 249 | ||
270 | % For @cropmarks command. | ||
271 | % Do @cropmarks to get crop marks. | 250 | % Do @cropmarks to get crop marks. |
272 | % | 251 | % |
273 | \newif\ifcropmarks | 252 | \newif\ifcropmarks |
@@ -577,7 +556,7 @@ | |||
577 | } | 556 | } |
578 | \def\inenvironment#1{% | 557 | \def\inenvironment#1{% |
579 | \ifx#1\empty | 558 | \ifx#1\empty |
580 | out of any environment% | 559 | outside of any environment% |
581 | \else | 560 | \else |
582 | in environment \expandafter\string#1% | 561 | in environment \expandafter\string#1% |
583 | \fi | 562 | \fi |
@@ -589,7 +568,7 @@ | |||
589 | \parseargdef\end{% | 568 | \parseargdef\end{% |
590 | \if 1\csname iscond.#1\endcsname | 569 | \if 1\csname iscond.#1\endcsname |
591 | \else | 570 | \else |
592 | % The general wording of \badenverr may not be ideal, but... --kasal, 06nov03 | 571 | % The general wording of \badenverr may not be ideal. |
593 | \expandafter\checkenv\csname#1\endcsname | 572 | \expandafter\checkenv\csname#1\endcsname |
594 | \csname E#1\endcsname | 573 | \csname E#1\endcsname |
595 | \endgroup | 574 | \endgroup |
@@ -599,85 +578,6 @@ | |||
599 | \newhelp\EMsimple{Press RETURN to continue.} | 578 | \newhelp\EMsimple{Press RETURN to continue.} |
600 | 579 | ||
601 | 580 | ||
602 | %% Simple single-character @ commands | ||
603 | |||
604 | % @@ prints an @ | ||
605 | % Kludge this until the fonts are right (grr). | ||
606 | \def\@{{\tt\char64}} | ||
607 | |||
608 | % This is turned off because it was never documented | ||
609 | % and you can use @w{...} around a quote to suppress ligatures. | ||
610 | %% Define @` and @' to be the same as ` and ' | ||
611 | %% but suppressing ligatures. | ||
612 | %\def\`{{`}} | ||
613 | %\def\'{{'}} | ||
614 | |||
615 | % Used to generate quoted braces. | ||
616 | \def\mylbrace {{\tt\char123}} | ||
617 | \def\myrbrace {{\tt\char125}} | ||
618 | \let\{=\mylbrace | ||
619 | \let\}=\myrbrace | ||
620 | \begingroup | ||
621 | % Definitions to produce \{ and \} commands for indices, | ||
622 | % and @{ and @} for the aux/toc files. | ||
623 | \catcode`\{ = \other \catcode`\} = \other | ||
624 | \catcode`\[ = 1 \catcode`\] = 2 | ||
625 | \catcode`\! = 0 \catcode`\\ = \other | ||
626 | !gdef!lbracecmd[\{]% | ||
627 | !gdef!rbracecmd[\}]% | ||
628 | !gdef!lbraceatcmd[@{]% | ||
629 | !gdef!rbraceatcmd[@}]% | ||
630 | !endgroup | ||
631 | |||
632 | % @comma{} to avoid , parsing problems. | ||
633 | \let\comma = , | ||
634 | |||
635 | % Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent | ||
636 | % Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H. | ||
637 | \let\, = \c | ||
638 | \let\dotaccent = \. | ||
639 | \def\ringaccent#1{{\accent23 #1}} | ||
640 | \let\tieaccent = \t | ||
641 | \let\ubaraccent = \b | ||
642 | \let\udotaccent = \d | ||
643 | |||
644 | % Other special characters: @questiondown @exclamdown @ordf @ordm | ||
645 | % Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss. | ||
646 | \def\questiondown{?`} | ||
647 | \def\exclamdown{!`} | ||
648 | \def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}} | ||
649 | \def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}} | ||
650 | |||
651 | % Dotless i and dotless j, used for accents. | ||
652 | \def\imacro{i} | ||
653 | \def\jmacro{j} | ||
654 | \def\dotless#1{% | ||
655 | \def\temp{#1}% | ||
656 | \ifx\temp\imacro \ifmmode\imath \else\ptexi \fi | ||
657 | \else\ifx\temp\jmacro \ifmmode\jmath \else\j \fi | ||
658 | \else \errmessage{@dotless can be used only with i or j}% | ||
659 | \fi\fi | ||
660 | } | ||
661 | |||
662 | % The \TeX{} logo, as in plain, but resetting the spacing so that a | ||
663 | % period following counts as ending a sentence. (Idea found in latex.) | ||
664 | % | ||
665 | \edef\TeX{\TeX \spacefactor=1000 } | ||
666 | |||
667 | % @LaTeX{} logo. Not quite the same results as the definition in | ||
668 | % latex.ltx, since we use a different font for the raised A; it's most | ||
669 | % convenient for us to use an explicitly smaller font, rather than using | ||
670 | % the \scriptstyle font (since we don't reset \scriptstyle and | ||
671 | % \scriptscriptstyle). | ||
672 | % | ||
673 | \def\LaTeX{% | ||
674 | L\kern-.36em | ||
675 | {\setbox0=\hbox{T}% | ||
676 | \vbox to \ht0{\hbox{\selectfonts\lllsize A}\vss}}% | ||
677 | \kern-.15em | ||
678 | \TeX | ||
679 | } | ||
680 | |||
681 | % Be sure we're in horizontal mode when doing a tie, since we make space | 581 | % Be sure we're in horizontal mode when doing a tie, since we make space |
682 | % equivalent to this in @example-like environments. Otherwise, a space | 582 | % equivalent to this in @example-like environments. Otherwise, a space |
683 | % at the beginning of a line will start with \penalty -- and | 583 | % at the beginning of a line will start with \penalty -- and |
@@ -719,7 +619,7 @@ | |||
719 | \else\ifx\temp\offword \plainnonfrenchspacing | 619 | \else\ifx\temp\offword \plainnonfrenchspacing |
720 | \else | 620 | \else |
721 | \errhelp = \EMsimple | 621 | \errhelp = \EMsimple |
722 | \errmessage{Unknown @frenchspacing option `\temp', must be on/off}% | 622 | \errmessage{Unknown @frenchspacing option `\temp', must be on|off}% |
723 | \fi\fi | 623 | \fi\fi |
724 | } | 624 | } |
725 | 625 | ||
@@ -801,15 +701,6 @@ where each line of input produces a line of output.} | |||
801 | 701 | ||
802 | \newdimen\mil \mil=0.001in | 702 | \newdimen\mil \mil=0.001in |
803 | 703 | ||
804 | % Old definition--didn't work. | ||
805 | %\parseargdef\need{\par % | ||
806 | %% This method tries to make TeX break the page naturally | ||
807 | %% if the depth of the box does not fit. | ||
808 | %{\baselineskip=0pt% | ||
809 | %\vtop to #1\mil{\vfil}\kern -#1\mil\nobreak | ||
810 | %\prevdepth=-1000pt | ||
811 | %}} | ||
812 | |||
813 | \parseargdef\need{% | 704 | \parseargdef\need{% |
814 | % Ensure vertical mode, so we don't make a big box in the middle of a | 705 | % Ensure vertical mode, so we don't make a big box in the middle of a |
815 | % paragraph. | 706 | % paragraph. |
@@ -873,7 +764,7 @@ where each line of input produces a line of output.} | |||
873 | 764 | ||
874 | % @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current | 765 | % @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current |
875 | % paragraph. For more general purposes, use the \margin insertion | 766 | % paragraph. For more general purposes, use the \margin insertion |
876 | % class. WHICH is `l' or `r'. | 767 | % class. WHICH is `l' or `r'. Not documented, written for gawk manual. |
877 | % | 768 | % |
878 | \newskip\inmarginspacing \inmarginspacing=1cm | 769 | \newskip\inmarginspacing \inmarginspacing=1cm |
879 | \def\strutdepth{\dp\strutbox} | 770 | \def\strutdepth{\dp\strutbox} |
@@ -920,6 +811,36 @@ where each line of input produces a line of output.} | |||
920 | \temp | 811 | \temp |
921 | } | 812 | } |
922 | 813 | ||
814 | % @| inserts a changebar to the left of the current line. It should | ||
815 | % surround any changed text. This approach does *not* work if the | ||
816 | % change spans more than two lines of output. To handle that, we would | ||
817 | % have adopt a much more difficult approach (putting marks into the main | ||
818 | % vertical list for the beginning and end of each change). This command | ||
819 | % is not documented, not supported, and doesn't work. | ||
820 | % | ||
821 | \def\|{% | ||
822 | % \vadjust can only be used in horizontal mode. | ||
823 | \leavevmode | ||
824 | % | ||
825 | % Append this vertical mode material after the current line in the output. | ||
826 | \vadjust{% | ||
827 | % We want to insert a rule with the height and depth of the current | ||
828 | % leading; that is exactly what \strutbox is supposed to record. | ||
829 | \vskip-\baselineskip | ||
830 | % | ||
831 | % \vadjust-items are inserted at the left edge of the type. So | ||
832 | % the \llap here moves out into the left-hand margin. | ||
833 | \llap{% | ||
834 | % | ||
835 | % For a thicker or thinner bar, change the `1pt'. | ||
836 | \vrule height\baselineskip width1pt | ||
837 | % | ||
838 | % This is the space between the bar and the text. | ||
839 | \hskip 12pt | ||
840 | }% | ||
841 | }% | ||
842 | } | ||
843 | |||
923 | % @include FILE -- \input text of FILE. | 844 | % @include FILE -- \input text of FILE. |
924 | % | 845 | % |
925 | \def\include{\parseargusing\filenamecatcodes\includezzz} | 846 | \def\include{\parseargusing\filenamecatcodes\includezzz} |
@@ -930,6 +851,7 @@ where each line of input produces a line of output.} | |||
930 | \makevalueexpandable % we want to expand any @value in FILE. | 851 | \makevalueexpandable % we want to expand any @value in FILE. |
931 | \turnoffactive % and allow special characters in the expansion | 852 | \turnoffactive % and allow special characters in the expansion |
932 | \indexnofonts % Allow `@@' and other weird things in file names. | 853 | \indexnofonts % Allow `@@' and other weird things in file names. |
854 | \wlog{texinfo.tex: doing @include of #1^^J}% | ||
933 | \edef\temp{\noexpand\input #1 }% | 855 | \edef\temp{\noexpand\input #1 }% |
934 | % | 856 | % |
935 | % This trickery is to read FILE outside of a group, in case it makes | 857 | % This trickery is to read FILE outside of a group, in case it makes |
@@ -1095,109 +1017,6 @@ where each line of input produces a line of output.} | |||
1095 | } | 1017 | } |
1096 | 1018 | ||
1097 | 1019 | ||
1098 | % @asis just yields its argument. Used with @table, for example. | ||
1099 | % | ||
1100 | \def\asis#1{#1} | ||
1101 | |||
1102 | % @math outputs its argument in math mode. | ||
1103 | % | ||
1104 | % One complication: _ usually means subscripts, but it could also mean | ||
1105 | % an actual _ character, as in @math{@var{some_variable} + 1}. So make | ||
1106 | % _ active, and distinguish by seeing if the current family is \slfam, | ||
1107 | % which is what @var uses. | ||
1108 | { | ||
1109 | \catcode`\_ = \active | ||
1110 | \gdef\mathunderscore{% | ||
1111 | \catcode`\_=\active | ||
1112 | \def_{\ifnum\fam=\slfam \_\else\sb\fi}% | ||
1113 | } | ||
1114 | } | ||
1115 | % Another complication: we want \\ (and @\) to output a \ character. | ||
1116 | % FYI, plain.tex uses \\ as a temporary control sequence (why?), but | ||
1117 | % this is not advertised and we don't care. Texinfo does not | ||
1118 | % otherwise define @\. | ||
1119 | % | ||
1120 | % The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\. | ||
1121 | \def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi} | ||
1122 | % | ||
1123 | \def\math{% | ||
1124 | \tex | ||
1125 | \mathunderscore | ||
1126 | \let\\ = \mathbackslash | ||
1127 | \mathactive | ||
1128 | % make the texinfo accent commands work in math mode | ||
1129 | \let\"=\ddot | ||
1130 | \let\'=\acute | ||
1131 | \let\==\bar | ||
1132 | \let\^=\hat | ||
1133 | \let\`=\grave | ||
1134 | \let\u=\breve | ||
1135 | \let\v=\check | ||
1136 | \let\~=\tilde | ||
1137 | \let\dotaccent=\dot | ||
1138 | $\finishmath | ||
1139 | } | ||
1140 | \def\finishmath#1{#1$\endgroup} % Close the group opened by \tex. | ||
1141 | |||
1142 | % Some active characters (such as <) are spaced differently in math. | ||
1143 | % We have to reset their definitions in case the @math was an argument | ||
1144 | % to a command which sets the catcodes (such as @item or @section). | ||
1145 | % | ||
1146 | { | ||
1147 | \catcode`^ = \active | ||
1148 | \catcode`< = \active | ||
1149 | \catcode`> = \active | ||
1150 | \catcode`+ = \active | ||
1151 | \catcode`' = \active | ||
1152 | \gdef\mathactive{% | ||
1153 | \let^ = \ptexhat | ||
1154 | \let< = \ptexless | ||
1155 | \let> = \ptexgtr | ||
1156 | \let+ = \ptexplus | ||
1157 | \let' = \ptexquoteright | ||
1158 | } | ||
1159 | } | ||
1160 | |||
1161 | % Some math mode symbols. | ||
1162 | \def\bullet{$\ptexbullet$} | ||
1163 | \def\geq{\ifmmode \ge\else $\ge$\fi} | ||
1164 | \def\leq{\ifmmode \le\else $\le$\fi} | ||
1165 | \def\minus{\ifmmode -\else $-$\fi} | ||
1166 | |||
1167 | % @dots{} outputs an ellipsis using the current font. | ||
1168 | % We do .5em per period so that it has the same spacing in the cm | ||
1169 | % typewriter fonts as three actual period characters; on the other hand, | ||
1170 | % in other typewriter fonts three periods are wider than 1.5em. So do | ||
1171 | % whichever is larger. | ||
1172 | % | ||
1173 | \def\dots{% | ||
1174 | \leavevmode | ||
1175 | \setbox0=\hbox{...}% get width of three periods | ||
1176 | \ifdim\wd0 > 1.5em | ||
1177 | \dimen0 = \wd0 | ||
1178 | \else | ||
1179 | \dimen0 = 1.5em | ||
1180 | \fi | ||
1181 | \hbox to \dimen0{% | ||
1182 | \hskip 0pt plus.25fil | ||
1183 | .\hskip 0pt plus1fil | ||
1184 | .\hskip 0pt plus1fil | ||
1185 | .\hskip 0pt plus.5fil | ||
1186 | }% | ||
1187 | } | ||
1188 | |||
1189 | % @enddots{} is an end-of-sentence ellipsis. | ||
1190 | % | ||
1191 | \def\enddots{% | ||
1192 | \dots | ||
1193 | \spacefactor=\endofsentencespacefactor | ||
1194 | } | ||
1195 | |||
1196 | % @comma{} is so commas can be inserted into text without messing up | ||
1197 | % Texinfo's parsing. | ||
1198 | % | ||
1199 | \let\comma = , | ||
1200 | |||
1201 | % @refill is a no-op. | 1020 | % @refill is a no-op. |
1202 | \let\refill=\relax | 1021 | \let\refill=\relax |
1203 | 1022 | ||
@@ -1262,9 +1081,8 @@ where each line of input produces a line of output.} | |||
1262 | \newif\ifpdfmakepagedest | 1081 | \newif\ifpdfmakepagedest |
1263 | 1082 | ||
1264 | % when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1 | 1083 | % when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1 |
1265 | % can be set). So we test for \relax and 0 as well as \undefined, | 1084 | % can be set). So we test for \relax and 0 as well as being undefined. |
1266 | % borrowed from ifpdf.sty. | 1085 | \ifx\pdfoutput\thisisundefined |
1267 | \ifx\pdfoutput\undefined | ||
1268 | \else | 1086 | \else |
1269 | \ifx\pdfoutput\relax | 1087 | \ifx\pdfoutput\relax |
1270 | \else | 1088 | \else |
@@ -1279,50 +1097,24 @@ where each line of input produces a line of output.} | |||
1279 | % for display in the outlines, and in other places. Thus, we have to | 1097 | % for display in the outlines, and in other places. Thus, we have to |
1280 | % double any backslashes. Otherwise, a name like "\node" will be | 1098 | % double any backslashes. Otherwise, a name like "\node" will be |
1281 | % interpreted as a newline (\n), followed by o, d, e. Not good. | 1099 | % interpreted as a newline (\n), followed by o, d, e. Not good. |
1282 | % http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html | 1100 | % |
1283 | % (and related messages, the final outcome is that it is up to the TeX | 1101 | % See http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html and |
1284 | % user to double the backslashes and otherwise make the string valid, so | 1102 | % related messages. The final outcome is that it is up to the TeX user |
1285 | % that's what we do). | 1103 | % to double the backslashes and otherwise make the string valid, so |
1286 | 1104 | % that's what we do. pdftex 1.30.0 (ca.2005) introduced a primitive to | |
1287 | % double active backslashes. | 1105 | % do this reliably, so we use it. |
1288 | % | 1106 | |
1289 | {\catcode`\@=0 \catcode`\\=\active | 1107 | % #1 is a control sequence in which to do the replacements, |
1290 | @gdef@activebackslashdouble{% | 1108 | % which we \xdef. |
1291 | @catcode`@\=@active | 1109 | \def\txiescapepdf#1{% |
1292 | @let\=@doublebackslash} | 1110 | \ifx\pdfescapestring\relax |
1293 | } | 1111 | % No primitive available; should we give a warning or log? |
1294 | 1112 | % Many times it won't matter. | |
1295 | % To handle parens, we must adopt a different approach, since parens are | 1113 | \else |
1296 | % not active characters. hyperref.dtx (which has the same problem as | 1114 | % The expandable \pdfescapestring primitive escapes parentheses, |
1297 | % us) handles it with this amazing macro to replace tokens, with minor | 1115 | % backslashes, and other special chars. |
1298 | % changes for Texinfo. It is included here under the GPL by permission | 1116 | \xdef#1{\pdfescapestring{#1}}% |
1299 | % from the author, Heiko Oberdiek. | 1117 | \fi |
1300 | % | ||
1301 | % #1 is the tokens to replace. | ||
1302 | % #2 is the replacement. | ||
1303 | % #3 is the control sequence with the string. | ||
1304 | % | ||
1305 | \def\HyPsdSubst#1#2#3{% | ||
1306 | \def\HyPsdReplace##1#1##2\END{% | ||
1307 | ##1% | ||
1308 | \ifx\\##2\\% | ||
1309 | \else | ||
1310 | #2% | ||
1311 | \HyReturnAfterFi{% | ||
1312 | \HyPsdReplace##2\END | ||
1313 | }% | ||
1314 | \fi | ||
1315 | }% | ||
1316 | \xdef#3{\expandafter\HyPsdReplace#3#1\END}% | ||
1317 | } | ||
1318 | \long\def\HyReturnAfterFi#1\fi{\fi#1} | ||
1319 | |||
1320 | % #1 is a control sequence in which to do the replacements. | ||
1321 | \def\backslashparens#1{% | ||
1322 | \xdef#1{#1}% redefine it as its expansion; the definition is simply | ||
1323 | % \lastnode when called from \setref -> \pdfmkdest. | ||
1324 | \HyPsdSubst{(}{\realbackslash(}{#1}% | ||
1325 | \HyPsdSubst{)}{\realbackslash)}{#1}% | ||
1326 | } | 1118 | } |
1327 | 1119 | ||
1328 | \newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images | 1120 | \newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images |
@@ -1384,29 +1176,31 @@ output) for that.)} | |||
1384 | \def\imagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}% | 1176 | \def\imagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}% |
1385 | \def\imageheight{#3}\setbox2 = \hbox{\ignorespaces #3}% | 1177 | \def\imageheight{#3}\setbox2 = \hbox{\ignorespaces #3}% |
1386 | % | 1178 | % |
1387 | % pdftex (and the PDF format) support .png, .jpg, .pdf (among | 1179 | % pdftex (and the PDF format) support .pdf, .png, .jpg (among |
1388 | % others). Let's try in that order. | 1180 | % others). Let's try in that order, PDF first since if |
1181 | % someone has a scalable image, presumably better to use that than a | ||
1182 | % bitmap. | ||
1389 | \let\pdfimgext=\empty | 1183 | \let\pdfimgext=\empty |
1390 | \begingroup | 1184 | \begingroup |
1391 | \openin 1 #1.png \ifeof 1 | 1185 | \openin 1 #1.pdf \ifeof 1 |
1392 | \openin 1 #1.jpg \ifeof 1 | 1186 | \openin 1 #1.PDF \ifeof 1 |
1393 | \openin 1 #1.jpeg \ifeof 1 | 1187 | \openin 1 #1.png \ifeof 1 |
1394 | \openin 1 #1.JPG \ifeof 1 | 1188 | \openin 1 #1.jpg \ifeof 1 |
1395 | \openin 1 #1.pdf \ifeof 1 | 1189 | \openin 1 #1.jpeg \ifeof 1 |
1396 | \openin 1 #1.PDF \ifeof 1 | 1190 | \openin 1 #1.JPG \ifeof 1 |
1397 | \errhelp = \nopdfimagehelp | 1191 | \errhelp = \nopdfimagehelp |
1398 | \errmessage{Could not find image file #1 for pdf}% | 1192 | \errmessage{Could not find image file #1 for pdf}% |
1399 | \else \gdef\pdfimgext{PDF}% | 1193 | \else \gdef\pdfimgext{JPG}% |
1400 | \fi | 1194 | \fi |
1401 | \else \gdef\pdfimgext{pdf}% | 1195 | \else \gdef\pdfimgext{jpeg}% |
1402 | \fi | 1196 | \fi |
1403 | \else \gdef\pdfimgext{JPG}% | 1197 | \else \gdef\pdfimgext{jpg}% |
1404 | \fi | 1198 | \fi |
1405 | \else \gdef\pdfimgext{jpeg}% | 1199 | \else \gdef\pdfimgext{png}% |
1406 | \fi | 1200 | \fi |
1407 | \else \gdef\pdfimgext{jpg}% | 1201 | \else \gdef\pdfimgext{PDF}% |
1408 | \fi | 1202 | \fi |
1409 | \else \gdef\pdfimgext{png}% | 1203 | \else \gdef\pdfimgext{pdf}% |
1410 | \fi | 1204 | \fi |
1411 | \closein 1 | 1205 | \closein 1 |
1412 | \endgroup | 1206 | \endgroup |
@@ -1434,10 +1228,9 @@ output) for that.)} | |||
1434 | % such as \, aren't expanded when present in a section title. | 1228 | % such as \, aren't expanded when present in a section title. |
1435 | \indexnofonts | 1229 | \indexnofonts |
1436 | \turnoffactive | 1230 | \turnoffactive |
1437 | \activebackslashdouble | ||
1438 | \makevalueexpandable | 1231 | \makevalueexpandable |
1439 | \def\pdfdestname{#1}% | 1232 | \def\pdfdestname{#1}% |
1440 | \backslashparens\pdfdestname | 1233 | \txiescapepdf\pdfdestname |
1441 | \safewhatsit{\pdfdest name{\pdfdestname} xyz}% | 1234 | \safewhatsit{\pdfdest name{\pdfdestname} xyz}% |
1442 | }} | 1235 | }} |
1443 | % | 1236 | % |
@@ -1469,29 +1262,24 @@ output) for that.)} | |||
1469 | % page number. We could generate a destination for the section | 1262 | % page number. We could generate a destination for the section |
1470 | % text in the case where a section has no node, but it doesn't | 1263 | % text in the case where a section has no node, but it doesn't |
1471 | % seem worth the trouble, since most documents are normally structured. | 1264 | % seem worth the trouble, since most documents are normally structured. |
1472 | \def\pdfoutlinedest{#3}% | 1265 | \edef\pdfoutlinedest{#3}% |
1473 | \ifx\pdfoutlinedest\empty | 1266 | \ifx\pdfoutlinedest\empty |
1474 | \def\pdfoutlinedest{#4}% | 1267 | \def\pdfoutlinedest{#4}% |
1475 | \else | 1268 | \else |
1476 | % Doubled backslashes in the name. | 1269 | \txiescapepdf\pdfoutlinedest |
1477 | {\activebackslashdouble \xdef\pdfoutlinedest{#3}% | ||
1478 | \backslashparens\pdfoutlinedest}% | ||
1479 | \fi | 1270 | \fi |
1480 | % | 1271 | % |
1481 | % Also double the backslashes in the display string. | 1272 | % Also escape PDF chars in the display string. |
1482 | {\activebackslashdouble \xdef\pdfoutlinetext{#1}% | 1273 | \edef\pdfoutlinetext{#1}% |
1483 | \backslashparens\pdfoutlinetext}% | 1274 | \txiescapepdf\pdfoutlinetext |
1484 | % | 1275 | % |
1485 | \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{\pdfoutlinetext}% | 1276 | \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{\pdfoutlinetext}% |
1486 | } | 1277 | } |
1487 | % | 1278 | % |
1488 | \def\pdfmakeoutlines{% | 1279 | \def\pdfmakeoutlines{% |
1489 | \begingroup | 1280 | \begingroup |
1490 | % Thanh's hack / proper braces in bookmarks | ||
1491 | \edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace | ||
1492 | \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace | ||
1493 | % | ||
1494 | % Read toc silently, to get counts of subentries for \pdfoutline. | 1281 | % Read toc silently, to get counts of subentries for \pdfoutline. |
1282 | \def\partentry##1##2##3##4{}% ignore parts in the outlines | ||
1495 | \def\numchapentry##1##2##3##4{% | 1283 | \def\numchapentry##1##2##3##4{% |
1496 | \def\thischapnum{##2}% | 1284 | \def\thischapnum{##2}% |
1497 | \def\thissecnum{0}% | 1285 | \def\thissecnum{0}% |
@@ -1545,15 +1333,26 @@ output) for that.)} | |||
1545 | % Latin 2 (0xea) gets translated to a | character. Info from | 1333 | % Latin 2 (0xea) gets translated to a | character. Info from |
1546 | % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100. | 1334 | % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100. |
1547 | % | 1335 | % |
1548 | % xx to do this right, we have to translate 8-bit characters to | 1336 | % TODO this right, we have to translate 8-bit characters to |
1549 | % their "best" equivalent, based on the @documentencoding. Right | 1337 | % their "best" equivalent, based on the @documentencoding. Too |
1550 | % now, I guess we'll just let the pdf reader have its way. | 1338 | % much work for too little return. Just use the ASCII equivalents |
1339 | % we use for the index sort strings. | ||
1340 | % | ||
1551 | \indexnofonts | 1341 | \indexnofonts |
1552 | \setupdatafile | 1342 | \setupdatafile |
1343 | % We can have normal brace characters in the PDF outlines, unlike | ||
1344 | % Texinfo index files. So set that up. | ||
1345 | \def\{{\lbracecharliteral}% | ||
1346 | \def\}{\rbracecharliteral}% | ||
1553 | \catcode`\\=\active \otherbackslash | 1347 | \catcode`\\=\active \otherbackslash |
1554 | \input \tocreadfilename | 1348 | \input \tocreadfilename |
1555 | \endgroup | 1349 | \endgroup |
1556 | } | 1350 | } |
1351 | {\catcode`[=1 \catcode`]=2 | ||
1352 | \catcode`{=\other \catcode`}=\other | ||
1353 | \gdef\lbracecharliteral[{]% | ||
1354 | \gdef\rbracecharliteral[}]% | ||
1355 | ] | ||
1557 | % | 1356 | % |
1558 | \def\skipspaces#1{\def\PP{#1}\def\D{|}% | 1357 | \def\skipspaces#1{\def\PP{#1}\def\D{|}% |
1559 | \ifx\PP\D\let\nextsp\relax | 1358 | \ifx\PP\D\let\nextsp\relax |
@@ -1695,7 +1494,7 @@ output) for that.)} | |||
1695 | % if we are producing pdf, and we have \pdffontattr, then define cmaps. | 1494 | % if we are producing pdf, and we have \pdffontattr, then define cmaps. |
1696 | % (\pdffontattr was introduced many years ago, but people still run | 1495 | % (\pdffontattr was introduced many years ago, but people still run |
1697 | % older pdftex's; it's easy to conditionalize, so we do.) | 1496 | % older pdftex's; it's easy to conditionalize, so we do.) |
1698 | \ifpdf \ifx\pdffontattr\undefined \else | 1497 | \ifpdf \ifx\pdffontattr\thisisundefined \else |
1699 | \begingroup | 1498 | \begingroup |
1700 | \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. | 1499 | \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. |
1701 | \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap | 1500 | \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap |
@@ -1962,7 +1761,7 @@ end | |||
1962 | % Use cm as the default font prefix. | 1761 | % Use cm as the default font prefix. |
1963 | % To specify the font prefix, you must define \fontprefix | 1762 | % To specify the font prefix, you must define \fontprefix |
1964 | % before you read in texinfo.tex. | 1763 | % before you read in texinfo.tex. |
1965 | \ifx\fontprefix\undefined | 1764 | \ifx\fontprefix\thisisundefined |
1966 | \def\fontprefix{cm} | 1765 | \def\fontprefix{cm} |
1967 | \fi | 1766 | \fi |
1968 | % Support font families that don't use the same naming scheme as CM. | 1767 | % Support font families that don't use the same naming scheme as CM. |
@@ -2105,8 +1904,8 @@ end | |||
2105 | \font\reducedsy=cmsy10 | 1904 | \font\reducedsy=cmsy10 |
2106 | \def\reducedecsize{1000} | 1905 | \def\reducedecsize{1000} |
2107 | 1906 | ||
2108 | % reset the current fonts | 1907 | \textleading = 13.2pt % line spacing for 11pt CM |
2109 | \textfonts | 1908 | \textfonts % reset the current fonts |
2110 | \rm | 1909 | \rm |
2111 | } % end of 11pt text font size definitions | 1910 | } % end of 11pt text font size definitions |
2112 | 1911 | ||
@@ -2236,11 +2035,9 @@ end | |||
2236 | \font\reducedsy=cmsy9 | 2035 | \font\reducedsy=cmsy9 |
2237 | \def\reducedecsize{0900} | 2036 | \def\reducedecsize{0900} |
2238 | 2037 | ||
2239 | % reduce space between paragraphs | 2038 | \divide\parskip by 2 % reduce space between paragraphs |
2240 | \divide\parskip by 2 | 2039 | \textleading = 12pt % line spacing for 10pt CM |
2241 | 2040 | \textfonts % reset the current fonts | |
2242 | % reset the current fonts | ||
2243 | \textfonts | ||
2244 | \rm | 2041 | \rm |
2245 | } % end of 10pt text font size definitions | 2042 | } % end of 10pt text font size definitions |
2246 | 2043 | ||
@@ -2249,12 +2046,13 @@ end | |||
2249 | % @fonttextsize 10 | 2046 | % @fonttextsize 10 |
2250 | % (or 11) to redefine the text font size. pt is assumed. | 2047 | % (or 11) to redefine the text font size. pt is assumed. |
2251 | % | 2048 | % |
2252 | \def\xword{10} | ||
2253 | \def\xiword{11} | 2049 | \def\xiword{11} |
2050 | \def\xword{10} | ||
2051 | \def\xwordpt{10pt} | ||
2254 | % | 2052 | % |
2255 | \parseargdef\fonttextsize{% | 2053 | \parseargdef\fonttextsize{% |
2256 | \def\textsizearg{#1}% | 2054 | \def\textsizearg{#1}% |
2257 | \wlog{doing @fonttextsize \textsizearg}% | 2055 | %\wlog{doing @fonttextsize \textsizearg}% |
2258 | % | 2056 | % |
2259 | % Set \globaldefs so that documents can use this inside @tex, since | 2057 | % Set \globaldefs so that documents can use this inside @tex, since |
2260 | % makeinfo 4.8 does not support it, but we need it nonetheless. | 2058 | % makeinfo 4.8 does not support it, but we need it nonetheless. |
@@ -2308,7 +2106,7 @@ end | |||
2308 | \let\tenttsl=\titlettsl | 2106 | \let\tenttsl=\titlettsl |
2309 | \def\curfontsize{title}% | 2107 | \def\curfontsize{title}% |
2310 | \def\lsize{chap}\def\lllsize{subsec}% | 2108 | \def\lsize{chap}\def\lllsize{subsec}% |
2311 | \resetmathfonts \setleading{25pt}} | 2109 | \resetmathfonts \setleading{27pt}} |
2312 | \def\titlefont#1{{\titlefonts\rmisbold #1}} | 2110 | \def\titlefont#1{{\titlefonts\rmisbold #1}} |
2313 | \def\chapfonts{% | 2111 | \def\chapfonts{% |
2314 | \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl | 2112 | \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl |
@@ -2436,12 +2234,14 @@ end | |||
2436 | 2234 | ||
2437 | % Markup style setup for left and right quotes. | 2235 | % Markup style setup for left and right quotes. |
2438 | \defmarkupstylesetup\markupsetuplq{% | 2236 | \defmarkupstylesetup\markupsetuplq{% |
2439 | \expandafter\let\expandafter \temp \csname markupsetuplq\currentmarkupstyle\endcsname | 2237 | \expandafter\let\expandafter \temp |
2238 | \csname markupsetuplq\currentmarkupstyle\endcsname | ||
2440 | \ifx\temp\relax \markupsetuplqdefault \else \temp \fi | 2239 | \ifx\temp\relax \markupsetuplqdefault \else \temp \fi |
2441 | } | 2240 | } |
2442 | 2241 | ||
2443 | \defmarkupstylesetup\markupsetuprq{% | 2242 | \defmarkupstylesetup\markupsetuprq{% |
2444 | \expandafter\let\expandafter \temp \csname markupsetuprq\currentmarkupstyle\endcsname | 2243 | \expandafter\let\expandafter \temp |
2244 | \csname markupsetuprq\currentmarkupstyle\endcsname | ||
2445 | \ifx\temp\relax \markupsetuprqdefault \else \temp \fi | 2245 | \ifx\temp\relax \markupsetuprqdefault \else \temp \fi |
2446 | } | 2246 | } |
2447 | 2247 | ||
@@ -2460,22 +2260,26 @@ end | |||
2460 | 2260 | ||
2461 | \let\markupsetuplqcode \markupsetcodequoteleft | 2261 | \let\markupsetuplqcode \markupsetcodequoteleft |
2462 | \let\markupsetuprqcode \markupsetcodequoteright | 2262 | \let\markupsetuprqcode \markupsetcodequoteright |
2263 | % | ||
2463 | \let\markupsetuplqexample \markupsetcodequoteleft | 2264 | \let\markupsetuplqexample \markupsetcodequoteleft |
2464 | \let\markupsetuprqexample \markupsetcodequoteright | 2265 | \let\markupsetuprqexample \markupsetcodequoteright |
2266 | % | ||
2267 | \let\markupsetuplqsamp \markupsetcodequoteleft | ||
2268 | \let\markupsetuprqsamp \markupsetcodequoteright | ||
2269 | % | ||
2465 | \let\markupsetuplqverb \markupsetcodequoteleft | 2270 | \let\markupsetuplqverb \markupsetcodequoteleft |
2466 | \let\markupsetuprqverb \markupsetcodequoteright | 2271 | \let\markupsetuprqverb \markupsetcodequoteright |
2272 | % | ||
2467 | \let\markupsetuplqverbatim \markupsetcodequoteleft | 2273 | \let\markupsetuplqverbatim \markupsetcodequoteleft |
2468 | \let\markupsetuprqverbatim \markupsetcodequoteright | 2274 | \let\markupsetuprqverbatim \markupsetcodequoteright |
2469 | 2275 | ||
2470 | \let\markupsetuplqsamp \markupsetnoligaturesquoteleft | ||
2471 | \let\markupsetuplqkbd \markupsetnoligaturesquoteleft | 2276 | \let\markupsetuplqkbd \markupsetnoligaturesquoteleft |
2472 | 2277 | ||
2473 | % Allow an option to not replace quotes with a regular directed right | 2278 | % Allow an option to not use regular directed right quote/apostrophe |
2474 | % quote/apostrophe (char 0x27), but instead use the undirected quote | 2279 | % (char 0x27), but instead the undirected quote from cmtt (char 0x0d). |
2475 | % from cmtt (char 0x0d). The undirected quote is ugly, so don't make it | 2280 | % The undirected quote is ugly, so don't make it the default, but it |
2476 | % the default, but it works for pasting with more pdf viewers (at least | 2281 | % works for pasting with more pdf viewers (at least evince), the |
2477 | % evince), the lilypond developers report. xpdf does work with the | 2282 | % lilypond developers report. xpdf does work with the regular 0x27. |
2478 | % regular 0x27. | ||
2479 | % | 2283 | % |
2480 | \def\codequoteright{% | 2284 | \def\codequoteright{% |
2481 | \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax | 2285 | \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax |
@@ -2499,33 +2303,84 @@ end | |||
2499 | \else \char'22 \fi | 2303 | \else \char'22 \fi |
2500 | } | 2304 | } |
2501 | 2305 | ||
2306 | % Commands to set the quote options. | ||
2307 | % | ||
2308 | \parseargdef\codequoteundirected{% | ||
2309 | \def\temp{#1}% | ||
2310 | \ifx\temp\onword | ||
2311 | \expandafter\let\csname SETtxicodequoteundirected\endcsname | ||
2312 | = t% | ||
2313 | \else\ifx\temp\offword | ||
2314 | \expandafter\let\csname SETtxicodequoteundirected\endcsname | ||
2315 | = \relax | ||
2316 | \else | ||
2317 | \errhelp = \EMsimple | ||
2318 | \errmessage{Unknown @codequoteundirected value `\temp', must be on|off}% | ||
2319 | \fi\fi | ||
2320 | } | ||
2321 | % | ||
2322 | \parseargdef\codequotebacktick{% | ||
2323 | \def\temp{#1}% | ||
2324 | \ifx\temp\onword | ||
2325 | \expandafter\let\csname SETtxicodequotebacktick\endcsname | ||
2326 | = t% | ||
2327 | \else\ifx\temp\offword | ||
2328 | \expandafter\let\csname SETtxicodequotebacktick\endcsname | ||
2329 | = \relax | ||
2330 | \else | ||
2331 | \errhelp = \EMsimple | ||
2332 | \errmessage{Unknown @codequotebacktick value `\temp', must be on|off}% | ||
2333 | \fi\fi | ||
2334 | } | ||
2335 | |||
2502 | % [Knuth] pp. 380,381,391, disable Spanish ligatures ?` and !` of \tt font. | 2336 | % [Knuth] pp. 380,381,391, disable Spanish ligatures ?` and !` of \tt font. |
2503 | \def\noligaturesquoteleft{\relax\lq} | 2337 | \def\noligaturesquoteleft{\relax\lq} |
2504 | 2338 | ||
2505 | % Count depth in font-changes, for error checks | 2339 | % Count depth in font-changes, for error checks |
2506 | \newcount\fontdepth \fontdepth=0 | 2340 | \newcount\fontdepth \fontdepth=0 |
2507 | 2341 | ||
2508 | %% Add scribe-like font environments, plus @l for inline lisp (usually sans | 2342 | % Font commands. |
2509 | %% serif) and @ii for TeX italic | ||
2510 | 2343 | ||
2511 | % \smartitalic{ARG} outputs arg in italics, followed by an italic correction | 2344 | % #1 is the font command (\sl or \it), #2 is the text to slant. |
2512 | % unless the following character is such as not to need one. | 2345 | % If we are in a monospaced environment, however, 1) always use \ttsl, |
2513 | \def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else | 2346 | % and 2) do not add an italic correction. |
2514 | \ptexslash\fi\fi\fi} | 2347 | \def\dosmartslant#1#2{% |
2515 | \def\smartslanted#1{{\ifusingtt\ttsl\sl #1}\futurelet\next\smartitalicx} | 2348 | \ifusingtt |
2516 | \def\smartitalic#1{{\ifusingtt\ttsl\it #1}\futurelet\next\smartitalicx} | 2349 | {{\ttsl #2}\let\next=\relax}% |
2350 | {\def\next{{#1#2}\futurelet\next\smartitaliccorrection}}% | ||
2351 | \next | ||
2352 | } | ||
2353 | \def\smartslanted{\dosmartslant\sl} | ||
2354 | \def\smartitalic{\dosmartslant\it} | ||
2517 | 2355 | ||
2518 | % like \smartslanted except unconditionally uses \ttsl. | 2356 | % Output an italic correction unless \next (presumed to be the following |
2357 | % character) is such as not to need one. | ||
2358 | \def\smartitaliccorrection{% | ||
2359 | \ifx\next,% | ||
2360 | \else\ifx\next-% | ||
2361 | \else\ifx\next.% | ||
2362 | \else\ptexslash | ||
2363 | \fi\fi\fi | ||
2364 | \aftersmartic | ||
2365 | } | ||
2366 | |||
2367 | % like \smartslanted except unconditionally uses \ttsl, and no ic. | ||
2519 | % @var is set to this for defun arguments. | 2368 | % @var is set to this for defun arguments. |
2520 | \def\ttslanted#1{{\ttsl #1}\futurelet\next\smartitalicx} | 2369 | \def\ttslanted#1{{\ttsl #1}} |
2521 | 2370 | ||
2522 | % @cite is like \smartslanted except unconditionally use \sl. We never want | 2371 | % @cite is like \smartslanted except unconditionally use \sl. We never want |
2523 | % ttsl for book titles, do we? | 2372 | % ttsl for book titles, do we? |
2524 | \def\cite#1{{\sl #1}\futurelet\next\smartitalicx} | 2373 | \def\cite#1{{\sl #1}\futurelet\next\smartitaliccorrection} |
2374 | |||
2375 | \def\aftersmartic{} | ||
2376 | \def\var#1{% | ||
2377 | \let\saveaftersmartic = \aftersmartic | ||
2378 | \def\aftersmartic{\null\let\aftersmartic=\saveaftersmartic}% | ||
2379 | \smartslanted{#1}% | ||
2380 | } | ||
2525 | 2381 | ||
2526 | \let\i=\smartitalic | 2382 | \let\i=\smartitalic |
2527 | \let\slanted=\smartslanted | 2383 | \let\slanted=\smartslanted |
2528 | \def\var#1{{\setupmarkupstyle{var}\smartslanted{#1}}} | ||
2529 | \let\dfn=\smartslanted | 2384 | \let\dfn=\smartslanted |
2530 | \let\emph=\smartitalic | 2385 | \let\emph=\smartitalic |
2531 | 2386 | ||
@@ -2621,7 +2476,7 @@ end | |||
2621 | \plainfrenchspacing | 2476 | \plainfrenchspacing |
2622 | #1% | 2477 | #1% |
2623 | }% | 2478 | }% |
2624 | \null | 2479 | \null % reset spacefactor to 1000 |
2625 | } | 2480 | } |
2626 | 2481 | ||
2627 | % We *must* turn on hyphenation at `-' and `_' in @code. | 2482 | % We *must* turn on hyphenation at `-' and `_' in @code. |
@@ -2653,6 +2508,8 @@ end | |||
2653 | } | 2508 | } |
2654 | } | 2509 | } |
2655 | 2510 | ||
2511 | \def\codex #1{\tclose{#1}\endgroup} | ||
2512 | |||
2656 | \def\realdash{-} | 2513 | \def\realdash{-} |
2657 | \def\codedash{-\discretionary{}{}{}} | 2514 | \def\codedash{-\discretionary{}{}{}} |
2658 | \def\codeunder{% | 2515 | \def\codeunder{% |
@@ -2666,7 +2523,6 @@ end | |||
2666 | \discretionary{}{}{}}% | 2523 | \discretionary{}{}{}}% |
2667 | {\_}% | 2524 | {\_}% |
2668 | } | 2525 | } |
2669 | \def\codex #1{\tclose{#1}\endgroup} | ||
2670 | 2526 | ||
2671 | % An additional complication: the above will allow breaks after, e.g., | 2527 | % An additional complication: the above will allow breaks after, e.g., |
2672 | % each of the four underscores in __typeof__. This is undesirable in | 2528 | % each of the four underscores in __typeof__. This is undesirable in |
@@ -2686,63 +2542,18 @@ end | |||
2686 | \allowcodebreaksfalse | 2542 | \allowcodebreaksfalse |
2687 | \else | 2543 | \else |
2688 | \errhelp = \EMsimple | 2544 | \errhelp = \EMsimple |
2689 | \errmessage{Unknown @allowcodebreaks option `\txiarg'}% | 2545 | \errmessage{Unknown @allowcodebreaks option `\txiarg', must be true|false}% |
2690 | \fi\fi | 2546 | \fi\fi |
2691 | } | 2547 | } |
2692 | 2548 | ||
2693 | % @kbd is like @code, except that if the argument is just one @key command, | ||
2694 | % then @kbd has no effect. | ||
2695 | \def\kbd#1{{\setupmarkupstyle{kbd}\def\look{#1}\expandafter\kbdfoo\look??\par}} | ||
2696 | |||
2697 | % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always), | ||
2698 | % `example' (@kbd uses ttsl only inside of @example and friends), | ||
2699 | % or `code' (@kbd uses normal tty font always). | ||
2700 | \parseargdef\kbdinputstyle{% | ||
2701 | \def\txiarg{#1}% | ||
2702 | \ifx\txiarg\worddistinct | ||
2703 | \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}% | ||
2704 | \else\ifx\txiarg\wordexample | ||
2705 | \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}% | ||
2706 | \else\ifx\txiarg\wordcode | ||
2707 | \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}% | ||
2708 | \else | ||
2709 | \errhelp = \EMsimple | ||
2710 | \errmessage{Unknown @kbdinputstyle option `\txiarg'}% | ||
2711 | \fi\fi\fi | ||
2712 | } | ||
2713 | \def\worddistinct{distinct} | ||
2714 | \def\wordexample{example} | ||
2715 | \def\wordcode{code} | ||
2716 | |||
2717 | % Default is `distinct'. | ||
2718 | \kbdinputstyle distinct | ||
2719 | |||
2720 | \def\xkey{\key} | ||
2721 | \def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}% | ||
2722 | \ifx\one\xkey\ifx\threex\three \key{#2}% | ||
2723 | \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi | ||
2724 | \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi} | ||
2725 | |||
2726 | % For @indicateurl, @env, @command quotes seem unnecessary, so use \code. | ||
2727 | \let\indicateurl=\code | ||
2728 | \let\env=\code | ||
2729 | \let\command=\code | ||
2730 | |||
2731 | % @clicksequence{File @click{} Open ...} | ||
2732 | \def\clicksequence#1{\begingroup #1\endgroup} | ||
2733 | |||
2734 | % @clickstyle @arrow (by default) | ||
2735 | \parseargdef\clickstyle{\def\click{#1}} | ||
2736 | \def\click{\arrow} | ||
2737 | |||
2738 | % @uref (abbreviation for `urlref') takes an optional (comma-separated) | 2549 | % @uref (abbreviation for `urlref') takes an optional (comma-separated) |
2739 | % second argument specifying the text to display and an optional third | 2550 | % second argument specifying the text to display and an optional third |
2740 | % arg as text to display instead of (rather than in addition to) the url | 2551 | % arg as text to display instead of (rather than in addition to) the url |
2741 | % itself. First (mandatory) arg is the url. Perhaps eventually put in | 2552 | % itself. First (mandatory) arg is the url. |
2742 | % a hypertex \special here. | 2553 | % (This \urefnobreak definition isn't used now, leaving it for a while |
2743 | % | 2554 | % for comparison.) |
2744 | \def\uref#1{\douref #1,,,\finish} | 2555 | \def\urefnobreak#1{\dourefnobreak #1,,,\finish} |
2745 | \def\douref#1,#2,#3,#4\finish{\begingroup | 2556 | \def\dourefnobreak#1,#2,#3,#4\finish{\begingroup |
2746 | \unsepspaces | 2557 | \unsepspaces |
2747 | \pdfurl{#1}% | 2558 | \pdfurl{#1}% |
2748 | \setbox0 = \hbox{\ignorespaces #3}% | 2559 | \setbox0 = \hbox{\ignorespaces #3}% |
@@ -2763,6 +2574,103 @@ end | |||
2763 | \endlink | 2574 | \endlink |
2764 | \endgroup} | 2575 | \endgroup} |
2765 | 2576 | ||
2577 | % This \urefbreak definition is the active one. | ||
2578 | \def\urefbreak{\begingroup \urefcatcodes \dourefbreak} | ||
2579 | \let\uref=\urefbreak | ||
2580 | \def\dourefbreak#1{\urefbreakfinish #1,,,\finish} | ||
2581 | \def\urefbreakfinish#1,#2,#3,#4\finish{% doesn't work in @example | ||
2582 | \unsepspaces | ||
2583 | \pdfurl{#1}% | ||
2584 | \setbox0 = \hbox{\ignorespaces #3}% | ||
2585 | \ifdim\wd0 > 0pt | ||
2586 | \unhbox0 % third arg given, show only that | ||
2587 | \else | ||
2588 | \setbox0 = \hbox{\ignorespaces #2}% | ||
2589 | \ifdim\wd0 > 0pt | ||
2590 | \ifpdf | ||
2591 | \unhbox0 % PDF: 2nd arg given, show only it | ||
2592 | \else | ||
2593 | \unhbox0\ (\urefcode{#1})% DVI: 2nd arg given, show both it and url | ||
2594 | \fi | ||
2595 | \else | ||
2596 | \urefcode{#1}% only url given, so show it | ||
2597 | \fi | ||
2598 | \fi | ||
2599 | \endlink | ||
2600 | \endgroup} | ||
2601 | |||
2602 | % Allow line breaks around only a few characters (only). | ||
2603 | \def\urefcatcodes{% | ||
2604 | \catcode\ampChar=\active \catcode\dotChar=\active | ||
2605 | \catcode\hashChar=\active \catcode\questChar=\active | ||
2606 | \catcode\slashChar=\active | ||
2607 | } | ||
2608 | { | ||
2609 | \urefcatcodes | ||
2610 | % | ||
2611 | \global\def\urefcode{\begingroup | ||
2612 | \setupmarkupstyle{code}% | ||
2613 | \urefcatcodes | ||
2614 | \let&\urefcodeamp | ||
2615 | \let.\urefcodedot | ||
2616 | \let#\urefcodehash | ||
2617 | \let?\urefcodequest | ||
2618 | \let/\urefcodeslash | ||
2619 | \codex | ||
2620 | } | ||
2621 | % | ||
2622 | % By default, they are just regular characters. | ||
2623 | \global\def&{\normalamp} | ||
2624 | \global\def.{\normaldot} | ||
2625 | \global\def#{\normalhash} | ||
2626 | \global\def?{\normalquest} | ||
2627 | \global\def/{\normalslash} | ||
2628 | } | ||
2629 | |||
2630 | % we put a little stretch before and after the breakable chars, to help | ||
2631 | % line breaking of long url's. The unequal skips make look better in | ||
2632 | % cmtt at least, especially for dots. | ||
2633 | \def\urefprestretch{\urefprebreak \hskip0pt plus.13em } | ||
2634 | \def\urefpoststretch{\urefpostbreak \hskip0pt plus.1em } | ||
2635 | % | ||
2636 | \def\urefcodeamp{\urefprestretch \&\urefpoststretch} | ||
2637 | \def\urefcodedot{\urefprestretch .\urefpoststretch} | ||
2638 | \def\urefcodehash{\urefprestretch \#\urefpoststretch} | ||
2639 | \def\urefcodequest{\urefprestretch ?\urefpoststretch} | ||
2640 | \def\urefcodeslash{\futurelet\next\urefcodeslashfinish} | ||
2641 | { | ||
2642 | \catcode`\/=\active | ||
2643 | \global\def\urefcodeslashfinish{% | ||
2644 | \urefprestretch \slashChar | ||
2645 | % Allow line break only after the final / in a sequence of | ||
2646 | % slashes, to avoid line break between the slashes in http://. | ||
2647 | \ifx\next/\else \urefpoststretch \fi | ||
2648 | } | ||
2649 | } | ||
2650 | |||
2651 | % One more complication: by default we'll break after the special | ||
2652 | % characters, but some people like to break before the special chars, so | ||
2653 | % allow that. Also allow no breaking at all, for manual control. | ||
2654 | % | ||
2655 | \parseargdef\urefbreakstyle{% | ||
2656 | \def\txiarg{#1}% | ||
2657 | \ifx\txiarg\wordnone | ||
2658 | \def\urefprebreak{\nobreak}\def\urefpostbreak{\nobreak} | ||
2659 | \else\ifx\txiarg\wordbefore | ||
2660 | \def\urefprebreak{\allowbreak}\def\urefpostbreak{\nobreak} | ||
2661 | \else\ifx\txiarg\wordafter | ||
2662 | \def\urefprebreak{\nobreak}\def\urefpostbreak{\allowbreak} | ||
2663 | \else | ||
2664 | \errhelp = \EMsimple | ||
2665 | \errmessage{Unknown @urefbreakstyle setting `\txiarg'}% | ||
2666 | \fi\fi\fi | ||
2667 | } | ||
2668 | \def\wordafter{after} | ||
2669 | \def\wordbefore{before} | ||
2670 | \def\wordnone{none} | ||
2671 | |||
2672 | \urefbreakstyle after | ||
2673 | |||
2766 | % @url synonym for @uref, since that's how everyone uses it. | 2674 | % @url synonym for @uref, since that's how everyone uses it. |
2767 | % | 2675 | % |
2768 | \let\url=\uref | 2676 | \let\url=\uref |
@@ -2784,6 +2692,51 @@ end | |||
2784 | \let\email=\uref | 2692 | \let\email=\uref |
2785 | \fi | 2693 | \fi |
2786 | 2694 | ||
2695 | % @kbd is like @code, except that if the argument is just one @key command, | ||
2696 | % then @kbd has no effect. | ||
2697 | \def\kbd#1{{\setupmarkupstyle{kbd}\def\look{#1}\expandafter\kbdfoo\look??\par}} | ||
2698 | |||
2699 | % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always), | ||
2700 | % `example' (@kbd uses ttsl only inside of @example and friends), | ||
2701 | % or `code' (@kbd uses normal tty font always). | ||
2702 | \parseargdef\kbdinputstyle{% | ||
2703 | \def\txiarg{#1}% | ||
2704 | \ifx\txiarg\worddistinct | ||
2705 | \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}% | ||
2706 | \else\ifx\txiarg\wordexample | ||
2707 | \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}% | ||
2708 | \else\ifx\txiarg\wordcode | ||
2709 | \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}% | ||
2710 | \else | ||
2711 | \errhelp = \EMsimple | ||
2712 | \errmessage{Unknown @kbdinputstyle setting `\txiarg'}% | ||
2713 | \fi\fi\fi | ||
2714 | } | ||
2715 | \def\worddistinct{distinct} | ||
2716 | \def\wordexample{example} | ||
2717 | \def\wordcode{code} | ||
2718 | |||
2719 | % Default is `distinct'. | ||
2720 | \kbdinputstyle distinct | ||
2721 | |||
2722 | \def\xkey{\key} | ||
2723 | \def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}% | ||
2724 | \ifx\one\xkey\ifx\threex\three \key{#2}% | ||
2725 | \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi | ||
2726 | \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi} | ||
2727 | |||
2728 | % For @indicateurl, @env, @command quotes seem unnecessary, so use \code. | ||
2729 | \let\indicateurl=\code | ||
2730 | \let\env=\code | ||
2731 | \let\command=\code | ||
2732 | |||
2733 | % @clicksequence{File @click{} Open ...} | ||
2734 | \def\clicksequence#1{\begingroup #1\endgroup} | ||
2735 | |||
2736 | % @clickstyle @arrow (by default) | ||
2737 | \parseargdef\clickstyle{\def\click{#1}} | ||
2738 | \def\click{\arrow} | ||
2739 | |||
2787 | % Typeset a dimension, e.g., `in' or `pt'. The only reason for the | 2740 | % Typeset a dimension, e.g., `in' or `pt'. The only reason for the |
2788 | % argument is to make the input look right: @dmn{pt} instead of @dmn{}pt. | 2741 | % argument is to make the input look right: @dmn{pt} instead of @dmn{}pt. |
2789 | % | 2742 | % |
@@ -2805,6 +2758,7 @@ end | |||
2805 | \ifx\temp\empty \else | 2758 | \ifx\temp\empty \else |
2806 | \space ({\unsepspaces \ignorespaces \temp \unskip})% | 2759 | \space ({\unsepspaces \ignorespaces \temp \unskip})% |
2807 | \fi | 2760 | \fi |
2761 | \null % reset \spacefactor=1000 | ||
2808 | } | 2762 | } |
2809 | 2763 | ||
2810 | % @abbr for "Comput. J." and the like. | 2764 | % @abbr for "Comput. J." and the like. |
@@ -2817,10 +2771,219 @@ end | |||
2817 | \ifx\temp\empty \else | 2771 | \ifx\temp\empty \else |
2818 | \space ({\unsepspaces \ignorespaces \temp \unskip})% | 2772 | \space ({\unsepspaces \ignorespaces \temp \unskip})% |
2819 | \fi | 2773 | \fi |
2774 | \null % reset \spacefactor=1000 | ||
2775 | } | ||
2776 | |||
2777 | % @asis just yields its argument. Used with @table, for example. | ||
2778 | % | ||
2779 | \def\asis#1{#1} | ||
2780 | |||
2781 | % @math outputs its argument in math mode. | ||
2782 | % | ||
2783 | % One complication: _ usually means subscripts, but it could also mean | ||
2784 | % an actual _ character, as in @math{@var{some_variable} + 1}. So make | ||
2785 | % _ active, and distinguish by seeing if the current family is \slfam, | ||
2786 | % which is what @var uses. | ||
2787 | { | ||
2788 | \catcode`\_ = \active | ||
2789 | \gdef\mathunderscore{% | ||
2790 | \catcode`\_=\active | ||
2791 | \def_{\ifnum\fam=\slfam \_\else\sb\fi}% | ||
2792 | } | ||
2793 | } | ||
2794 | % Another complication: we want \\ (and @\) to output a math (or tt) \. | ||
2795 | % FYI, plain.tex uses \\ as a temporary control sequence (for no | ||
2796 | % particular reason), but this is not advertised and we don't care. | ||
2797 | % | ||
2798 | % The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\. | ||
2799 | \def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi} | ||
2800 | % | ||
2801 | \def\math{% | ||
2802 | \tex | ||
2803 | \mathunderscore | ||
2804 | \let\\ = \mathbackslash | ||
2805 | \mathactive | ||
2806 | % make the texinfo accent commands work in math mode | ||
2807 | \let\"=\ddot | ||
2808 | \let\'=\acute | ||
2809 | \let\==\bar | ||
2810 | \let\^=\hat | ||
2811 | \let\`=\grave | ||
2812 | \let\u=\breve | ||
2813 | \let\v=\check | ||
2814 | \let\~=\tilde | ||
2815 | \let\dotaccent=\dot | ||
2816 | $\finishmath | ||
2817 | } | ||
2818 | \def\finishmath#1{#1$\endgroup} % Close the group opened by \tex. | ||
2819 | |||
2820 | % Some active characters (such as <) are spaced differently in math. | ||
2821 | % We have to reset their definitions in case the @math was an argument | ||
2822 | % to a command which sets the catcodes (such as @item or @section). | ||
2823 | % | ||
2824 | { | ||
2825 | \catcode`^ = \active | ||
2826 | \catcode`< = \active | ||
2827 | \catcode`> = \active | ||
2828 | \catcode`+ = \active | ||
2829 | \catcode`' = \active | ||
2830 | \gdef\mathactive{% | ||
2831 | \let^ = \ptexhat | ||
2832 | \let< = \ptexless | ||
2833 | \let> = \ptexgtr | ||
2834 | \let+ = \ptexplus | ||
2835 | \let' = \ptexquoteright | ||
2836 | } | ||
2837 | } | ||
2838 | |||
2839 | % @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}. | ||
2840 | % Ignore unless FMTNAME == tex; then it is like @iftex and @tex, | ||
2841 | % except specified as a normal braced arg, so no newlines to worry about. | ||
2842 | % | ||
2843 | \def\outfmtnametex{tex} | ||
2844 | % | ||
2845 | \def\inlinefmt#1{\doinlinefmt #1,\finish} | ||
2846 | \def\doinlinefmt#1,#2,\finish{% | ||
2847 | \def\inlinefmtname{#1}% | ||
2848 | \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\fi | ||
2849 | } | ||
2850 | % For raw, must switch into @tex before parsing the argument, to avoid | ||
2851 | % setting catcodes prematurely. Doing it this way means that, for | ||
2852 | % example, @inlineraw{html, foo{bar} gets a parse error instead of being | ||
2853 | % ignored. But this isn't important because if people want a literal | ||
2854 | % *right* brace they would have to use a command anyway, so they may as | ||
2855 | % well use a command to get a left brace too. We could re-use the | ||
2856 | % delimiter character idea from \verb, but it seems like overkill. | ||
2857 | % | ||
2858 | \def\inlineraw{\tex \doinlineraw} | ||
2859 | \def\doinlineraw#1{\doinlinerawtwo #1,\finish} | ||
2860 | \def\doinlinerawtwo#1,#2,\finish{% | ||
2861 | \def\inlinerawname{#1}% | ||
2862 | \ifx\inlinerawname\outfmtnametex \ignorespaces #2\fi | ||
2863 | \endgroup % close group opened by \tex. | ||
2820 | } | 2864 | } |
2821 | 2865 | ||
2822 | 2866 | ||
2823 | \message{glyphs,} | 2867 | \message{glyphs,} |
2868 | % and logos. | ||
2869 | |||
2870 | % @@ prints an @, as does @atchar{}. | ||
2871 | \def\@{\char64 } | ||
2872 | \let\atchar=\@ | ||
2873 | |||
2874 | % @{ @} @lbracechar{} @rbracechar{} all generate brace characters. | ||
2875 | % Unless we're in typewriter, use \ecfont because the CM text fonts do | ||
2876 | % not have braces, and we don't want to switch into math. | ||
2877 | \def\mylbrace{{\ifmonospace\else\ecfont\fi \char123}} | ||
2878 | \def\myrbrace{{\ifmonospace\else\ecfont\fi \char125}} | ||
2879 | \let\{=\mylbrace \let\lbracechar=\{ | ||
2880 | \let\}=\myrbrace \let\rbracechar=\} | ||
2881 | \begingroup | ||
2882 | % Definitions to produce \{ and \} commands for indices, | ||
2883 | % and @{ and @} for the aux/toc files. | ||
2884 | \catcode`\{ = \other \catcode`\} = \other | ||
2885 | \catcode`\[ = 1 \catcode`\] = 2 | ||
2886 | \catcode`\! = 0 \catcode`\\ = \other | ||
2887 | !gdef!lbracecmd[\{]% | ||
2888 | !gdef!rbracecmd[\}]% | ||
2889 | !gdef!lbraceatcmd[@{]% | ||
2890 | !gdef!rbraceatcmd[@}]% | ||
2891 | !endgroup | ||
2892 | |||
2893 | % @comma{} to avoid , parsing problems. | ||
2894 | \let\comma = , | ||
2895 | |||
2896 | % Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent | ||
2897 | % Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H. | ||
2898 | \let\, = \ptexc | ||
2899 | \let\dotaccent = \ptexdot | ||
2900 | \def\ringaccent#1{{\accent23 #1}} | ||
2901 | \let\tieaccent = \ptext | ||
2902 | \let\ubaraccent = \ptexb | ||
2903 | \let\udotaccent = \d | ||
2904 | |||
2905 | % Other special characters: @questiondown @exclamdown @ordf @ordm | ||
2906 | % Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss. | ||
2907 | \def\questiondown{?`} | ||
2908 | \def\exclamdown{!`} | ||
2909 | \def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}} | ||
2910 | \def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}} | ||
2911 | |||
2912 | % Dotless i and dotless j, used for accents. | ||
2913 | \def\imacro{i} | ||
2914 | \def\jmacro{j} | ||
2915 | \def\dotless#1{% | ||
2916 | \def\temp{#1}% | ||
2917 | \ifx\temp\imacro \ifmmode\imath \else\ptexi \fi | ||
2918 | \else\ifx\temp\jmacro \ifmmode\jmath \else\j \fi | ||
2919 | \else \errmessage{@dotless can be used only with i or j}% | ||
2920 | \fi\fi | ||
2921 | } | ||
2922 | |||
2923 | % The \TeX{} logo, as in plain, but resetting the spacing so that a | ||
2924 | % period following counts as ending a sentence. (Idea found in latex.) | ||
2925 | % | ||
2926 | \edef\TeX{\TeX \spacefactor=1000 } | ||
2927 | |||
2928 | % @LaTeX{} logo. Not quite the same results as the definition in | ||
2929 | % latex.ltx, since we use a different font for the raised A; it's most | ||
2930 | % convenient for us to use an explicitly smaller font, rather than using | ||
2931 | % the \scriptstyle font (since we don't reset \scriptstyle and | ||
2932 | % \scriptscriptstyle). | ||
2933 | % | ||
2934 | \def\LaTeX{% | ||
2935 | L\kern-.36em | ||
2936 | {\setbox0=\hbox{T}% | ||
2937 | \vbox to \ht0{\hbox{% | ||
2938 | \ifx\textnominalsize\xwordpt | ||
2939 | % for 10pt running text, \lllsize (8pt) is too small for the A in LaTeX. | ||
2940 | % Revert to plain's \scriptsize, which is 7pt. | ||
2941 | \count255=\the\fam $\fam\count255 \scriptstyle A$% | ||
2942 | \else | ||
2943 | % For 11pt, we can use our lllsize. | ||
2944 | \selectfonts\lllsize A% | ||
2945 | \fi | ||
2946 | }% | ||
2947 | \vss | ||
2948 | }}% | ||
2949 | \kern-.15em | ||
2950 | \TeX | ||
2951 | } | ||
2952 | |||
2953 | % Some math mode symbols. | ||
2954 | \def\bullet{$\ptexbullet$} | ||
2955 | \def\geq{\ifmmode \ge\else $\ge$\fi} | ||
2956 | \def\leq{\ifmmode \le\else $\le$\fi} | ||
2957 | \def\minus{\ifmmode -\else $-$\fi} | ||
2958 | |||
2959 | % @dots{} outputs an ellipsis using the current font. | ||
2960 | % We do .5em per period so that it has the same spacing in the cm | ||
2961 | % typewriter fonts as three actual period characters; on the other hand, | ||
2962 | % in other typewriter fonts three periods are wider than 1.5em. So do | ||
2963 | % whichever is larger. | ||
2964 | % | ||
2965 | \def\dots{% | ||
2966 | \leavevmode | ||
2967 | \setbox0=\hbox{...}% get width of three periods | ||
2968 | \ifdim\wd0 > 1.5em | ||
2969 | \dimen0 = \wd0 | ||
2970 | \else | ||
2971 | \dimen0 = 1.5em | ||
2972 | \fi | ||
2973 | \hbox to \dimen0{% | ||
2974 | \hskip 0pt plus.25fil | ||
2975 | .\hskip 0pt plus1fil | ||
2976 | .\hskip 0pt plus1fil | ||
2977 | .\hskip 0pt plus.5fil | ||
2978 | }% | ||
2979 | } | ||
2980 | |||
2981 | % @enddots{} is an end-of-sentence ellipsis. | ||
2982 | % | ||
2983 | \def\enddots{% | ||
2984 | \dots | ||
2985 | \spacefactor=\endofsentencespacefactor | ||
2986 | } | ||
2824 | 2987 | ||
2825 | % @point{}, @result{}, @expansion{}, @print{}, @equiv{}. | 2988 | % @point{}, @result{}, @expansion{}, @print{}, @equiv{}. |
2826 | % | 2989 | % |
@@ -2842,7 +3005,7 @@ end | |||
2842 | {\tentt \global\dimen0 = 3em}% Width of the box. | 3005 | {\tentt \global\dimen0 = 3em}% Width of the box. |
2843 | \dimen2 = .55pt % Thickness of rules | 3006 | \dimen2 = .55pt % Thickness of rules |
2844 | % The text. (`r' is open on the right, `e' somewhat less so on the left.) | 3007 | % The text. (`r' is open on the right, `e' somewhat less so on the left.) |
2845 | \setbox0 = \hbox{\kern-.75pt \reducedsf error\kern-1.5pt} | 3008 | \setbox0 = \hbox{\kern-.75pt \reducedsf \putworderror\kern-1.5pt} |
2846 | % | 3009 | % |
2847 | \setbox\errorbox=\hbox to \dimen0{\hfil | 3010 | \setbox\errorbox=\hbox to \dimen0{\hfil |
2848 | \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right. | 3011 | \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right. |
@@ -2991,7 +3154,7 @@ end | |||
2991 | % Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38 | 3154 | % Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38 |
2992 | % so we'll define it if necessary. | 3155 | % so we'll define it if necessary. |
2993 | % | 3156 | % |
2994 | \ifx\Orb\undefined | 3157 | \ifx\Orb\thisisundefined |
2995 | \def\Orb{\mathhexbox20D} | 3158 | \def\Orb{\mathhexbox20D} |
2996 | \fi | 3159 | \fi |
2997 | 3160 | ||
@@ -3019,8 +3182,9 @@ end | |||
3019 | \newif\ifsetshortcontentsaftertitlepage | 3182 | \newif\ifsetshortcontentsaftertitlepage |
3020 | \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue | 3183 | \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue |
3021 | 3184 | ||
3022 | \parseargdef\shorttitlepage{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}% | 3185 | \parseargdef\shorttitlepage{% |
3023 | \endgroup\page\hbox{}\page} | 3186 | \begingroup \hbox{}\vskip 1.5in \chaprm \centerline{#1}% |
3187 | \endgroup\page\hbox{}\page} | ||
3024 | 3188 | ||
3025 | \envdef\titlepage{% | 3189 | \envdef\titlepage{% |
3026 | % Open one extra group, as we want to close it in the middle of \Etitlepage. | 3190 | % Open one extra group, as we want to close it in the middle of \Etitlepage. |
@@ -3080,7 +3244,7 @@ end | |||
3080 | \finishedtitlepagetrue | 3244 | \finishedtitlepagetrue |
3081 | } | 3245 | } |
3082 | 3246 | ||
3083 | %%% Macros to be used within @titlepage: | 3247 | % Macros to be used within @titlepage: |
3084 | 3248 | ||
3085 | \let\subtitlerm=\tenrm | 3249 | \let\subtitlerm=\tenrm |
3086 | \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines} | 3250 | \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines} |
@@ -3113,7 +3277,7 @@ end | |||
3113 | } | 3277 | } |
3114 | 3278 | ||
3115 | 3279 | ||
3116 | %%% Set up page headings and footings. | 3280 | % Set up page headings and footings. |
3117 | 3281 | ||
3118 | \let\thispage=\folio | 3282 | \let\thispage=\folio |
3119 | 3283 | ||
@@ -3207,10 +3371,14 @@ end | |||
3207 | 3371 | ||
3208 | \def\headings #1 {\csname HEADINGS#1\endcsname} | 3372 | \def\headings #1 {\csname HEADINGS#1\endcsname} |
3209 | 3373 | ||
3210 | \def\HEADINGSoff{% | 3374 | \def\headingsoff{% non-global headings elimination |
3211 | \global\evenheadline={\hfil} \global\evenfootline={\hfil} | 3375 | \evenheadline={\hfil}\evenfootline={\hfil}% |
3212 | \global\oddheadline={\hfil} \global\oddfootline={\hfil}} | 3376 | \oddheadline={\hfil}\oddfootline={\hfil}% |
3213 | \HEADINGSoff | 3377 | } |
3378 | |||
3379 | \def\HEADINGSoff{{\globaldefs=1 \headingsoff}} % global setting | ||
3380 | \HEADINGSoff % it's the default | ||
3381 | |||
3214 | % When we turn headings on, set the page number to 1. | 3382 | % When we turn headings on, set the page number to 1. |
3215 | % For double-sided printing, put current file name in lower left corner, | 3383 | % For double-sided printing, put current file name in lower left corner, |
3216 | % chapter name on inside top of right hand pages, document | 3384 | % chapter name on inside top of right hand pages, document |
@@ -3261,7 +3429,7 @@ end | |||
3261 | % This produces Day Month Year style of output. | 3429 | % This produces Day Month Year style of output. |
3262 | % Only define if not already defined, in case a txi-??.tex file has set | 3430 | % Only define if not already defined, in case a txi-??.tex file has set |
3263 | % up a different format (e.g., txi-cs.tex does this). | 3431 | % up a different format (e.g., txi-cs.tex does this). |
3264 | \ifx\today\undefined | 3432 | \ifx\today\thisisundefined |
3265 | \def\today{% | 3433 | \def\today{% |
3266 | \number\day\space | 3434 | \number\day\space |
3267 | \ifcase\month | 3435 | \ifcase\month |
@@ -3322,7 +3490,7 @@ end | |||
3322 | \begingroup | 3490 | \begingroup |
3323 | \advance\leftskip by-\tableindent | 3491 | \advance\leftskip by-\tableindent |
3324 | \advance\hsize by\tableindent | 3492 | \advance\hsize by\tableindent |
3325 | \advance\rightskip by0pt plus1fil | 3493 | \advance\rightskip by0pt plus1fil\relax |
3326 | \leavevmode\unhbox0\par | 3494 | \leavevmode\unhbox0\par |
3327 | \endgroup | 3495 | \endgroup |
3328 | % | 3496 | % |
@@ -3808,18 +3976,18 @@ end | |||
3808 | \setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip | 3976 | \setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip |
3809 | \global\advance\multitablelinespace by-\ht0 | 3977 | \global\advance\multitablelinespace by-\ht0 |
3810 | \fi | 3978 | \fi |
3811 | %% Test to see if parskip is larger than space between lines of | 3979 | % Test to see if parskip is larger than space between lines of |
3812 | %% table. If not, do nothing. | 3980 | % table. If not, do nothing. |
3813 | %% If so, set to same dimension as multitablelinespace. | 3981 | % If so, set to same dimension as multitablelinespace. |
3814 | \ifdim\multitableparskip>\multitablelinespace | 3982 | \ifdim\multitableparskip>\multitablelinespace |
3815 | \global\multitableparskip=\multitablelinespace | 3983 | \global\multitableparskip=\multitablelinespace |
3816 | \global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller | 3984 | \global\advance\multitableparskip-7pt % to keep parskip somewhat smaller |
3817 | %% than skip between lines in the table. | 3985 | % than skip between lines in the table. |
3818 | \fi% | 3986 | \fi% |
3819 | \ifdim\multitableparskip=0pt | 3987 | \ifdim\multitableparskip=0pt |
3820 | \global\multitableparskip=\multitablelinespace | 3988 | \global\multitableparskip=\multitablelinespace |
3821 | \global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller | 3989 | \global\advance\multitableparskip-7pt % to keep parskip somewhat smaller |
3822 | %% than skip between lines in the table. | 3990 | % than skip between lines in the table. |
3823 | \fi} | 3991 | \fi} |
3824 | 3992 | ||
3825 | 3993 | ||
@@ -4134,11 +4302,14 @@ end | |||
4134 | \def\@{@}% change to @@ when we switch to @ as escape char in index files. | 4302 | \def\@{@}% change to @@ when we switch to @ as escape char in index files. |
4135 | \def\ {\realbackslash\space }% | 4303 | \def\ {\realbackslash\space }% |
4136 | % | 4304 | % |
4137 | % Need these in case \tex is in effect and \{ is a \delimiter again. | 4305 | % Need these unexpandable (because we define \tt as a dummy) |
4138 | % But can't use \lbracecmd and \rbracecmd because texindex assumes | 4306 | % definitions when @{ or @} appear in index entry text. Also, more |
4139 | % braces and backslashes are used only as delimiters. | 4307 | % complicated, when \tex is in effect and \{ is a \delimiter again. |
4140 | \let\{ = \mylbrace | 4308 | % We can't use \lbracecmd and \rbracecmd because texindex assumes |
4141 | \let\} = \myrbrace | 4309 | % braces and backslashes are used only as delimiters. Perhaps we |
4310 | % should define @lbrace and @rbrace commands a la @comma. | ||
4311 | \def\{{{\tt\char123}}% | ||
4312 | \def\}{{\tt\char125}}% | ||
4142 | % | 4313 | % |
4143 | % I don't entirely understand this, but when an index entry is | 4314 | % I don't entirely understand this, but when an index entry is |
4144 | % generated from a macro call, the \endinput which \scanmacro inserts | 4315 | % generated from a macro call, the \endinput which \scanmacro inserts |
@@ -4191,7 +4362,7 @@ end | |||
4191 | \def\commondummies{% | 4362 | \def\commondummies{% |
4192 | % | 4363 | % |
4193 | % \definedummyword defines \#1 as \string\#1\space, thus effectively | 4364 | % \definedummyword defines \#1 as \string\#1\space, thus effectively |
4194 | % preventing its expansion. This is used only for control% words, | 4365 | % preventing its expansion. This is used only for control words, |
4195 | % not control letters, because the \space would be incorrect for | 4366 | % not control letters, because the \space would be incorrect for |
4196 | % control characters, but is needed to separate the control word | 4367 | % control characters, but is needed to separate the control word |
4197 | % from whatever follows. | 4368 | % from whatever follows. |
@@ -4210,6 +4381,7 @@ end | |||
4210 | \commondummiesnofonts | 4381 | \commondummiesnofonts |
4211 | % | 4382 | % |
4212 | \definedummyletter\_% | 4383 | \definedummyletter\_% |
4384 | \definedummyletter\-% | ||
4213 | % | 4385 | % |
4214 | % Non-English letters. | 4386 | % Non-English letters. |
4215 | \definedummyword\AA | 4387 | \definedummyword\AA |
@@ -4246,20 +4418,24 @@ end | |||
4246 | \definedummyword\TeX | 4418 | \definedummyword\TeX |
4247 | % | 4419 | % |
4248 | % Assorted special characters. | 4420 | % Assorted special characters. |
4421 | \definedummyword\arrow | ||
4249 | \definedummyword\bullet | 4422 | \definedummyword\bullet |
4250 | \definedummyword\comma | 4423 | \definedummyword\comma |
4251 | \definedummyword\copyright | 4424 | \definedummyword\copyright |
4252 | \definedummyword\registeredsymbol | 4425 | \definedummyword\registeredsymbol |
4253 | \definedummyword\dots | 4426 | \definedummyword\dots |
4254 | \definedummyword\enddots | 4427 | \definedummyword\enddots |
4428 | \definedummyword\entrybreak | ||
4255 | \definedummyword\equiv | 4429 | \definedummyword\equiv |
4256 | \definedummyword\error | 4430 | \definedummyword\error |
4257 | \definedummyword\euro | 4431 | \definedummyword\euro |
4432 | \definedummyword\expansion | ||
4433 | \definedummyword\geq | ||
4258 | \definedummyword\guillemetleft | 4434 | \definedummyword\guillemetleft |
4259 | \definedummyword\guillemetright | 4435 | \definedummyword\guillemetright |
4260 | \definedummyword\guilsinglleft | 4436 | \definedummyword\guilsinglleft |
4261 | \definedummyword\guilsinglright | 4437 | \definedummyword\guilsinglright |
4262 | \definedummyword\expansion | 4438 | \definedummyword\leq |
4263 | \definedummyword\minus | 4439 | \definedummyword\minus |
4264 | \definedummyword\ogonek | 4440 | \definedummyword\ogonek |
4265 | \definedummyword\pounds | 4441 | \definedummyword\pounds |
@@ -4316,19 +4492,24 @@ end | |||
4316 | \definedummyword\b | 4492 | \definedummyword\b |
4317 | \definedummyword\i | 4493 | \definedummyword\i |
4318 | \definedummyword\r | 4494 | \definedummyword\r |
4495 | \definedummyword\sansserif | ||
4319 | \definedummyword\sc | 4496 | \definedummyword\sc |
4497 | \definedummyword\slanted | ||
4320 | \definedummyword\t | 4498 | \definedummyword\t |
4321 | % | 4499 | % |
4322 | % Commands that take arguments. | 4500 | % Commands that take arguments. |
4323 | \definedummyword\acronym | 4501 | \definedummyword\acronym |
4502 | \definedummyword\anchor | ||
4324 | \definedummyword\cite | 4503 | \definedummyword\cite |
4325 | \definedummyword\code | 4504 | \definedummyword\code |
4326 | \definedummyword\command | 4505 | \definedummyword\command |
4327 | \definedummyword\dfn | 4506 | \definedummyword\dfn |
4507 | \definedummyword\dmn | ||
4328 | \definedummyword\email | 4508 | \definedummyword\email |
4329 | \definedummyword\emph | 4509 | \definedummyword\emph |
4330 | \definedummyword\env | 4510 | \definedummyword\env |
4331 | \definedummyword\file | 4511 | \definedummyword\file |
4512 | \definedummyword\indicateurl | ||
4332 | \definedummyword\kbd | 4513 | \definedummyword\kbd |
4333 | \definedummyword\key | 4514 | \definedummyword\key |
4334 | \definedummyword\math | 4515 | \definedummyword\math |
@@ -4356,7 +4537,7 @@ end | |||
4356 | \def\definedummyaccent##1{\let##1\asis}% | 4537 | \def\definedummyaccent##1{\let##1\asis}% |
4357 | % We can just ignore other control letters. | 4538 | % We can just ignore other control letters. |
4358 | \def\definedummyletter##1{\let##1\empty}% | 4539 | \def\definedummyletter##1{\let##1\empty}% |
4359 | % Hopefully, all control words can become @asis. | 4540 | % All control words become @asis by default; overrides below. |
4360 | \let\definedummyword\definedummyaccent | 4541 | \let\definedummyword\definedummyaccent |
4361 | % | 4542 | % |
4362 | \commondummiesnofonts | 4543 | \commondummiesnofonts |
@@ -4368,8 +4549,14 @@ end | |||
4368 | % | 4549 | % |
4369 | \def\ { }% | 4550 | \def\ { }% |
4370 | \def\@{@}% | 4551 | \def\@{@}% |
4371 | % how to handle braces? | ||
4372 | \def\_{\normalunderscore}% | 4552 | \def\_{\normalunderscore}% |
4553 | \def\-{}% @- shouldn't affect sorting | ||
4554 | % | ||
4555 | % Unfortunately, texindex is not prepared to handle braces in the | ||
4556 | % content at all. So for index sorting, we map @{ and @} to strings | ||
4557 | % starting with |, since that ASCII character is between ASCII { and }. | ||
4558 | \def\{{|a}% | ||
4559 | \def\}{|b}% | ||
4373 | % | 4560 | % |
4374 | % Non-English letters. | 4561 | % Non-English letters. |
4375 | \def\AA{AA}% | 4562 | \def\AA{AA}% |
@@ -4397,6 +4584,7 @@ end | |||
4397 | % | 4584 | % |
4398 | % Assorted special characters. | 4585 | % Assorted special characters. |
4399 | % (The following {} will end up in the sort string, but that's ok.) | 4586 | % (The following {} will end up in the sort string, but that's ok.) |
4587 | \def\arrow{->}% | ||
4400 | \def\bullet{bullet}% | 4588 | \def\bullet{bullet}% |
4401 | \def\comma{,}% | 4589 | \def\comma{,}% |
4402 | \def\copyright{copyright}% | 4590 | \def\copyright{copyright}% |
@@ -4406,10 +4594,12 @@ end | |||
4406 | \def\error{error}% | 4594 | \def\error{error}% |
4407 | \def\euro{euro}% | 4595 | \def\euro{euro}% |
4408 | \def\expansion{==>}% | 4596 | \def\expansion{==>}% |
4597 | \def\geq{>=}% | ||
4409 | \def\guillemetleft{<<}% | 4598 | \def\guillemetleft{<<}% |
4410 | \def\guillemetright{>>}% | 4599 | \def\guillemetright{>>}% |
4411 | \def\guilsinglleft{<}% | 4600 | \def\guilsinglleft{<}% |
4412 | \def\guilsinglright{>}% | 4601 | \def\guilsinglright{>}% |
4602 | \def\leq{<=}% | ||
4413 | \def\minus{-}% | 4603 | \def\minus{-}% |
4414 | \def\point{.}% | 4604 | \def\point{.}% |
4415 | \def\pounds{pounds}% | 4605 | \def\pounds{pounds}% |
@@ -4424,6 +4614,9 @@ end | |||
4424 | \def\result{=>}% | 4614 | \def\result{=>}% |
4425 | \def\textdegree{o}% | 4615 | \def\textdegree{o}% |
4426 | % | 4616 | % |
4617 | \expandafter\ifx\csname SETtxiindexlquoteignore\endcsname\relax | ||
4618 | \else \indexlquoteignore \fi | ||
4619 | % | ||
4427 | % We need to get rid of all macros, leaving only the arguments (if present). | 4620 | % We need to get rid of all macros, leaving only the arguments (if present). |
4428 | % Of course this is not nearly correct, but it is the best we can do for now. | 4621 | % Of course this is not nearly correct, but it is the best we can do for now. |
4429 | % makeinfo does not expand macros in the argument to @deffn, which ends up | 4622 | % makeinfo does not expand macros in the argument to @deffn, which ends up |
@@ -4437,6 +4630,11 @@ end | |||
4437 | \macrolist | 4630 | \macrolist |
4438 | } | 4631 | } |
4439 | 4632 | ||
4633 | % Undocumented (for FSFS 2nd ed.): @set txiindexlquoteignore makes us | ||
4634 | % ignore left quotes in the sort term. | ||
4635 | {\catcode`\`=\active | ||
4636 | \gdef\indexlquoteignore{\let`=\empty}} | ||
4637 | |||
4440 | \let\indexbackslash=0 %overridden during \printindex. | 4638 | \let\indexbackslash=0 %overridden during \printindex. |
4441 | \let\SETmarginindex=\relax % put index entries in margin (undocumented)? | 4639 | \let\SETmarginindex=\relax % put index entries in margin (undocumented)? |
4442 | 4640 | ||
@@ -4694,7 +4892,6 @@ end | |||
4694 | % But this freezes the catcodes in the argument, and can cause problems to | 4892 | % But this freezes the catcodes in the argument, and can cause problems to |
4695 | % @code, which sets - active. This problem was fixed by a kludge--- | 4893 | % @code, which sets - active. This problem was fixed by a kludge--- |
4696 | % ``-'' was active throughout whole index, but this isn't really right. | 4894 | % ``-'' was active throughout whole index, but this isn't really right. |
4697 | % | ||
4698 | % The right solution is to prevent \entry from swallowing the whole text. | 4895 | % The right solution is to prevent \entry from swallowing the whole text. |
4699 | % --kasal, 21nov03 | 4896 | % --kasal, 21nov03 |
4700 | \def\entry{% | 4897 | \def\entry{% |
@@ -4731,10 +4928,17 @@ end | |||
4731 | % columns. | 4928 | % columns. |
4732 | \vskip 0pt plus1pt | 4929 | \vskip 0pt plus1pt |
4733 | % | 4930 | % |
4931 | % When reading the text of entry, convert explicit line breaks | ||
4932 | % from @* into spaces. The user might give these in long section | ||
4933 | % titles, for instance. | ||
4934 | \def\*{\unskip\space\ignorespaces}% | ||
4935 | \def\entrybreak{\hfil\break}% | ||
4936 | % | ||
4734 | % Swallow the left brace of the text (first parameter): | 4937 | % Swallow the left brace of the text (first parameter): |
4735 | \afterassignment\doentry | 4938 | \afterassignment\doentry |
4736 | \let\temp = | 4939 | \let\temp = |
4737 | } | 4940 | } |
4941 | \def\entrybreak{\unskip\space\ignorespaces}% | ||
4738 | \def\doentry{% | 4942 | \def\doentry{% |
4739 | \bgroup % Instead of the swallowed brace. | 4943 | \bgroup % Instead of the swallowed brace. |
4740 | \noindent | 4944 | \noindent |
@@ -4967,7 +5171,22 @@ end | |||
4967 | \message{sectioning,} | 5171 | \message{sectioning,} |
4968 | % Chapters, sections, etc. | 5172 | % Chapters, sections, etc. |
4969 | 5173 | ||
4970 | % \unnumberedno is an oxymoron, of course. But we count the unnumbered | 5174 | % Let's start with @part. |
5175 | \outer\parseargdef\part{\partzzz{#1}} | ||
5176 | \def\partzzz#1{% | ||
5177 | \chapoddpage | ||
5178 | \null | ||
5179 | \vskip.3\vsize % move it down on the page a bit | ||
5180 | \begingroup | ||
5181 | \noindent \titlefonts\rmisbold #1\par % the text | ||
5182 | \let\lastnode=\empty % no node to associate with | ||
5183 | \writetocentry{part}{#1}{}% but put it in the toc | ||
5184 | \headingsoff % no headline or footline on the part page | ||
5185 | \chapoddpage | ||
5186 | \endgroup | ||
5187 | } | ||
5188 | |||
5189 | % \unnumberedno is an oxymoron. But we count the unnumbered | ||
4971 | % sections so that we can refer to them unambiguously in the pdf | 5190 | % sections so that we can refer to them unambiguously in the pdf |
4972 | % outlines by their "section number". We avoid collisions with chapter | 5191 | % outlines by their "section number". We avoid collisions with chapter |
4973 | % numbers by starting them at 10000. (If a document ever has 10000 | 5192 | % numbers by starting them at 10000. (If a document ever has 10000 |
@@ -5046,8 +5265,8 @@ end | |||
5046 | \chardef\maxseclevel = 3 | 5265 | \chardef\maxseclevel = 3 |
5047 | % | 5266 | % |
5048 | % A numbered section within an unnumbered changes to unnumbered too. | 5267 | % A numbered section within an unnumbered changes to unnumbered too. |
5049 | % To achive this, remember the "biggest" unnum. sec. we are currently in: | 5268 | % To achieve this, remember the "biggest" unnum. sec. we are currently in: |
5050 | \chardef\unmlevel = \maxseclevel | 5269 | \chardef\unnlevel = \maxseclevel |
5051 | % | 5270 | % |
5052 | % Trace whether the current chapter is an appendix or not: | 5271 | % Trace whether the current chapter is an appendix or not: |
5053 | % \chapheadtype is "N" or "A", unnumbered chapters are ignored. | 5272 | % \chapheadtype is "N" or "A", unnumbered chapters are ignored. |
@@ -5072,8 +5291,8 @@ end | |||
5072 | % The heading type: | 5291 | % The heading type: |
5073 | \def\headtype{#1}% | 5292 | \def\headtype{#1}% |
5074 | \if \headtype U% | 5293 | \if \headtype U% |
5075 | \ifnum \absseclevel < \unmlevel | 5294 | \ifnum \absseclevel < \unnlevel |
5076 | \chardef\unmlevel = \absseclevel | 5295 | \chardef\unnlevel = \absseclevel |
5077 | \fi | 5296 | \fi |
5078 | \else | 5297 | \else |
5079 | % Check for appendix sections: | 5298 | % Check for appendix sections: |
@@ -5085,10 +5304,10 @@ end | |||
5085 | \fi\fi | 5304 | \fi\fi |
5086 | \fi | 5305 | \fi |
5087 | % Check for numbered within unnumbered: | 5306 | % Check for numbered within unnumbered: |
5088 | \ifnum \absseclevel > \unmlevel | 5307 | \ifnum \absseclevel > \unnlevel |
5089 | \def\headtype{U}% | 5308 | \def\headtype{U}% |
5090 | \else | 5309 | \else |
5091 | \chardef\unmlevel = 3 | 5310 | \chardef\unnlevel = 3 |
5092 | \fi | 5311 | \fi |
5093 | \fi | 5312 | \fi |
5094 | % Now print the heading: | 5313 | % Now print the heading: |
@@ -5174,7 +5393,8 @@ end | |||
5174 | \global\let\subsubsection = \appendixsubsubsec | 5393 | \global\let\subsubsection = \appendixsubsubsec |
5175 | } | 5394 | } |
5176 | 5395 | ||
5177 | \outer\parseargdef\unnumbered{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz | 5396 | % normally unnmhead0 calls unnumberedzzz: |
5397 | \outer\parseargdef\unnumbered{\unnmhead0{#1}} | ||
5178 | \def\unnumberedzzz#1{% | 5398 | \def\unnumberedzzz#1{% |
5179 | \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 | 5399 | \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 |
5180 | \global\advance\unnumberedno by 1 | 5400 | \global\advance\unnumberedno by 1 |
@@ -5218,40 +5438,47 @@ end | |||
5218 | \let\top\unnumbered | 5438 | \let\top\unnumbered |
5219 | 5439 | ||
5220 | % Sections. | 5440 | % Sections. |
5441 | % | ||
5221 | \outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz | 5442 | \outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz |
5222 | \def\seczzz#1{% | 5443 | \def\seczzz#1{% |
5223 | \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 | 5444 | \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 |
5224 | \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}% | 5445 | \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}% |
5225 | } | 5446 | } |
5226 | 5447 | ||
5227 | \outer\parseargdef\appendixsection{\apphead1{#1}} % normally calls appendixsectionzzz | 5448 | % normally calls appendixsectionzzz: |
5449 | \outer\parseargdef\appendixsection{\apphead1{#1}} | ||
5228 | \def\appendixsectionzzz#1{% | 5450 | \def\appendixsectionzzz#1{% |
5229 | \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 | 5451 | \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 |
5230 | \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}% | 5452 | \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}% |
5231 | } | 5453 | } |
5232 | \let\appendixsec\appendixsection | 5454 | \let\appendixsec\appendixsection |
5233 | 5455 | ||
5234 | \outer\parseargdef\unnumberedsec{\unnmhead1{#1}} % normally calls unnumberedseczzz | 5456 | % normally calls unnumberedseczzz: |
5457 | \outer\parseargdef\unnumberedsec{\unnmhead1{#1}} | ||
5235 | \def\unnumberedseczzz#1{% | 5458 | \def\unnumberedseczzz#1{% |
5236 | \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 | 5459 | \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 |
5237 | \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}% | 5460 | \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}% |
5238 | } | 5461 | } |
5239 | 5462 | ||
5240 | % Subsections. | 5463 | % Subsections. |
5241 | \outer\parseargdef\numberedsubsec{\numhead2{#1}} % normally calls numberedsubseczzz | 5464 | % |
5465 | % normally calls numberedsubseczzz: | ||
5466 | \outer\parseargdef\numberedsubsec{\numhead2{#1}} | ||
5242 | \def\numberedsubseczzz#1{% | 5467 | \def\numberedsubseczzz#1{% |
5243 | \global\subsubsecno=0 \global\advance\subsecno by 1 | 5468 | \global\subsubsecno=0 \global\advance\subsecno by 1 |
5244 | \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}% | 5469 | \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}% |
5245 | } | 5470 | } |
5246 | 5471 | ||
5247 | \outer\parseargdef\appendixsubsec{\apphead2{#1}} % normally calls appendixsubseczzz | 5472 | % normally calls appendixsubseczzz: |
5473 | \outer\parseargdef\appendixsubsec{\apphead2{#1}} | ||
5248 | \def\appendixsubseczzz#1{% | 5474 | \def\appendixsubseczzz#1{% |
5249 | \global\subsubsecno=0 \global\advance\subsecno by 1 | 5475 | \global\subsubsecno=0 \global\advance\subsecno by 1 |
5250 | \sectionheading{#1}{subsec}{Yappendix}% | 5476 | \sectionheading{#1}{subsec}{Yappendix}% |
5251 | {\appendixletter.\the\secno.\the\subsecno}% | 5477 | {\appendixletter.\the\secno.\the\subsecno}% |
5252 | } | 5478 | } |
5253 | 5479 | ||
5254 | \outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}} %normally calls unnumberedsubseczzz | 5480 | % normally calls unnumberedsubseczzz: |
5481 | \outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}} | ||
5255 | \def\unnumberedsubseczzz#1{% | 5482 | \def\unnumberedsubseczzz#1{% |
5256 | \global\subsubsecno=0 \global\advance\subsecno by 1 | 5483 | \global\subsubsecno=0 \global\advance\subsecno by 1 |
5257 | \sectionheading{#1}{subsec}{Ynothing}% | 5484 | \sectionheading{#1}{subsec}{Ynothing}% |
@@ -5259,21 +5486,25 @@ end | |||
5259 | } | 5486 | } |
5260 | 5487 | ||
5261 | % Subsubsections. | 5488 | % Subsubsections. |
5262 | \outer\parseargdef\numberedsubsubsec{\numhead3{#1}} % normally numberedsubsubseczzz | 5489 | % |
5490 | % normally numberedsubsubseczzz: | ||
5491 | \outer\parseargdef\numberedsubsubsec{\numhead3{#1}} | ||
5263 | \def\numberedsubsubseczzz#1{% | 5492 | \def\numberedsubsubseczzz#1{% |
5264 | \global\advance\subsubsecno by 1 | 5493 | \global\advance\subsubsecno by 1 |
5265 | \sectionheading{#1}{subsubsec}{Ynumbered}% | 5494 | \sectionheading{#1}{subsubsec}{Ynumbered}% |
5266 | {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}% | 5495 | {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}% |
5267 | } | 5496 | } |
5268 | 5497 | ||
5269 | \outer\parseargdef\appendixsubsubsec{\apphead3{#1}} % normally appendixsubsubseczzz | 5498 | % normally appendixsubsubseczzz: |
5499 | \outer\parseargdef\appendixsubsubsec{\apphead3{#1}} | ||
5270 | \def\appendixsubsubseczzz#1{% | 5500 | \def\appendixsubsubseczzz#1{% |
5271 | \global\advance\subsubsecno by 1 | 5501 | \global\advance\subsubsecno by 1 |
5272 | \sectionheading{#1}{subsubsec}{Yappendix}% | 5502 | \sectionheading{#1}{subsubsec}{Yappendix}% |
5273 | {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}% | 5503 | {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}% |
5274 | } | 5504 | } |
5275 | 5505 | ||
5276 | \outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}} %normally unnumberedsubsubseczzz | 5506 | % normally unnumberedsubsubseczzz: |
5507 | \outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}} | ||
5277 | \def\unnumberedsubsubseczzz#1{% | 5508 | \def\unnumberedsubsubseczzz#1{% |
5278 | \global\advance\subsubsecno by 1 | 5509 | \global\advance\subsubsecno by 1 |
5279 | \sectionheading{#1}{subsubsec}{Ynothing}% | 5510 | \sectionheading{#1}{subsubsec}{Ynothing}% |
@@ -5323,14 +5554,13 @@ end | |||
5323 | % (including whitespace, linebreaking, etc. around it), | 5554 | % (including whitespace, linebreaking, etc. around it), |
5324 | % given all the information in convenient, parsed form. | 5555 | % given all the information in convenient, parsed form. |
5325 | 5556 | ||
5326 | %%% Args are the skip and penalty (usually negative) | 5557 | % Args are the skip and penalty (usually negative) |
5327 | \def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi} | 5558 | \def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi} |
5328 | 5559 | ||
5329 | %%% Define plain chapter starts, and page on/off switching for it | ||
5330 | % Parameter controlling skip before chapter headings (if needed) | 5560 | % Parameter controlling skip before chapter headings (if needed) |
5331 | |||
5332 | \newskip\chapheadingskip | 5561 | \newskip\chapheadingskip |
5333 | 5562 | ||
5563 | % Define plain chapter starts, and page on/off switching for it. | ||
5334 | \def\chapbreak{\dobreak \chapheadingskip {-4000}} | 5564 | \def\chapbreak{\dobreak \chapheadingskip {-4000}} |
5335 | \def\chappager{\par\vfill\supereject} | 5565 | \def\chappager{\par\vfill\supereject} |
5336 | % Because \domark is called before \chapoddpage, the filler page will | 5566 | % Because \domark is called before \chapoddpage, the filler page will |
@@ -5340,9 +5570,8 @@ end | |||
5340 | \chappager | 5570 | \chappager |
5341 | \ifodd\pageno \else | 5571 | \ifodd\pageno \else |
5342 | \begingroup | 5572 | \begingroup |
5343 | \evenheadline={\hfil}\evenfootline={\hfil}% | 5573 | \headingsoff |
5344 | \oddheadline={\hfil}\oddfootline={\hfil}% | 5574 | \null |
5345 | \hbox to 0pt{}% | ||
5346 | \chappager | 5575 | \chappager |
5347 | \endgroup | 5576 | \endgroup |
5348 | \fi | 5577 | \fi |
@@ -5534,6 +5763,8 @@ end | |||
5534 | % | 5763 | % |
5535 | \def\sectionheading#1#2#3#4{% | 5764 | \def\sectionheading#1#2#3#4{% |
5536 | {% | 5765 | {% |
5766 | \checkenv{}% should not be in an environment. | ||
5767 | % | ||
5537 | % Switch to the right set of fonts. | 5768 | % Switch to the right set of fonts. |
5538 | \csname #2fonts\endcsname \rmisbold | 5769 | \csname #2fonts\endcsname \rmisbold |
5539 | % | 5770 | % |
@@ -5651,7 +5882,6 @@ end | |||
5651 | % This is purely so the last item on the list is a known \penalty > | 5882 | % This is purely so the last item on the list is a known \penalty > |
5652 | % 10000. This is so \startdefun can avoid allowing breakpoints after | 5883 | % 10000. This is so \startdefun can avoid allowing breakpoints after |
5653 | % section headings. Otherwise, it would insert a valid breakpoint between: | 5884 | % section headings. Otherwise, it would insert a valid breakpoint between: |
5654 | % | ||
5655 | % @section sec-whatever | 5885 | % @section sec-whatever |
5656 | % @deffn def-whatever | 5886 | % @deffn def-whatever |
5657 | \penalty 10001 | 5887 | \penalty 10001 |
@@ -5785,6 +6015,7 @@ end | |||
5785 | \def\summarycontents{% | 6015 | \def\summarycontents{% |
5786 | \startcontents{\putwordShortTOC}% | 6016 | \startcontents{\putwordShortTOC}% |
5787 | % | 6017 | % |
6018 | \let\partentry = \shortpartentry | ||
5788 | \let\numchapentry = \shortchapentry | 6019 | \let\numchapentry = \shortchapentry |
5789 | \let\appentry = \shortchapentry | 6020 | \let\appentry = \shortchapentry |
5790 | \let\unnchapentry = \shortunnchapentry | 6021 | \let\unnchapentry = \shortunnchapentry |
@@ -5840,6 +6071,19 @@ end | |||
5840 | % The last argument is the page number. | 6071 | % The last argument is the page number. |
5841 | % The arguments in between are the chapter number, section number, ... | 6072 | % The arguments in between are the chapter number, section number, ... |
5842 | 6073 | ||
6074 | % Parts, in the main contents. Replace the part number, which doesn't | ||
6075 | % exist, with an empty box. Let's hope all the numbers have the same width. | ||
6076 | % Also ignore the page number, which is conventionally not printed. | ||
6077 | \def\numeralbox{\setbox0=\hbox{8}\hbox to \wd0{\hfil}} | ||
6078 | \def\partentry#1#2#3#4{\dochapentry{\numeralbox\labelspace#1}{}} | ||
6079 | % | ||
6080 | % Parts, in the short toc. | ||
6081 | \def\shortpartentry#1#2#3#4{% | ||
6082 | \penalty-300 | ||
6083 | \vskip.5\baselineskip plus.15\baselineskip minus.1\baselineskip | ||
6084 | \shortchapentry{{\bf #1}}{\numeralbox}{}{}% | ||
6085 | } | ||
6086 | |||
5843 | % Chapters, in the main contents. | 6087 | % Chapters, in the main contents. |
5844 | \def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}} | 6088 | \def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}} |
5845 | % | 6089 | % |
@@ -5929,9 +6173,9 @@ end | |||
5929 | \message{environments,} | 6173 | \message{environments,} |
5930 | % @foo ... @end foo. | 6174 | % @foo ... @end foo. |
5931 | 6175 | ||
5932 | % @tex ... @end tex escapes into raw Tex temporarily. | 6176 | % @tex ... @end tex escapes into raw TeX temporarily. |
5933 | % One exception: @ is still an escape character, so that @end tex works. | 6177 | % One exception: @ is still an escape character, so that @end tex works. |
5934 | % But \@ or @@ will get a plain tex @ character. | 6178 | % But \@ or @@ will get a plain @ character. |
5935 | 6179 | ||
5936 | \envdef\tex{% | 6180 | \envdef\tex{% |
5937 | \setupmarkupstyle{tex}% | 6181 | \setupmarkupstyle{tex}% |
@@ -5948,6 +6192,10 @@ end | |||
5948 | \catcode`\'=\other | 6192 | \catcode`\'=\other |
5949 | \escapechar=`\\ | 6193 | \escapechar=`\\ |
5950 | % | 6194 | % |
6195 | % ' is active in math mode (mathcode"8000). So reset it, and all our | ||
6196 | % other math active characters (just in case), to plain's definitions. | ||
6197 | \mathactive | ||
6198 | % | ||
5951 | \let\b=\ptexb | 6199 | \let\b=\ptexb |
5952 | \let\bullet=\ptexbullet | 6200 | \let\bullet=\ptexbullet |
5953 | \let\c=\ptexc | 6201 | \let\c=\ptexc |
@@ -6051,6 +6299,12 @@ end | |||
6051 | \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip | 6299 | \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip |
6052 | % Flag to tell @lisp, etc., not to narrow margin. | 6300 | % Flag to tell @lisp, etc., not to narrow margin. |
6053 | \let\nonarrowing = t% | 6301 | \let\nonarrowing = t% |
6302 | % | ||
6303 | % If this cartouche directly follows a sectioning command, we need the | ||
6304 | % \parskip glue (backspaced over by default) or the cartouche can | ||
6305 | % collide with the section heading. | ||
6306 | \ifnum\lastpenalty>10000 \vskip\parskip \fi | ||
6307 | % | ||
6054 | \vbox\bgroup | 6308 | \vbox\bgroup |
6055 | \baselineskip=0pt\parskip=0pt\lineskip=0pt | 6309 | \baselineskip=0pt\parskip=0pt\lineskip=0pt |
6056 | \carttop | 6310 | \carttop |
@@ -6064,7 +6318,7 @@ end | |||
6064 | \lineskip=\normlskip | 6318 | \lineskip=\normlskip |
6065 | \parskip=\normpskip | 6319 | \parskip=\normpskip |
6066 | \vskip -\parskip | 6320 | \vskip -\parskip |
6067 | \comment % For explanation, see the end of \def\group. | 6321 | \comment % For explanation, see the end of def\group. |
6068 | } | 6322 | } |
6069 | \def\Ecartouche{% | 6323 | \def\Ecartouche{% |
6070 | \ifhmode\par\fi | 6324 | \ifhmode\par\fi |
@@ -6150,41 +6404,42 @@ end | |||
6150 | } | 6404 | } |
6151 | 6405 | ||
6152 | % We often define two environments, @foo and @smallfoo. | 6406 | % We often define two environments, @foo and @smallfoo. |
6153 | % Let's do it by one command: | 6407 | % Let's do it in one command. #1 is the env name, #2 the definition. |
6154 | \def\makedispenv #1#2{ | 6408 | \def\makedispenvdef#1#2{% |
6155 | \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2} | 6409 | \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2}% |
6156 | \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2} | 6410 | \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2}% |
6157 | \expandafter\let\csname E#1\endcsname \afterenvbreak | 6411 | \expandafter\let\csname E#1\endcsname \afterenvbreak |
6158 | \expandafter\let\csname Esmall#1\endcsname \afterenvbreak | 6412 | \expandafter\let\csname Esmall#1\endcsname \afterenvbreak |
6159 | } | 6413 | } |
6160 | 6414 | ||
6161 | % Define two synonyms: | 6415 | % Define two environment synonyms (#1 and #2) for an environment. |
6162 | \def\maketwodispenvs #1#2#3{ | 6416 | \def\maketwodispenvdef#1#2#3{% |
6163 | \makedispenv{#1}{#3} | 6417 | \makedispenvdef{#1}{#3}% |
6164 | \makedispenv{#2}{#3} | 6418 | \makedispenvdef{#2}{#3}% |
6165 | } | 6419 | } |
6166 | 6420 | % | |
6167 | % @lisp: indented, narrowed, typewriter font; @example: same as @lisp. | 6421 | % @lisp: indented, narrowed, typewriter font; |
6422 | % @example: same as @lisp. | ||
6168 | % | 6423 | % |
6169 | % @smallexample and @smalllisp: use smaller fonts. | 6424 | % @smallexample and @smalllisp: use smaller fonts. |
6170 | % Originally contributed by Pavel@xerox. | 6425 | % Originally contributed by Pavel@xerox. |
6171 | % | 6426 | % |
6172 | \maketwodispenvs {lisp}{example}{% | 6427 | \maketwodispenvdef{lisp}{example}{% |
6173 | \nonfillstart | 6428 | \nonfillstart |
6174 | \tt\setupmarkupstyle{example}% | 6429 | \tt\setupmarkupstyle{example}% |
6175 | \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special. | 6430 | \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special. |
6176 | \gobble % eat return | 6431 | \gobble % eat return |
6177 | } | 6432 | } |
6178 | % @display/@smalldisplay: same as @lisp except keep current font. | 6433 | % @display/@smalldisplay: same as @lisp except keep current font. |
6179 | % | 6434 | % |
6180 | \makedispenv {display}{% | 6435 | \makedispenvdef{display}{% |
6181 | \nonfillstart | 6436 | \nonfillstart |
6182 | \gobble | 6437 | \gobble |
6183 | } | 6438 | } |
6184 | 6439 | ||
6185 | % @format/@smallformat: same as @display except don't narrow margins. | 6440 | % @format/@smallformat: same as @display except don't narrow margins. |
6186 | % | 6441 | % |
6187 | \makedispenv{format}{% | 6442 | \makedispenvdef{format}{% |
6188 | \let\nonarrowing = t% | 6443 | \let\nonarrowing = t% |
6189 | \nonfillstart | 6444 | \nonfillstart |
6190 | \gobble | 6445 | \gobble |
@@ -6203,7 +6458,7 @@ end | |||
6203 | \envdef\flushright{% | 6458 | \envdef\flushright{% |
6204 | \let\nonarrowing = t% | 6459 | \let\nonarrowing = t% |
6205 | \nonfillstart | 6460 | \nonfillstart |
6206 | \advance\leftskip by 0pt plus 1fill | 6461 | \advance\leftskip by 0pt plus 1fill\relax |
6207 | \gobble | 6462 | \gobble |
6208 | } | 6463 | } |
6209 | \let\Eflushright = \afterenvbreak | 6464 | \let\Eflushright = \afterenvbreak |
@@ -6238,6 +6493,8 @@ end | |||
6238 | % we're doing normal filling. So, when using \aboveenvbreak and | 6493 | % we're doing normal filling. So, when using \aboveenvbreak and |
6239 | % \afterenvbreak, temporarily make \parskip 0. | 6494 | % \afterenvbreak, temporarily make \parskip 0. |
6240 | % | 6495 | % |
6496 | \makedispenvdef{quotation}{\quotationstart} | ||
6497 | % | ||
6241 | \def\quotationstart{% | 6498 | \def\quotationstart{% |
6242 | {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip | 6499 | {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip |
6243 | \parindent=0pt | 6500 | \parindent=0pt |
@@ -6253,28 +6510,18 @@ end | |||
6253 | \parsearg\quotationlabel | 6510 | \parsearg\quotationlabel |
6254 | } | 6511 | } |
6255 | 6512 | ||
6256 | \envdef\quotation{% | ||
6257 | \setnormaldispenv | ||
6258 | \quotationstart | ||
6259 | } | ||
6260 | |||
6261 | \envdef\smallquotation{% | ||
6262 | \setsmalldispenv | ||
6263 | \quotationstart | ||
6264 | } | ||
6265 | \let\Esmallquotation = \Equotation | ||
6266 | |||
6267 | % We have retained a nonzero parskip for the environment, since we're | 6513 | % We have retained a nonzero parskip for the environment, since we're |
6268 | % doing normal filling. | 6514 | % doing normal filling. |
6269 | % | 6515 | % |
6270 | \def\Equotation{% | 6516 | \def\Equotation{% |
6271 | \par | 6517 | \par |
6272 | \ifx\quotationauthor\undefined\else | 6518 | \ifx\quotationauthor\thisisundefined\else |
6273 | % indent a bit. | 6519 | % indent a bit. |
6274 | \leftline{\kern 2\leftskip \sl ---\quotationauthor}% | 6520 | \leftline{\kern 2\leftskip \sl ---\quotationauthor}% |
6275 | \fi | 6521 | \fi |
6276 | {\parskip=0pt \afterenvbreak}% | 6522 | {\parskip=0pt \afterenvbreak}% |
6277 | } | 6523 | } |
6524 | \def\Esmallquotation{\Equotation} | ||
6278 | 6525 | ||
6279 | % If we're given an argument, typeset it in bold with a colon after. | 6526 | % If we're given an argument, typeset it in bold with a colon after. |
6280 | \def\quotationlabel#1{% | 6527 | \def\quotationlabel#1{% |
@@ -6331,21 +6578,28 @@ end | |||
6331 | 6578 | ||
6332 | % Setup for the @verbatim environment | 6579 | % Setup for the @verbatim environment |
6333 | % | 6580 | % |
6334 | % Real tab expansion | 6581 | % Real tab expansion. |
6335 | \newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount | 6582 | \newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount |
6336 | % | 6583 | % |
6337 | \def\starttabbox{\setbox0=\hbox\bgroup} | 6584 | % We typeset each line of the verbatim in an \hbox, so we can handle |
6585 | % tabs. The \global is in case the verbatim line starts with an accent, | ||
6586 | % or some other command that starts with a begin-group. Otherwise, the | ||
6587 | % entire \verbbox would disappear at the corresponding end-group, before | ||
6588 | % it is typeset. Meanwhile, we can't have nested verbatim commands | ||
6589 | % (can we?), so the \global won't be overwriting itself. | ||
6590 | \newbox\verbbox | ||
6591 | \def\starttabbox{\global\setbox\verbbox=\hbox\bgroup} | ||
6338 | % | 6592 | % |
6339 | \begingroup | 6593 | \begingroup |
6340 | \catcode`\^^I=\active | 6594 | \catcode`\^^I=\active |
6341 | \gdef\tabexpand{% | 6595 | \gdef\tabexpand{% |
6342 | \catcode`\^^I=\active | 6596 | \catcode`\^^I=\active |
6343 | \def^^I{\leavevmode\egroup | 6597 | \def^^I{\leavevmode\egroup |
6344 | \dimen0=\wd0 % the width so far, or since the previous tab | 6598 | \dimen\verbbox=\wd\verbbox % the width so far, or since the previous tab |
6345 | \divide\dimen0 by\tabw | 6599 | \divide\dimen\verbbox by\tabw |
6346 | \multiply\dimen0 by\tabw % compute previous multiple of \tabw | 6600 | \multiply\dimen\verbbox by\tabw % compute previous multiple of \tabw |
6347 | \advance\dimen0 by\tabw % advance to next multiple of \tabw | 6601 | \advance\dimen\verbbox by\tabw % advance to next multiple of \tabw |
6348 | \wd0=\dimen0 \box0 \starttabbox | 6602 | \wd\verbbox=\dimen\verbbox \box\verbbox \starttabbox |
6349 | }% | 6603 | }% |
6350 | } | 6604 | } |
6351 | \endgroup | 6605 | \endgroup |
@@ -6354,15 +6608,16 @@ end | |||
6354 | \def\setupverbatim{% | 6608 | \def\setupverbatim{% |
6355 | \let\nonarrowing = t% | 6609 | \let\nonarrowing = t% |
6356 | \nonfillstart | 6610 | \nonfillstart |
6357 | % Easiest (and conventionally used) font for verbatim | 6611 | \tt % easiest (and conventionally used) font for verbatim |
6358 | \tt | 6612 | % The \leavevmode here is for blank lines. Otherwise, we would |
6359 | \def\par{\leavevmode\egroup\box0\endgraf}% | 6613 | % never \starttabox and the \egroup would end verbatim mode. |
6614 | \def\par{\leavevmode\egroup\box\verbbox\endgraf}% | ||
6360 | \tabexpand | 6615 | \tabexpand |
6361 | \setupmarkupstyle{verbatim}% | 6616 | \setupmarkupstyle{verbatim}% |
6362 | % Respect line breaks, | 6617 | % Respect line breaks, |
6363 | % print special symbols as themselves, and | 6618 | % print special symbols as themselves, and |
6364 | % make each space count | 6619 | % make each space count. |
6365 | % must do in this order: | 6620 | % Must do in this order: |
6366 | \obeylines \uncatcodespecials \sepspaces | 6621 | \obeylines \uncatcodespecials \sepspaces |
6367 | \everypar{\starttabbox}% | 6622 | \everypar{\starttabbox}% |
6368 | } | 6623 | } |
@@ -6419,6 +6674,7 @@ end | |||
6419 | \makevalueexpandable | 6674 | \makevalueexpandable |
6420 | \setupverbatim | 6675 | \setupverbatim |
6421 | \indexnofonts % Allow `@@' and other weird things in file names. | 6676 | \indexnofonts % Allow `@@' and other weird things in file names. |
6677 | \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}% | ||
6422 | \input #1 | 6678 | \input #1 |
6423 | \afterenvbreak | 6679 | \afterenvbreak |
6424 | }% | 6680 | }% |
@@ -6468,7 +6724,7 @@ end | |||
6468 | % commands also insert a nobreak penalty, and we don't want to allow | 6724 | % commands also insert a nobreak penalty, and we don't want to allow |
6469 | % a break between a section heading and a defun. | 6725 | % a break between a section heading and a defun. |
6470 | % | 6726 | % |
6471 | % As a minor refinement, we avoid "club" headers by signalling | 6727 | % As a further refinement, we avoid "club" headers by signalling |
6472 | % with penalty of 10003 after the very first @deffn in the | 6728 | % with penalty of 10003 after the very first @deffn in the |
6473 | % sequence (see above), and penalty of 10002 after any following | 6729 | % sequence (see above), and penalty of 10002 after any following |
6474 | % @def command. | 6730 | % @def command. |
@@ -6505,7 +6761,7 @@ end | |||
6505 | #1#2 \endheader | 6761 | #1#2 \endheader |
6506 | % common ending: | 6762 | % common ending: |
6507 | \interlinepenalty = 10000 | 6763 | \interlinepenalty = 10000 |
6508 | \advance\rightskip by 0pt plus 1fil | 6764 | \advance\rightskip by 0pt plus 1fil\relax |
6509 | \endgraf | 6765 | \endgraf |
6510 | \nobreak\vskip -\parskip | 6766 | \nobreak\vskip -\parskip |
6511 | \penalty\defunpenalty % signal to \startdefun and \dodefunx | 6767 | \penalty\defunpenalty % signal to \startdefun and \dodefunx |
@@ -6535,13 +6791,36 @@ end | |||
6535 | \def\domakedefun#1#2#3{% | 6791 | \def\domakedefun#1#2#3{% |
6536 | \envdef#1{% | 6792 | \envdef#1{% |
6537 | \startdefun | 6793 | \startdefun |
6794 | \doingtypefnfalse % distinguish typed functions from all else | ||
6538 | \parseargusing\activeparens{\printdefunline#3}% | 6795 | \parseargusing\activeparens{\printdefunline#3}% |
6539 | }% | 6796 | }% |
6540 | \def#2{\dodefunx#1}% | 6797 | \def#2{\dodefunx#1}% |
6541 | \def#3% | 6798 | \def#3% |
6542 | } | 6799 | } |
6543 | 6800 | ||
6544 | %%% Untyped functions: | 6801 | \newif\ifdoingtypefn % doing typed function? |
6802 | \newif\ifrettypeownline % typeset return type on its own line? | ||
6803 | |||
6804 | % @deftypefnnewline on|off says whether the return type of typed functions | ||
6805 | % are printed on their own line. This affects @deftypefn, @deftypefun, | ||
6806 | % @deftypeop, and @deftypemethod. | ||
6807 | % | ||
6808 | \parseargdef\deftypefnnewline{% | ||
6809 | \def\temp{#1}% | ||
6810 | \ifx\temp\onword | ||
6811 | \expandafter\let\csname SETtxideftypefnnl\endcsname | ||
6812 | = \empty | ||
6813 | \else\ifx\temp\offword | ||
6814 | \expandafter\let\csname SETtxideftypefnnl\endcsname | ||
6815 | = \relax | ||
6816 | \else | ||
6817 | \errhelp = \EMsimple | ||
6818 | \errmessage{Unknown @txideftypefnnl value `\temp', | ||
6819 | must be on|off}% | ||
6820 | \fi\fi | ||
6821 | } | ||
6822 | |||
6823 | % Untyped functions: | ||
6545 | 6824 | ||
6546 | % @deffn category name args | 6825 | % @deffn category name args |
6547 | \makedefun{deffn}{\deffngeneral{}} | 6826 | \makedefun{deffn}{\deffngeneral{}} |
@@ -6560,7 +6839,7 @@ end | |||
6560 | \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}% | 6839 | \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}% |
6561 | } | 6840 | } |
6562 | 6841 | ||
6563 | %%% Typed functions: | 6842 | % Typed functions: |
6564 | 6843 | ||
6565 | % @deftypefn category type name args | 6844 | % @deftypefn category type name args |
6566 | \makedefun{deftypefn}{\deftypefngeneral{}} | 6845 | \makedefun{deftypefn}{\deftypefngeneral{}} |
@@ -6575,10 +6854,11 @@ end | |||
6575 | % | 6854 | % |
6576 | \def\deftypefngeneral#1#2 #3 #4 #5\endheader{% | 6855 | \def\deftypefngeneral#1#2 #3 #4 #5\endheader{% |
6577 | \dosubind{fn}{\code{#4}}{#1}% | 6856 | \dosubind{fn}{\code{#4}}{#1}% |
6857 | \doingtypefntrue | ||
6578 | \defname{#2}{#3}{#4}\defunargs{#5\unskip}% | 6858 | \defname{#2}{#3}{#4}\defunargs{#5\unskip}% |
6579 | } | 6859 | } |
6580 | 6860 | ||
6581 | %%% Typed variables: | 6861 | % Typed variables: |
6582 | 6862 | ||
6583 | % @deftypevr category type var args | 6863 | % @deftypevr category type var args |
6584 | \makedefun{deftypevr}{\deftypecvgeneral{}} | 6864 | \makedefun{deftypevr}{\deftypecvgeneral{}} |
@@ -6596,7 +6876,7 @@ end | |||
6596 | \defname{#2}{#3}{#4}\defunargs{#5\unskip}% | 6876 | \defname{#2}{#3}{#4}\defunargs{#5\unskip}% |
6597 | } | 6877 | } |
6598 | 6878 | ||
6599 | %%% Untyped variables: | 6879 | % Untyped variables: |
6600 | 6880 | ||
6601 | % @defvr category var args | 6881 | % @defvr category var args |
6602 | \makedefun{defvr}#1 {\deftypevrheader{#1} {} } | 6882 | \makedefun{defvr}#1 {\deftypevrheader{#1} {} } |
@@ -6607,7 +6887,8 @@ end | |||
6607 | % \defcvof {category of}class var args | 6887 | % \defcvof {category of}class var args |
6608 | \def\defcvof#1#2 {\deftypecvof{#1}#2 {} } | 6888 | \def\defcvof#1#2 {\deftypecvof{#1}#2 {} } |
6609 | 6889 | ||
6610 | %%% Type: | 6890 | % Types: |
6891 | |||
6611 | % @deftp category name args | 6892 | % @deftp category name args |
6612 | \makedefun{deftp}#1 #2 #3\endheader{% | 6893 | \makedefun{deftp}#1 #2 #3\endheader{% |
6613 | \doind{tp}{\code{#2}}% | 6894 | \doind{tp}{\code{#2}}% |
@@ -6635,25 +6916,49 @@ end | |||
6635 | % We are followed by (but not passed) the arguments, if any. | 6916 | % We are followed by (but not passed) the arguments, if any. |
6636 | % | 6917 | % |
6637 | \def\defname#1#2#3{% | 6918 | \def\defname#1#2#3{% |
6919 | \par | ||
6638 | % Get the values of \leftskip and \rightskip as they were outside the @def... | 6920 | % Get the values of \leftskip and \rightskip as they were outside the @def... |
6639 | \advance\leftskip by -\defbodyindent | 6921 | \advance\leftskip by -\defbodyindent |
6640 | % | 6922 | % |
6641 | % How we'll format the type name. Putting it in brackets helps | 6923 | % Determine if we are typesetting the return type of a typed function |
6924 | % on a line by itself. | ||
6925 | \rettypeownlinefalse | ||
6926 | \ifdoingtypefn % doing a typed function specifically? | ||
6927 | % then check user option for putting return type on its own line: | ||
6928 | \expandafter\ifx\csname SETtxideftypefnnl\endcsname\relax \else | ||
6929 | \rettypeownlinetrue | ||
6930 | \fi | ||
6931 | \fi | ||
6932 | % | ||
6933 | % How we'll format the category name. Putting it in brackets helps | ||
6642 | % distinguish it from the body text that may end up on the next line | 6934 | % distinguish it from the body text that may end up on the next line |
6643 | % just below it. | 6935 | % just below it. |
6644 | \def\temp{#1}% | 6936 | \def\temp{#1}% |
6645 | \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi} | 6937 | \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi} |
6646 | % | 6938 | % |
6647 | % Figure out line sizes for the paragraph shape. | 6939 | % Figure out line sizes for the paragraph shape. We'll always have at |
6940 | % least two. | ||
6941 | \tempnum = 2 | ||
6942 | % | ||
6648 | % The first line needs space for \box0; but if \rightskip is nonzero, | 6943 | % The first line needs space for \box0; but if \rightskip is nonzero, |
6649 | % we need only space for the part of \box0 which exceeds it: | 6944 | % we need only space for the part of \box0 which exceeds it: |
6650 | \dimen0=\hsize \advance\dimen0 by -\wd0 \advance\dimen0 by \rightskip | 6945 | \dimen0=\hsize \advance\dimen0 by -\wd0 \advance\dimen0 by \rightskip |
6946 | % | ||
6947 | % If doing a return type on its own line, we'll have another line. | ||
6948 | \ifrettypeownline | ||
6949 | \advance\tempnum by 1 | ||
6950 | \def\maybeshapeline{0in \hsize}% | ||
6951 | \else | ||
6952 | \def\maybeshapeline{}% | ||
6953 | \fi | ||
6954 | % | ||
6651 | % The continuations: | 6955 | % The continuations: |
6652 | \dimen2=\hsize \advance\dimen2 by -\defargsindent | 6956 | \dimen2=\hsize \advance\dimen2 by -\defargsindent |
6653 | % (plain.tex says that \dimen1 should be used only as global.) | ||
6654 | \parshape 2 0in \dimen0 \defargsindent \dimen2 | ||
6655 | % | 6957 | % |
6656 | % Put the type name to the right margin. | 6958 | % The final paragraph shape: |
6959 | \parshape \tempnum 0in \dimen0 \maybeshapeline \defargsindent \dimen2 | ||
6960 | % | ||
6961 | % Put the category name at the right margin. | ||
6657 | \noindent | 6962 | \noindent |
6658 | \hbox to 0pt{% | 6963 | \hbox to 0pt{% |
6659 | \hfil\box0 \kern-\hsize | 6964 | \hfil\box0 \kern-\hsize |
@@ -6675,8 +6980,16 @@ end | |||
6675 | % . this still does not fix the ?` and !` ligatures, but so far no | 6980 | % . this still does not fix the ?` and !` ligatures, but so far no |
6676 | % one has made identifiers using them :). | 6981 | % one has made identifiers using them :). |
6677 | \df \tt | 6982 | \df \tt |
6678 | \def\temp{#2}% return value type | 6983 | \def\temp{#2}% text of the return type |
6679 | \ifx\temp\empty\else \tclose{\temp} \fi | 6984 | \ifx\temp\empty\else |
6985 | \tclose{\temp}% typeset the return type | ||
6986 | \ifrettypeownline | ||
6987 | % put return type on its own line; prohibit line break following: | ||
6988 | \hfil\vadjust{\nobreak}\break | ||
6989 | \else | ||
6990 | \space % type on same line, so just followed by a space | ||
6991 | \fi | ||
6992 | \fi % no return type | ||
6680 | #3% output function name | 6993 | #3% output function name |
6681 | }% | 6994 | }% |
6682 | {\rm\enskip}% hskip 0.5 em of \tenrm | 6995 | {\rm\enskip}% hskip 0.5 em of \tenrm |
@@ -6794,7 +7107,7 @@ end | |||
6794 | 7107 | ||
6795 | % To do this right we need a feature of e-TeX, \scantokens, | 7108 | % To do this right we need a feature of e-TeX, \scantokens, |
6796 | % which we arrange to emulate with a temporary file in ordinary TeX. | 7109 | % which we arrange to emulate with a temporary file in ordinary TeX. |
6797 | \ifx\eTeXversion\undefined | 7110 | \ifx\eTeXversion\thisisundefined |
6798 | \newwrite\macscribble | 7111 | \newwrite\macscribble |
6799 | \def\scantokens#1{% | 7112 | \def\scantokens#1{% |
6800 | \toks0={#1}% | 7113 | \toks0={#1}% |
@@ -6805,25 +7118,30 @@ end | |||
6805 | } | 7118 | } |
6806 | \fi | 7119 | \fi |
6807 | 7120 | ||
6808 | \def\scanmacro#1{% | 7121 | \def\scanmacro#1{\begingroup |
6809 | \begingroup | 7122 | \newlinechar`\^^M |
6810 | \newlinechar`\^^M | 7123 | \let\xeatspaces\eatspaces |
6811 | \let\xeatspaces\eatspaces | 7124 | % |
6812 | % Undo catcode changes of \startcontents and \doprintindex | 7125 | % Undo catcode changes of \startcontents and \doprintindex |
6813 | % When called from @insertcopying or (short)caption, we need active | 7126 | % When called from @insertcopying or (short)caption, we need active |
6814 | % backslash to get it printed correctly. Previously, we had | 7127 | % backslash to get it printed correctly. Previously, we had |
6815 | % \catcode`\\=\other instead. We'll see whether a problem appears | 7128 | % \catcode`\\=\other instead. We'll see whether a problem appears |
6816 | % with macro expansion. --kasal, 19aug04 | 7129 | % with macro expansion. --kasal, 19aug04 |
6817 | \catcode`\@=0 \catcode`\\=\active \escapechar=`\@ | 7130 | \catcode`\@=0 \catcode`\\=\active \escapechar=`\@ |
6818 | % ... and \example | 7131 | % |
6819 | \spaceisspace | 7132 | % ... and for \example: |
6820 | % | 7133 | \spaceisspace |
6821 | % Append \endinput to make sure that TeX does not see the ending newline. | 7134 | % |
6822 | % I've verified that it is necessary both for e-TeX and for ordinary TeX | 7135 | % The \empty here causes a following catcode 5 newline to be eaten as |
6823 | % --kasal, 29nov03 | 7136 | % part of reading whitespace after a control sequence. It does not |
6824 | \scantokens{#1\endinput}% | 7137 | % eat a catcode 13 newline. There's no good way to handle the two |
6825 | \endgroup | 7138 | % cases (untried: maybe e-TeX's \everyeof could help, though plain TeX |
6826 | } | 7139 | % would then have different behavior). See the Macro Details node in |
7140 | % the manual for the workaround we recommend for macros and | ||
7141 | % line-oriented commands. | ||
7142 | % | ||
7143 | \scantokens{#1\empty}% | ||
7144 | \endgroup} | ||
6827 | 7145 | ||
6828 | \def\scanexp#1{% | 7146 | \def\scanexp#1{% |
6829 | \edef\temp{\noexpand\scanmacro{#1}}% | 7147 | \edef\temp{\noexpand\scanmacro{#1}}% |
@@ -6877,17 +7195,18 @@ end | |||
6877 | 7195 | ||
6878 | % Macro bodies are absorbed as an argument in a context where | 7196 | % Macro bodies are absorbed as an argument in a context where |
6879 | % all characters are catcode 10, 11 or 12, except \ which is active | 7197 | % all characters are catcode 10, 11 or 12, except \ which is active |
6880 | % (as in normal texinfo). It is necessary to change the definition of \. | 7198 | % (as in normal texinfo). It is necessary to change the definition of \ |
6881 | 7199 | % to recognize macro arguments; this is the job of \mbodybackslash. | |
7200 | % | ||
6882 | % Non-ASCII encodings make 8-bit characters active, so un-activate | 7201 | % Non-ASCII encodings make 8-bit characters active, so un-activate |
6883 | % them to avoid their expansion. Must do this non-globally, to | 7202 | % them to avoid their expansion. Must do this non-globally, to |
6884 | % confine the change to the current group. | 7203 | % confine the change to the current group. |
6885 | 7204 | % | |
6886 | % It's necessary to have hard CRs when the macro is executed. This is | 7205 | % It's necessary to have hard CRs when the macro is executed. This is |
6887 | % done by making ^^M (\endlinechar) catcode 12 when reading the macro | 7206 | % done by making ^^M (\endlinechar) catcode 12 when reading the macro |
6888 | % body, and then making it the \newlinechar in \scanmacro. | 7207 | % body, and then making it the \newlinechar in \scanmacro. |
6889 | 7208 | % | |
6890 | \def\scanctxt{% | 7209 | \def\scanctxt{% used as subroutine |
6891 | \catcode`\"=\other | 7210 | \catcode`\"=\other |
6892 | \catcode`\+=\other | 7211 | \catcode`\+=\other |
6893 | \catcode`\<=\other | 7212 | \catcode`\<=\other |
@@ -6900,13 +7219,13 @@ end | |||
6900 | \ifx\declaredencoding\ascii \else \setnonasciicharscatcodenonglobal\other \fi | 7219 | \ifx\declaredencoding\ascii \else \setnonasciicharscatcodenonglobal\other \fi |
6901 | } | 7220 | } |
6902 | 7221 | ||
6903 | \def\scanargctxt{% | 7222 | \def\scanargctxt{% used for copying and captions, not macros. |
6904 | \scanctxt | 7223 | \scanctxt |
6905 | \catcode`\\=\other | 7224 | \catcode`\\=\other |
6906 | \catcode`\^^M=\other | 7225 | \catcode`\^^M=\other |
6907 | } | 7226 | } |
6908 | 7227 | ||
6909 | \def\macrobodyctxt{% | 7228 | \def\macrobodyctxt{% used for @macro definitions |
6910 | \scanctxt | 7229 | \scanctxt |
6911 | \catcode`\{=\other | 7230 | \catcode`\{=\other |
6912 | \catcode`\}=\other | 7231 | \catcode`\}=\other |
@@ -6914,32 +7233,56 @@ end | |||
6914 | \usembodybackslash | 7233 | \usembodybackslash |
6915 | } | 7234 | } |
6916 | 7235 | ||
6917 | \def\macroargctxt{% | 7236 | \def\macroargctxt{% used when scanning invocations |
6918 | \scanctxt | 7237 | \scanctxt |
6919 | \catcode`\\=\other | 7238 | \catcode`\\=0 |
6920 | } | 7239 | } |
7240 | % why catcode 0 for \ in the above? To recognize \\ \{ \} as "escapes" | ||
7241 | % for the single characters \ { }. Thus, we end up with the "commands" | ||
7242 | % that would be written @\ @{ @} in a Texinfo document. | ||
7243 | % | ||
7244 | % We already have @{ and @}. For @\, we define it here, and only for | ||
7245 | % this purpose, to produce a typewriter backslash (so, the @\ that we | ||
7246 | % define for @math can't be used with @macro calls): | ||
7247 | % | ||
7248 | \def\\{\normalbackslash}% | ||
7249 | % | ||
7250 | % We would like to do this for \, too, since that is what makeinfo does. | ||
7251 | % But it is not possible, because Texinfo already has a command @, for a | ||
7252 | % cedilla accent. Documents must use @comma{} instead. | ||
7253 | % | ||
7254 | % \anythingelse will almost certainly be an error of some kind. | ||
7255 | |||
6921 | 7256 | ||
6922 | % \mbodybackslash is the definition of \ in @macro bodies. | 7257 | % \mbodybackslash is the definition of \ in @macro bodies. |
6923 | % It maps \foo\ => \csname macarg.foo\endcsname => #N | 7258 | % It maps \foo\ => \csname macarg.foo\endcsname => #N |
6924 | % where N is the macro parameter number. | 7259 | % where N is the macro parameter number. |
6925 | % We define \csname macarg.\endcsname to be \realbackslash, so | 7260 | % We define \csname macarg.\endcsname to be \realbackslash, so |
6926 | % \\ in macro replacement text gets you a backslash. | 7261 | % \\ in macro replacement text gets you a backslash. |
6927 | 7262 | % | |
6928 | {\catcode`@=0 @catcode`@\=@active | 7263 | {\catcode`@=0 @catcode`@\=@active |
6929 | @gdef@usembodybackslash{@let\=@mbodybackslash} | 7264 | @gdef@usembodybackslash{@let\=@mbodybackslash} |
6930 | @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname} | 7265 | @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname} |
6931 | } | 7266 | } |
6932 | \expandafter\def\csname macarg.\endcsname{\realbackslash} | 7267 | \expandafter\def\csname macarg.\endcsname{\realbackslash} |
6933 | 7268 | ||
7269 | \def\margbackslash#1{\char`\#1 } | ||
7270 | |||
6934 | \def\macro{\recursivefalse\parsearg\macroxxx} | 7271 | \def\macro{\recursivefalse\parsearg\macroxxx} |
6935 | \def\rmacro{\recursivetrue\parsearg\macroxxx} | 7272 | \def\rmacro{\recursivetrue\parsearg\macroxxx} |
6936 | 7273 | ||
6937 | \def\macroxxx#1{% | 7274 | \def\macroxxx#1{% |
6938 | \getargs{#1}% now \macname is the macname and \argl the arglist | 7275 | \getargs{#1}% now \macname is the macname and \argl the arglist |
6939 | \ifx\argl\empty % no arguments | 7276 | \ifx\argl\empty % no arguments |
6940 | \paramno=0% | 7277 | \paramno=0\relax |
6941 | \else | 7278 | \else |
6942 | \expandafter\parsemargdef \argl;% | 7279 | \expandafter\parsemargdef \argl;% |
7280 | \if\paramno>256\relax | ||
7281 | \ifx\eTeXversion\thisisundefined | ||
7282 | \errhelp = \EMsimple | ||
7283 | \errmessage{You need eTeX to compile a file with macros with more than 256 arguments} | ||
7284 | \fi | ||
7285 | \fi | ||
6943 | \fi | 7286 | \fi |
6944 | \if1\csname ismacro.\the\macname\endcsname | 7287 | \if1\csname ismacro.\the\macname\endcsname |
6945 | \message{Warning: redefining \the\macname}% | 7288 | \message{Warning: redefining \the\macname}% |
@@ -6986,46 +7329,269 @@ end | |||
6986 | % an opening brace, and that opening brace is not consumed. | 7329 | % an opening brace, and that opening brace is not consumed. |
6987 | \def\getargs#1{\getargsxxx#1{}} | 7330 | \def\getargs#1{\getargsxxx#1{}} |
6988 | \def\getargsxxx#1#{\getmacname #1 \relax\getmacargs} | 7331 | \def\getargsxxx#1#{\getmacname #1 \relax\getmacargs} |
6989 | \def\getmacname #1 #2\relax{\macname={#1}} | 7332 | \def\getmacname#1 #2\relax{\macname={#1}} |
6990 | \def\getmacargs#1{\def\argl{#1}} | 7333 | \def\getmacargs#1{\def\argl{#1}} |
6991 | 7334 | ||
7335 | % For macro processing make @ a letter so that we can make Texinfo private macro names. | ||
7336 | \edef\texiatcatcode{\the\catcode`\@} | ||
7337 | \catcode `@=11\relax | ||
7338 | |||
6992 | % Parse the optional {params} list. Set up \paramno and \paramlist | 7339 | % Parse the optional {params} list. Set up \paramno and \paramlist |
6993 | % so \defmacro knows what to do. Define \macarg.blah for each blah | 7340 | % so \defmacro knows what to do. Define \macarg.BLAH for each BLAH |
6994 | % in the params list, to be ##N where N is the position in that list. | 7341 | % in the params list to some hook where the argument si to be expanded. If |
7342 | % there are less than 10 arguments that hook is to be replaced by ##N where N | ||
7343 | % is the position in that list, that is to say the macro arguments are to be | ||
7344 | % defined `a la TeX in the macro body. | ||
7345 | % | ||
6995 | % That gets used by \mbodybackslash (above). | 7346 | % That gets used by \mbodybackslash (above). |
6996 | 7347 | % | |
6997 | % We need to get `macro parameter char #' into several definitions. | 7348 | % We need to get `macro parameter char #' into several definitions. |
6998 | % The technique used is stolen from LaTeX: let \hash be something | 7349 | % The technique used is stolen from LaTeX: let \hash be something |
6999 | % unexpandable, insert that wherever you need a #, and then redefine | 7350 | % unexpandable, insert that wherever you need a #, and then redefine |
7000 | % it to # just before using the token list produced. | 7351 | % it to # just before using the token list produced. |
7001 | % | 7352 | % |
7002 | % The same technique is used to protect \eatspaces till just before | 7353 | % The same technique is used to protect \eatspaces till just before |
7003 | % the macro is used. | 7354 | % the macro is used. |
7004 | 7355 | % | |
7005 | \def\parsemargdef#1;{\paramno=0\def\paramlist{}% | 7356 | % If there are 10 or more arguments, a different technique is used, where the |
7006 | \let\hash\relax\let\xeatspaces\relax\parsemargdefxxx#1,;,} | 7357 | % hook remains in the body, and when macro is to be expanded the body is |
7358 | % processed again to replace the arguments. | ||
7359 | % | ||
7360 | % In that case, the hook is \the\toks N-1, and we simply set \toks N-1 to the | ||
7361 | % argument N value and then \edef the body (nothing else will expand because of | ||
7362 | % the catcode regime underwhich the body was input). | ||
7363 | % | ||
7364 | % If you compile with TeX (not eTeX), and you have macros with 10 or more | ||
7365 | % arguments, you need that no macro has more than 256 arguments, otherwise an | ||
7366 | % error is produced. | ||
7367 | \def\parsemargdef#1;{% | ||
7368 | \paramno=0\def\paramlist{}% | ||
7369 | \let\hash\relax | ||
7370 | \let\xeatspaces\relax | ||
7371 | \parsemargdefxxx#1,;,% | ||
7372 | % In case that there are 10 or more arguments we parse again the arguments | ||
7373 | % list to set new definitions for the \macarg.BLAH macros corresponding to | ||
7374 | % each BLAH argument. It was anyhow needed to parse already once this list | ||
7375 | % in order to count the arguments, and as macros with at most 9 arguments | ||
7376 | % are by far more frequent than macro with 10 or more arguments, defining | ||
7377 | % twice the \macarg.BLAH macros does not cost too much processing power. | ||
7378 | \ifnum\paramno<10\relax\else | ||
7379 | \paramno0\relax | ||
7380 | \parsemmanyargdef@@#1,;,% 10 or more arguments | ||
7381 | \fi | ||
7382 | } | ||
7007 | \def\parsemargdefxxx#1,{% | 7383 | \def\parsemargdefxxx#1,{% |
7008 | \if#1;\let\next=\relax | 7384 | \if#1;\let\next=\relax |
7009 | \else \let\next=\parsemargdefxxx | 7385 | \else \let\next=\parsemargdefxxx |
7010 | \advance\paramno by 1% | 7386 | \advance\paramno by 1 |
7011 | \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname | 7387 | \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname |
7012 | {\xeatspaces{\hash\the\paramno}}% | 7388 | {\xeatspaces{\hash\the\paramno}}% |
7013 | \edef\paramlist{\paramlist\hash\the\paramno,}% | 7389 | \edef\paramlist{\paramlist\hash\the\paramno,}% |
7014 | \fi\next} | 7390 | \fi\next} |
7015 | 7391 | ||
7392 | \def\parsemmanyargdef@@#1,{% | ||
7393 | \if#1;\let\next=\relax | ||
7394 | \else | ||
7395 | \let\next=\parsemmanyargdef@@ | ||
7396 | \edef\tempb{\eatspaces{#1}}% | ||
7397 | \expandafter\def\expandafter\tempa | ||
7398 | \expandafter{\csname macarg.\tempb\endcsname}% | ||
7399 | % Note that we need some extra \noexpand\noexpand, this is because we | ||
7400 | % don't want \the to be expanded in the \parsermacbody as it uses an | ||
7401 | % \xdef . | ||
7402 | \expandafter\edef\tempa | ||
7403 | {\noexpand\noexpand\noexpand\the\toks\the\paramno}% | ||
7404 | \advance\paramno by 1\relax | ||
7405 | \fi\next} | ||
7406 | |||
7016 | % These two commands read recursive and nonrecursive macro bodies. | 7407 | % These two commands read recursive and nonrecursive macro bodies. |
7017 | % (They're different since rec and nonrec macros end differently.) | 7408 | % (They're different since rec and nonrec macros end differently.) |
7409 | % | ||
7018 | 7410 | ||
7411 | \catcode `\@\texiatcatcode | ||
7019 | \long\def\parsemacbody#1@end macro% | 7412 | \long\def\parsemacbody#1@end macro% |
7020 | {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% | 7413 | {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% |
7021 | \long\def\parsermacbody#1@end rmacro% | 7414 | \long\def\parsermacbody#1@end rmacro% |
7022 | {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% | 7415 | {\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% |
7416 | \catcode `\@=11\relax | ||
7417 | |||
7418 | \let\endargs@\relax | ||
7419 | \let\nil@\relax | ||
7420 | \def\nilm@{\nil@}% | ||
7421 | \long\def\nillm@{\nil@}% | ||
7422 | |||
7423 | % This macro is expanded during the Texinfo macro expansion, not during its | ||
7424 | % definition. It gets all the arguments values and assigns them to macros | ||
7425 | % macarg.ARGNAME | ||
7426 | % | ||
7427 | % #1 is the macro name | ||
7428 | % #2 is the list of argument names | ||
7429 | % #3 is the list of argument values | ||
7430 | \def\getargvals@#1#2#3{% | ||
7431 | \def\macargdeflist@{}% | ||
7432 | \def\saveparamlist@{#2}% Need to keep a copy for parameter expansion. | ||
7433 | \def\paramlist{#2,\nil@}% | ||
7434 | \def\macroname{#1}% | ||
7435 | \begingroup | ||
7436 | \macroargctxt | ||
7437 | \def\argvaluelist{#3,\nil@}% | ||
7438 | \def\@tempa{#3}% | ||
7439 | \ifx\@tempa\empty | ||
7440 | \setemptyargvalues@ | ||
7441 | \else | ||
7442 | \getargvals@@ | ||
7443 | \fi | ||
7444 | } | ||
7445 | |||
7446 | % | ||
7447 | \def\getargvals@@{% | ||
7448 | \ifx\paramlist\nilm@ | ||
7449 | % Some sanity check needed here that \argvaluelist is also empty. | ||
7450 | \ifx\argvaluelist\nillm@ | ||
7451 | \else | ||
7452 | \errhelp = \EMsimple | ||
7453 | \errmessage{Too many arguments in macro `\macroname'!}% | ||
7454 | \fi | ||
7455 | \let\next\macargexpandinbody@ | ||
7456 | \else | ||
7457 | \ifx\argvaluelist\nillm@ | ||
7458 | % No more arguments values passed to macro. Set remaining named-arg | ||
7459 | % macros to empty. | ||
7460 | \let\next\setemptyargvalues@ | ||
7461 | \else | ||
7462 | % pop current arg name into \@tempb | ||
7463 | \def\@tempa##1{\pop@{\@tempb}{\paramlist}##1\endargs@}% | ||
7464 | \expandafter\@tempa\expandafter{\paramlist}% | ||
7465 | % pop current argument value into \@tempc | ||
7466 | \def\@tempa##1{\longpop@{\@tempc}{\argvaluelist}##1\endargs@}% | ||
7467 | \expandafter\@tempa\expandafter{\argvaluelist}% | ||
7468 | % Here \@tempb is the current arg name and \@tempc is the current arg value. | ||
7469 | % First place the new argument macro definition into \@tempd | ||
7470 | \expandafter\macname\expandafter{\@tempc}% | ||
7471 | \expandafter\let\csname macarg.\@tempb\endcsname\relax | ||
7472 | \expandafter\def\expandafter\@tempe\expandafter{% | ||
7473 | \csname macarg.\@tempb\endcsname}% | ||
7474 | \edef\@tempd{\long\def\@tempe{\the\macname}}% | ||
7475 | \push@\@tempd\macargdeflist@ | ||
7476 | \let\next\getargvals@@ | ||
7477 | \fi | ||
7478 | \fi | ||
7479 | \next | ||
7480 | } | ||
7481 | |||
7482 | \def\push@#1#2{% | ||
7483 | \expandafter\expandafter\expandafter\def | ||
7484 | \expandafter\expandafter\expandafter#2% | ||
7485 | \expandafter\expandafter\expandafter{% | ||
7486 | \expandafter#1#2}% | ||
7487 | } | ||
7488 | |||
7489 | % Replace arguments by their values in the macro body, and place the result | ||
7490 | % in macro \@tempa | ||
7491 | \def\macvalstoargs@{% | ||
7492 | % To do this we use the property that token registers that are \the'ed | ||
7493 | % within an \edef expand only once. So we are going to place all argument | ||
7494 | % values into respective token registers. | ||
7495 | % | ||
7496 | % First we save the token context, and initialize argument numbering. | ||
7497 | \begingroup | ||
7498 | \paramno0\relax | ||
7499 | % Then, for each argument number #N, we place the corresponding argument | ||
7500 | % value into a new token list register \toks#N | ||
7501 | \expandafter\putargsintokens@\saveparamlist@,;,% | ||
7502 | % Then, we expand the body so that argument are replaced by their | ||
7503 | % values. The trick for values not to be expanded themselves is that they | ||
7504 | % are within tokens and that tokens expand only once in an \edef . | ||
7505 | \edef\@tempc{\csname mac.\macroname .body\endcsname}% | ||
7506 | % Now we restore the token stack pointer to free the token list registers | ||
7507 | % which we have used, but we make sure that expanded body is saved after | ||
7508 | % group. | ||
7509 | \expandafter | ||
7510 | \endgroup | ||
7511 | \expandafter\def\expandafter\@tempa\expandafter{\@tempc}% | ||
7512 | } | ||
7513 | |||
7514 | \def\macargexpandinbody@{% | ||
7515 | %% Define the named-macro outside of this group and then close this group. | ||
7516 | \expandafter | ||
7517 | \endgroup | ||
7518 | \macargdeflist@ | ||
7519 | % First the replace in body the macro arguments by their values, the result | ||
7520 | % is in \@tempa . | ||
7521 | \macvalstoargs@ | ||
7522 | % Then we point at the \norecurse or \gobble (for recursive) macro value | ||
7523 | % with \@tempb . | ||
7524 | \expandafter\let\expandafter\@tempb\csname mac.\macroname .recurse\endcsname | ||
7525 | % Depending on whether it is recursive or not, we need some tailing | ||
7526 | % \egroup . | ||
7527 | \ifx\@tempb\gobble | ||
7528 | \let\@tempc\relax | ||
7529 | \else | ||
7530 | \let\@tempc\egroup | ||
7531 | \fi | ||
7532 | % And now we do the real job: | ||
7533 | \edef\@tempd{\noexpand\@tempb{\macroname}\noexpand\scanmacro{\@tempa}\@tempc}% | ||
7534 | \@tempd | ||
7535 | } | ||
7536 | |||
7537 | \def\putargsintokens@#1,{% | ||
7538 | \if#1;\let\next\relax | ||
7539 | \else | ||
7540 | \let\next\putargsintokens@ | ||
7541 | % First we allocate the new token list register, and give it a temporary | ||
7542 | % alias \@tempb . | ||
7543 | \toksdef\@tempb\the\paramno | ||
7544 | % Then we place the argument value into that token list register. | ||
7545 | \expandafter\let\expandafter\@tempa\csname macarg.#1\endcsname | ||
7546 | \expandafter\@tempb\expandafter{\@tempa}% | ||
7547 | \advance\paramno by 1\relax | ||
7548 | \fi | ||
7549 | \next | ||
7550 | } | ||
7551 | |||
7552 | % Save the token stack pointer into macro #1 | ||
7553 | \def\texisavetoksstackpoint#1{\edef#1{\the\@cclvi}} | ||
7554 | % Restore the token stack pointer from number in macro #1 | ||
7555 | \def\texirestoretoksstackpoint#1{\expandafter\mathchardef\expandafter\@cclvi#1\relax} | ||
7556 | % newtoks that can be used non \outer . | ||
7557 | \def\texinonouternewtoks{\alloc@ 5\toks \toksdef \@cclvi} | ||
7558 | |||
7559 | % Tailing missing arguments are set to empty | ||
7560 | \def\setemptyargvalues@{% | ||
7561 | \ifx\paramlist\nilm@ | ||
7562 | \let\next\macargexpandinbody@ | ||
7563 | \else | ||
7564 | \expandafter\setemptyargvaluesparser@\paramlist\endargs@ | ||
7565 | \let\next\setemptyargvalues@ | ||
7566 | \fi | ||
7567 | \next | ||
7568 | } | ||
7023 | 7569 | ||
7024 | % This defines the macro itself. There are six cases: recursive and | 7570 | \def\setemptyargvaluesparser@#1,#2\endargs@{% |
7025 | % nonrecursive macros of zero, one, and many arguments. | 7571 | \expandafter\def\expandafter\@tempa\expandafter{% |
7572 | \expandafter\def\csname macarg.#1\endcsname{}}% | ||
7573 | \push@\@tempa\macargdeflist@ | ||
7574 | \def\paramlist{#2}% | ||
7575 | } | ||
7576 | |||
7577 | % #1 is the element target macro | ||
7578 | % #2 is the list macro | ||
7579 | % #3,#4\endargs@ is the list value | ||
7580 | \def\pop@#1#2#3,#4\endargs@{% | ||
7581 | \def#1{#3}% | ||
7582 | \def#2{#4}% | ||
7583 | } | ||
7584 | \long\def\longpop@#1#2#3,#4\endargs@{% | ||
7585 | \long\def#1{#3}% | ||
7586 | \long\def#2{#4}% | ||
7587 | } | ||
7588 | |||
7589 | % This defines a Texinfo @macro. There are eight cases: recursive and | ||
7590 | % nonrecursive macros of zero, one, up to nine, and many arguments. | ||
7026 | % Much magic with \expandafter here. | 7591 | % Much magic with \expandafter here. |
7027 | % \xdef is used so that macro definitions will survive the file | 7592 | % \xdef is used so that macro definitions will survive the file |
7028 | % they're defined in; @include reads the file inside a group. | 7593 | % they're defined in; @include reads the file inside a group. |
7594 | % | ||
7029 | \def\defmacro{% | 7595 | \def\defmacro{% |
7030 | \let\hash=##% convert placeholders to macro parameter chars | 7596 | \let\hash=##% convert placeholders to macro parameter chars |
7031 | \ifrecursive | 7597 | \ifrecursive |
@@ -7040,17 +7606,25 @@ end | |||
7040 | \expandafter\noexpand\csname\the\macname xxx\endcsname}% | 7606 | \expandafter\noexpand\csname\the\macname xxx\endcsname}% |
7041 | \expandafter\xdef\csname\the\macname xxx\endcsname##1{% | 7607 | \expandafter\xdef\csname\the\macname xxx\endcsname##1{% |
7042 | \egroup\noexpand\scanmacro{\temp}}% | 7608 | \egroup\noexpand\scanmacro{\temp}}% |
7043 | \else % many | 7609 | \else |
7044 | \expandafter\xdef\csname\the\macname\endcsname{% | 7610 | \ifnum\paramno<10\relax % at most 9 |
7045 | \bgroup\noexpand\macroargctxt | 7611 | \expandafter\xdef\csname\the\macname\endcsname{% |
7046 | \noexpand\csname\the\macname xx\endcsname}% | 7612 | \bgroup\noexpand\macroargctxt |
7047 | \expandafter\xdef\csname\the\macname xx\endcsname##1{% | 7613 | \noexpand\csname\the\macname xx\endcsname}% |
7048 | \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% | 7614 | \expandafter\xdef\csname\the\macname xx\endcsname##1{% |
7049 | \expandafter\expandafter | 7615 | \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% |
7050 | \expandafter\xdef | 7616 | \expandafter\expandafter |
7051 | \expandafter\expandafter | 7617 | \expandafter\xdef |
7052 | \csname\the\macname xxx\endcsname | 7618 | \expandafter\expandafter |
7053 | \paramlist{\egroup\noexpand\scanmacro{\temp}}% | 7619 | \csname\the\macname xxx\endcsname |
7620 | \paramlist{\egroup\noexpand\scanmacro{\temp}}% | ||
7621 | \else % 10 or more | ||
7622 | \expandafter\xdef\csname\the\macname\endcsname{% | ||
7623 | \noexpand\getargvals@{\the\macname}{\argl}% | ||
7624 | }% | ||
7625 | \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp | ||
7626 | \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\gobble | ||
7627 | \fi | ||
7054 | \fi | 7628 | \fi |
7055 | \else | 7629 | \else |
7056 | \ifcase\paramno | 7630 | \ifcase\paramno |
@@ -7067,29 +7641,40 @@ end | |||
7067 | \egroup | 7641 | \egroup |
7068 | \noexpand\norecurse{\the\macname}% | 7642 | \noexpand\norecurse{\the\macname}% |
7069 | \noexpand\scanmacro{\temp}\egroup}% | 7643 | \noexpand\scanmacro{\temp}\egroup}% |
7070 | \else % many | 7644 | \else % at most 9 |
7071 | \expandafter\xdef\csname\the\macname\endcsname{% | 7645 | \ifnum\paramno<10\relax |
7072 | \bgroup\noexpand\macroargctxt | 7646 | \expandafter\xdef\csname\the\macname\endcsname{% |
7073 | \expandafter\noexpand\csname\the\macname xx\endcsname}% | 7647 | \bgroup\noexpand\macroargctxt |
7074 | \expandafter\xdef\csname\the\macname xx\endcsname##1{% | 7648 | \expandafter\noexpand\csname\the\macname xx\endcsname}% |
7075 | \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% | 7649 | \expandafter\xdef\csname\the\macname xx\endcsname##1{% |
7076 | \expandafter\expandafter | 7650 | \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% |
7077 | \expandafter\xdef | 7651 | \expandafter\expandafter |
7078 | \expandafter\expandafter | 7652 | \expandafter\xdef |
7079 | \csname\the\macname xxx\endcsname | 7653 | \expandafter\expandafter |
7080 | \paramlist{% | 7654 | \csname\the\macname xxx\endcsname |
7081 | \egroup | 7655 | \paramlist{% |
7082 | \noexpand\norecurse{\the\macname}% | 7656 | \egroup |
7083 | \noexpand\scanmacro{\temp}\egroup}% | 7657 | \noexpand\norecurse{\the\macname}% |
7658 | \noexpand\scanmacro{\temp}\egroup}% | ||
7659 | \else % 10 or more: | ||
7660 | \expandafter\xdef\csname\the\macname\endcsname{% | ||
7661 | \noexpand\getargvals@{\the\macname}{\argl}% | ||
7662 | }% | ||
7663 | \global\expandafter\let\csname mac.\the\macname .body\endcsname\temp | ||
7664 | \global\expandafter\let\csname mac.\the\macname .recurse\endcsname\norecurse | ||
7665 | \fi | ||
7084 | \fi | 7666 | \fi |
7085 | \fi} | 7667 | \fi} |
7086 | 7668 | ||
7669 | \catcode `\@\texiatcatcode\relax | ||
7670 | |||
7087 | \def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}} | 7671 | \def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}} |
7088 | 7672 | ||
7089 | % \braceorline decides whether the next nonwhitespace character is a | 7673 | % \braceorline decides whether the next nonwhitespace character is a |
7090 | % {. If so it reads up to the closing }, if not, it reads the whole | 7674 | % {. If so it reads up to the closing }, if not, it reads the whole |
7091 | % line. Whatever was read is then fed to the next control sequence | 7675 | % line. Whatever was read is then fed to the next control sequence |
7092 | % as an argument (by \parsebrace or \parsearg) | 7676 | % as an argument (by \parsebrace or \parsearg). |
7677 | % | ||
7093 | \def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx} | 7678 | \def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx} |
7094 | \def\braceorlinexxx{% | 7679 | \def\braceorlinexxx{% |
7095 | \ifx\nchar\bgroup\else | 7680 | \ifx\nchar\bgroup\else |
@@ -7099,7 +7684,8 @@ end | |||
7099 | 7684 | ||
7100 | % @alias. | 7685 | % @alias. |
7101 | % We need some trickery to remove the optional spaces around the equal | 7686 | % We need some trickery to remove the optional spaces around the equal |
7102 | % sign. Just make them active and then expand them all to nothing. | 7687 | % sign. Make them active and then expand them all to nothing. |
7688 | % | ||
7103 | \def\alias{\parseargusing\obeyspaces\aliasxxx} | 7689 | \def\alias{\parseargusing\obeyspaces\aliasxxx} |
7104 | \def\aliasxxx #1{\aliasyyy#1\relax} | 7690 | \def\aliasxxx #1{\aliasyyy#1\relax} |
7105 | \def\aliasyyy #1=#2\relax{% | 7691 | \def\aliasyyy #1=#2\relax{% |
@@ -7120,7 +7706,8 @@ end | |||
7120 | 7706 | ||
7121 | % @inforef is relatively simple. | 7707 | % @inforef is relatively simple. |
7122 | \def\inforef #1{\inforefzzz #1,,,,**} | 7708 | \def\inforef #1{\inforefzzz #1,,,,**} |
7123 | \def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}}, | 7709 | \def\inforefzzz #1,#2,#3,#4**{% |
7710 | \putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}}, | ||
7124 | node \samp{\ignorespaces#1{}}} | 7711 | node \samp{\ignorespaces#1{}}} |
7125 | 7712 | ||
7126 | % @node's only job in TeX is to define \lastnode, which is used in | 7713 | % @node's only job in TeX is to define \lastnode, which is used in |
@@ -7181,11 +7768,32 @@ end | |||
7181 | \toks0 = \expandafter{\lastsection}% | 7768 | \toks0 = \expandafter{\lastsection}% |
7182 | \immediate \writexrdef{title}{\the\toks0 }% | 7769 | \immediate \writexrdef{title}{\the\toks0 }% |
7183 | \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc. | 7770 | \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc. |
7184 | \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, during \shipout | 7771 | \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, at \shipout |
7185 | }% | 7772 | }% |
7186 | \fi | 7773 | \fi |
7187 | } | 7774 | } |
7188 | 7775 | ||
7776 | % @xrefautosectiontitle on|off says whether @section(ing) names are used | ||
7777 | % automatically in xrefs, if the third arg is not explicitly specified. | ||
7778 | % This was provided as a "secret" @set xref-automatic-section-title | ||
7779 | % variable, now it's official. | ||
7780 | % | ||
7781 | \parseargdef\xrefautomaticsectiontitle{% | ||
7782 | \def\temp{#1}% | ||
7783 | \ifx\temp\onword | ||
7784 | \expandafter\let\csname SETxref-automatic-section-title\endcsname | ||
7785 | = \empty | ||
7786 | \else\ifx\temp\offword | ||
7787 | \expandafter\let\csname SETxref-automatic-section-title\endcsname | ||
7788 | = \relax | ||
7789 | \else | ||
7790 | \errhelp = \EMsimple | ||
7791 | \errmessage{Unknown @xrefautomaticsectiontitle value `\temp', | ||
7792 | must be on|off}% | ||
7793 | \fi\fi | ||
7794 | } | ||
7795 | |||
7796 | |||
7189 | % @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is | 7797 | % @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is |
7190 | % the node name, #2 the name of the Info cross-reference, #3 the printed | 7798 | % the node name, #2 the name of the Info cross-reference, #3 the printed |
7191 | % node name, #4 the name of the Info file, #5 the name of the printed | 7799 | % node name, #4 the name of the Info file, #5 the name of the printed |
@@ -7202,7 +7810,7 @@ end | |||
7202 | \setbox0=\hbox{\printedrefname\unskip}% | 7810 | \setbox0=\hbox{\printedrefname\unskip}% |
7203 | \ifdim \wd0 = 0pt | 7811 | \ifdim \wd0 = 0pt |
7204 | % No printed node name was explicitly given. | 7812 | % No printed node name was explicitly given. |
7205 | \expandafter\ifx\csname SETxref-automatic-section-title\endcsname\relax | 7813 | \expandafter\ifx\csname SETxref-automatic-section-title\endcsname \relax |
7206 | % Use the node name inside the square brackets. | 7814 | % Use the node name inside the square brackets. |
7207 | \def\printedrefname{\ignorespaces #1}% | 7815 | \def\printedrefname{\ignorespaces #1}% |
7208 | \else | 7816 | \else |
@@ -7231,9 +7839,8 @@ end | |||
7231 | % etc. don't get their TeX definitions. | 7839 | % etc. don't get their TeX definitions. |
7232 | \getfilename{#4}% | 7840 | \getfilename{#4}% |
7233 | % | 7841 | % |
7234 | % See comments at \activebackslashdouble. | 7842 | \edef\pdfxrefdest{#1}% |
7235 | {\activebackslashdouble \xdef\pdfxrefdest{#1}% | 7843 | \txiescapepdf\pdfxrefdest |
7236 | \backslashparens\pdfxrefdest}% | ||
7237 | % | 7844 | % |
7238 | \leavevmode | 7845 | \leavevmode |
7239 | \startlink attr{/Border [0 0 0]}% | 7846 | \startlink attr{/Border [0 0 0]}% |
@@ -7357,7 +7964,8 @@ end | |||
7357 | \angleleft un\-de\-fined\angleright | 7964 | \angleleft un\-de\-fined\angleright |
7358 | \iflinks | 7965 | \iflinks |
7359 | \ifhavexrefs | 7966 | \ifhavexrefs |
7360 | \message{\linenumber Undefined cross reference `#1'.}% | 7967 | {\toks0 = {#1}% avoid expansion of possibly-complex value |
7968 | \message{\linenumber Undefined cross reference `\the\toks0'.}}% | ||
7361 | \else | 7969 | \else |
7362 | \ifwarnedxrefs\else | 7970 | \ifwarnedxrefs\else |
7363 | \global\warnedxrefstrue | 7971 | \global\warnedxrefstrue |
@@ -7521,7 +8129,7 @@ end | |||
7521 | % space to prevent strange expansion errors.) | 8129 | % space to prevent strange expansion errors.) |
7522 | \def\supereject{\par\penalty -20000\footnoteno =0 } | 8130 | \def\supereject{\par\penalty -20000\footnoteno =0 } |
7523 | 8131 | ||
7524 | % @footnotestyle is meaningful for info output only. | 8132 | % @footnotestyle is meaningful for Info output only. |
7525 | \let\footnotestyle=\comment | 8133 | \let\footnotestyle=\comment |
7526 | 8134 | ||
7527 | {\catcode `\@=11 | 8135 | {\catcode `\@=11 |
@@ -7584,6 +8192,8 @@ end | |||
7584 | % expands into a box, it must come within the paragraph, lest it | 8192 | % expands into a box, it must come within the paragraph, lest it |
7585 | % provide a place where TeX can split the footnote. | 8193 | % provide a place where TeX can split the footnote. |
7586 | \footstrut | 8194 | \footstrut |
8195 | % | ||
8196 | % Invoke rest of plain TeX footnote routine. | ||
7587 | \futurelet\next\fo@t | 8197 | \futurelet\next\fo@t |
7588 | } | 8198 | } |
7589 | }%end \catcode `\@=11 | 8199 | }%end \catcode `\@=11 |
@@ -7671,7 +8281,7 @@ end | |||
7671 | it from ftp://tug.org/tex/epsf.tex.} | 8281 | it from ftp://tug.org/tex/epsf.tex.} |
7672 | % | 8282 | % |
7673 | \def\image#1{% | 8283 | \def\image#1{% |
7674 | \ifx\epsfbox\undefined | 8284 | \ifx\epsfbox\thisiundefined |
7675 | \ifwarnednoepsf \else | 8285 | \ifwarnednoepsf \else |
7676 | \errhelp = \noepsfhelp | 8286 | \errhelp = \noepsfhelp |
7677 | \errmessage{epsf.tex not found, images will be ignored}% | 8287 | \errmessage{epsf.tex not found, images will be ignored}% |
@@ -7687,7 +8297,7 @@ end | |||
7687 | % #2 is (optional) width, #3 is (optional) height. | 8297 | % #2 is (optional) width, #3 is (optional) height. |
7688 | % #4 is (ignored optional) html alt text. | 8298 | % #4 is (ignored optional) html alt text. |
7689 | % #5 is (ignored optional) extension. | 8299 | % #5 is (ignored optional) extension. |
7690 | % #6 is just the usual extra ignored arg for parsing this stuff. | 8300 | % #6 is just the usual extra ignored arg for parsing stuff. |
7691 | \newif\ifimagevmode | 8301 | \newif\ifimagevmode |
7692 | \def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup | 8302 | \def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup |
7693 | \catcode`\^^M = 5 % in case we're inside an example | 8303 | \catcode`\^^M = 5 % in case we're inside an example |
@@ -8136,7 +8746,7 @@ directory should work if nowhere else does.} | |||
8136 | % | 8746 | % |
8137 | % Latin1 (ISO-8859-1) character definitions. | 8747 | % Latin1 (ISO-8859-1) character definitions. |
8138 | \def\latonechardefs{% | 8748 | \def\latonechardefs{% |
8139 | \gdef^^a0{~} | 8749 | \gdef^^a0{\tie} |
8140 | \gdef^^a1{\exclamdown} | 8750 | \gdef^^a1{\exclamdown} |
8141 | \gdef^^a2{\missingcharmsg{CENT SIGN}} | 8751 | \gdef^^a2{\missingcharmsg{CENT SIGN}} |
8142 | \gdef^^a3{{\pounds}} | 8752 | \gdef^^a3{{\pounds}} |
@@ -8166,7 +8776,7 @@ directory should work if nowhere else does.} | |||
8166 | \gdef^^b9{$^1$} | 8776 | \gdef^^b9{$^1$} |
8167 | \gdef^^ba{\ordm} | 8777 | \gdef^^ba{\ordm} |
8168 | % | 8778 | % |
8169 | \gdef^^bb{\guilletright} | 8779 | \gdef^^bb{\guillemetright} |
8170 | \gdef^^bc{$1\over4$} | 8780 | \gdef^^bc{$1\over4$} |
8171 | \gdef^^bd{$1\over2$} | 8781 | \gdef^^bd{$1\over2$} |
8172 | \gdef^^be{$3\over4$} | 8782 | \gdef^^be{$3\over4$} |
@@ -8258,7 +8868,7 @@ directory should work if nowhere else does.} | |||
8258 | 8868 | ||
8259 | % Latin2 (ISO-8859-2) character definitions. | 8869 | % Latin2 (ISO-8859-2) character definitions. |
8260 | \def\lattwochardefs{% | 8870 | \def\lattwochardefs{% |
8261 | \gdef^^a0{~} | 8871 | \gdef^^a0{\tie} |
8262 | \gdef^^a1{\ogonek{A}} | 8872 | \gdef^^a1{\ogonek{A}} |
8263 | \gdef^^a2{\u{}} | 8873 | \gdef^^a2{\u{}} |
8264 | \gdef^^a3{\L} | 8874 | \gdef^^a3{\L} |
@@ -8339,8 +8949,8 @@ directory should work if nowhere else does.} | |||
8339 | \gdef^^ea{\ogonek{e}} | 8949 | \gdef^^ea{\ogonek{e}} |
8340 | \gdef^^eb{\"e} | 8950 | \gdef^^eb{\"e} |
8341 | \gdef^^ec{\v e} | 8951 | \gdef^^ec{\v e} |
8342 | \gdef^^ed{\'\i} | 8952 | \gdef^^ed{\'{\dotless{i}}} |
8343 | \gdef^^ee{\^\i} | 8953 | \gdef^^ee{\^{\dotless{i}}} |
8344 | \gdef^^ef{\v d} | 8954 | \gdef^^ef{\v d} |
8345 | % | 8955 | % |
8346 | \gdef^^f0{\dh} | 8956 | \gdef^^f0{\dh} |
@@ -8431,7 +9041,7 @@ directory should work if nowhere else does.} | |||
8431 | 9041 | ||
8432 | \gdef\DeclareUnicodeCharacter#1#2{% | 9042 | \gdef\DeclareUnicodeCharacter#1#2{% |
8433 | \countUTFz = "#1\relax | 9043 | \countUTFz = "#1\relax |
8434 | \wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}% | 9044 | %\wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}% |
8435 | \begingroup | 9045 | \begingroup |
8436 | \parseXMLCharref | 9046 | \parseXMLCharref |
8437 | \def\UTFviiiTwoOctets##1##2{% | 9047 | \def\UTFviiiTwoOctets##1##2{% |
@@ -8899,8 +9509,8 @@ directory should work if nowhere else does.} | |||
8899 | % Prevent underfull vbox error messages. | 9509 | % Prevent underfull vbox error messages. |
8900 | \vbadness = 10000 | 9510 | \vbadness = 10000 |
8901 | 9511 | ||
8902 | % Don't be so finicky about underfull hboxes, either. | 9512 | % Don't be very finicky about underfull hboxes, either. |
8903 | \hbadness = 2000 | 9513 | \hbadness = 6666 |
8904 | 9514 | ||
8905 | % Following George Bush, get rid of widows and orphans. | 9515 | % Following George Bush, get rid of widows and orphans. |
8906 | \widowpenalty=10000 | 9516 | \widowpenalty=10000 |
@@ -9107,28 +9717,21 @@ directory should work if nowhere else does.} | |||
9107 | 9717 | ||
9108 | \message{and turning on texinfo input format.} | 9718 | \message{and turning on texinfo input format.} |
9109 | 9719 | ||
9720 | \def^^L{\par} % remove \outer, so ^L can appear in an @comment | ||
9721 | |||
9110 | % DEL is a comment character, in case @c does not suffice. | 9722 | % DEL is a comment character, in case @c does not suffice. |
9111 | \catcode`\^^? = 14 | 9723 | \catcode`\^^? = 14 |
9112 | 9724 | ||
9113 | % Define macros to output various characters with catcode for normal text. | 9725 | % Define macros to output various characters with catcode for normal text. |
9114 | \catcode`\"=\other | 9726 | \catcode`\"=\other \def\normaldoublequote{"} |
9115 | \catcode`\~=\other | 9727 | \catcode`\$=\other \def\normaldollar{$}%$ font-lock fix |
9116 | \catcode`\^=\other | 9728 | \catcode`\+=\other \def\normalplus{+} |
9117 | \catcode`\_=\other | 9729 | \catcode`\<=\other \def\normalless{<} |
9118 | \catcode`\|=\other | 9730 | \catcode`\>=\other \def\normalgreater{>} |
9119 | \catcode`\<=\other | 9731 | \catcode`\^=\other \def\normalcaret{^} |
9120 | \catcode`\>=\other | 9732 | \catcode`\_=\other \def\normalunderscore{_} |
9121 | \catcode`\+=\other | 9733 | \catcode`\|=\other \def\normalverticalbar{|} |
9122 | \catcode`\$=\other | 9734 | \catcode`\~=\other \def\normaltilde{~} |
9123 | \def\normaldoublequote{"} | ||
9124 | \def\normaltilde{~} | ||
9125 | \def\normalcaret{^} | ||
9126 | \def\normalunderscore{_} | ||
9127 | \def\normalverticalbar{|} | ||
9128 | \def\normalless{<} | ||
9129 | \def\normalgreater{>} | ||
9130 | \def\normalplus{+} | ||
9131 | \def\normaldollar{$}%$ font-lock fix | ||
9132 | 9735 | ||
9133 | % This macro is used to make a character print one way in \tt | 9736 | % This macro is used to make a character print one way in \tt |
9134 | % (where it can probably be output as-is), and another way in other fonts, | 9737 | % (where it can probably be output as-is), and another way in other fonts, |
@@ -9206,14 +9809,24 @@ directory should work if nowhere else does.} | |||
9206 | 9809 | ||
9207 | % In texinfo, backslash is an active character; it prints the backslash | 9810 | % In texinfo, backslash is an active character; it prints the backslash |
9208 | % in fixed width font. | 9811 | % in fixed width font. |
9209 | \catcode`\\=\active | 9812 | \catcode`\\=\active % @ for escape char from now on. |
9210 | @def@normalbackslash{{@tt@backslashcurfont}} | 9813 | |
9814 | % The story here is that in math mode, the \char of \backslashcurfont | ||
9815 | % ends up printing the roman \ from the math symbol font (because \char | ||
9816 | % in math mode uses the \mathcode, and plain.tex sets | ||
9817 | % \mathcode`\\="026E). It seems better for @backslashchar{} to always | ||
9818 | % print a typewriter backslash, hence we use an explicit \mathchar, | ||
9819 | % which is the decimal equivalent of "715c (class 7, e.g., use \fam; | ||
9820 | % ignored family value; char position "5C). We can't use " for the | ||
9821 | % usual hex value because it has already been made active. | ||
9822 | @def@normalbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi}} | ||
9823 | @let@backslashchar = @normalbackslash % @backslashchar{} is for user documents. | ||
9824 | |||
9211 | % On startup, @fixbackslash assigns: | 9825 | % On startup, @fixbackslash assigns: |
9212 | % @let \ = @normalbackslash | 9826 | % @let \ = @normalbackslash |
9213 | |||
9214 | % \rawbackslash defines an active \ to do \backslashcurfont. | 9827 | % \rawbackslash defines an active \ to do \backslashcurfont. |
9215 | % \otherbackslash defines an active \ to be a literal `\' character with | 9828 | % \otherbackslash defines an active \ to be a literal `\' character with |
9216 | % catcode other. | 9829 | % catcode other. We switch back and forth between these. |
9217 | @gdef@rawbackslash{@let\=@backslashcurfont} | 9830 | @gdef@rawbackslash{@let\=@backslashcurfont} |
9218 | @gdef@otherbackslash{@let\=@realbackslash} | 9831 | @gdef@otherbackslash{@let\=@realbackslash} |
9219 | 9832 | ||
@@ -9221,16 +9834,16 @@ directory should work if nowhere else does.} | |||
9221 | % the literal character `\'. | 9834 | % the literal character `\'. |
9222 | % | 9835 | % |
9223 | @def@normalturnoffactive{% | 9836 | @def@normalturnoffactive{% |
9224 | @let\=@normalbackslash | ||
9225 | @let"=@normaldoublequote | 9837 | @let"=@normaldoublequote |
9226 | @let~=@normaltilde | 9838 | @let$=@normaldollar %$ font-lock fix |
9839 | @let+=@normalplus | ||
9840 | @let<=@normalless | ||
9841 | @let>=@normalgreater | ||
9842 | @let\=@normalbackslash | ||
9227 | @let^=@normalcaret | 9843 | @let^=@normalcaret |
9228 | @let_=@normalunderscore | 9844 | @let_=@normalunderscore |
9229 | @let|=@normalverticalbar | 9845 | @let|=@normalverticalbar |
9230 | @let<=@normalless | 9846 | @let~=@normaltilde |
9231 | @let>=@normalgreater | ||
9232 | @let+=@normalplus | ||
9233 | @let$=@normaldollar %$ font-lock fix | ||
9234 | @markupsetuplqdefault | 9847 | @markupsetuplqdefault |
9235 | @markupsetuprqdefault | 9848 | @markupsetuprqdefault |
9236 | @unsepspaces | 9849 | @unsepspaces |
@@ -9262,10 +9875,19 @@ directory should work if nowhere else does.} | |||
9262 | % Say @foo, not \foo, in error messages. | 9875 | % Say @foo, not \foo, in error messages. |
9263 | @escapechar = `@@ | 9876 | @escapechar = `@@ |
9264 | 9877 | ||
9878 | % These (along with & and #) are made active for url-breaking, so need | ||
9879 | % active definitions as the normal characters. | ||
9880 | @def@normaldot{.} | ||
9881 | @def@normalquest{?} | ||
9882 | @def@normalslash{/} | ||
9883 | |||
9265 | % These look ok in all fonts, so just make them not special. | 9884 | % These look ok in all fonts, so just make them not special. |
9266 | @catcode`@& = @other | 9885 | % @hashchar{} gets its own user-level command, because of #line. |
9267 | @catcode`@# = @other | 9886 | @catcode`@& = @other @def@normalamp{&} |
9268 | @catcode`@% = @other | 9887 | @catcode`@# = @other @def@normalhash{#} |
9888 | @catcode`@% = @other @def@normalpercent{%} | ||
9889 | |||
9890 | @let @hashchar = @normalhash | ||
9269 | 9891 | ||
9270 | @c Finally, make ` and ' active, so that txicodequoteundirected and | 9892 | @c Finally, make ` and ' active, so that txicodequoteundirected and |
9271 | @c txicodequotebacktick work right in, e.g., @w{@code{`foo'}}. If we | 9893 | @c txicodequotebacktick work right in, e.g., @w{@code{`foo'}}. If we |