Mercurial > gnulib
comparison build-aux/texinfo.tex @ 17831:db34b1b0db14
update from texinfo
author | Karl Berry <karl@freefriends.org> |
---|---|
date | Fri, 12 Dec 2014 15:24:21 -0800 |
parents | 86c48fd655bc |
children | c7cacca49e3b |
comparison
equal
deleted
inserted
replaced
17830:06d818b9ca43 | 17831:db34b1b0db14 |
---|---|
1 % texinfo.tex -- TeX macros to handle Texinfo files. | 1 % texinfo.tex -- TeX macros to handle Texinfo files. |
2 % | 2 % |
3 % Load plain if necessary, i.e., if running under initex. | 3 % Load plain if necessary, i.e., if running under initex. |
4 \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi | 4 \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi |
5 % | 5 % |
6 \def\texinfoversion{2014-11-14.07} | 6 \def\texinfoversion{2014-12-03.16} |
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, 2010, 2011, 2012, 2013, 2014 Free Software Foundation, Inc. | 10 % 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 Free Software Foundation, Inc. |
11 % | 11 % |
94 \let\ptexnoindent=\noindent | 94 \let\ptexnoindent=\noindent |
95 \let\ptexplus=+ | 95 \let\ptexplus=+ |
96 \let\ptexraggedright=\raggedright | 96 \let\ptexraggedright=\raggedright |
97 \let\ptexrbrace=\} | 97 \let\ptexrbrace=\} |
98 \let\ptexslash=\/ | 98 \let\ptexslash=\/ |
99 \let\ptexsp=\sp | |
99 \let\ptexstar=\* | 100 \let\ptexstar=\* |
101 \let\ptexsup=\sup | |
100 \let\ptext=\t | 102 \let\ptext=\t |
101 \let\ptextop=\top | 103 \let\ptextop=\top |
102 {\catcode`\'=\active \global\let\ptexquoteright'}% active in plain's math mode | 104 {\catcode`\'=\active \global\let\ptexquoteright'}% active in plain's math mode |
103 | 105 |
104 % If this character appears in an error message or help string, it | 106 % If this character appears in an error message or help string, it |
2079 \errmessage{@fonttextsize only supports `10' or `11', not `\textsizearg'} | 2081 \errmessage{@fonttextsize only supports `10' or `11', not `\textsizearg'} |
2080 \fi\fi | 2082 \fi\fi |
2081 \endgroup | 2083 \endgroup |
2082 } | 2084 } |
2083 | 2085 |
2084 | |
2085 % In order for the font changes to affect most math symbols and letters, | 2086 % In order for the font changes to affect most math symbols and letters, |
2086 % we have to define the \textfont of the standard families. Since | 2087 % we have to define the \textfont of the standard families. We don't |
2087 % texinfo doesn't allow for producing subscripts and superscripts except | 2088 % bother to reset \scriptfont and \scriptscriptfont; awaiting user need. |
2088 % in the main text, we don't bother to reset \scriptfont and | |
2089 % \scriptscriptfont (which would also require loading a lot more fonts). | |
2090 % | 2089 % |
2091 \def\resetmathfonts{% | 2090 \def\resetmathfonts{% |
2092 \textfont0=\tenrm \textfont1=\teni \textfont2=\tensy | 2091 \textfont0=\tenrm \textfont1=\teni \textfont2=\tensy |
2093 \textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf | 2092 \textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf |
2094 \textfont\ttfam=\tentt \textfont\sffam=\tensf | 2093 \textfont\ttfam=\tentt \textfont\sffam=\tensf |
2098 % of just \STYLE. We do this because \STYLE needs to also set the | 2097 % of just \STYLE. We do this because \STYLE needs to also set the |
2099 % current \fam for math mode. Our \STYLE (e.g., \rm) commands hardwire | 2098 % current \fam for math mode. Our \STYLE (e.g., \rm) commands hardwire |
2100 % \tenSTYLE to set the current font. | 2099 % \tenSTYLE to set the current font. |
2101 % | 2100 % |
2102 % Each font-changing command also sets the names \lsize (one size lower) | 2101 % Each font-changing command also sets the names \lsize (one size lower) |
2103 % and \lllsize (three sizes lower). These relative commands are used in | 2102 % and \lllsize (three sizes lower). These relative commands are used |
2104 % the LaTeX logo and acronyms. | 2103 % in, e.g., the LaTeX logo and acronyms. |
2105 % | 2104 % |
2106 % This all needs generalizing, badly. | 2105 % This all needs generalizing, badly. |
2107 % | 2106 % |
2108 \def\textfonts{% | 2107 \def\textfonts{% |
2109 \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl | 2108 \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl |
2840 \let\`=\grave | 2839 \let\`=\grave |
2841 \let\u=\breve | 2840 \let\u=\breve |
2842 \let\v=\check | 2841 \let\v=\check |
2843 \let\~=\tilde | 2842 \let\~=\tilde |
2844 \let\dotaccent=\dot | 2843 \let\dotaccent=\dot |
2844 % have to provide another name for sup operator | |
2845 \let\mathopsup=\sup | |
2845 $\finishmath | 2846 $\finishmath |
2846 } | 2847 } |
2847 \def\finishmath#1{#1$\endgroup} % Close the group opened by \tex. | 2848 \def\finishmath#1{#1$\endgroup} % Close the group opened by \tex. |
2848 | 2849 |
2849 % Some active characters (such as <) are spaced differently in math. | 2850 % Some active characters (such as <) are spaced differently in math. |
2862 \let> = \ptexgtr | 2863 \let> = \ptexgtr |
2863 \let+ = \ptexplus | 2864 \let+ = \ptexplus |
2864 \let' = \ptexquoteright | 2865 \let' = \ptexquoteright |
2865 } | 2866 } |
2866 } | 2867 } |
2868 | |
2869 % for @sub and @sup, if in math mode, just do a normal sub/superscript. | |
2870 % If in text, use math to place as sub/superscript, but switch | |
2871 % into text mode, with smaller fonts. This is a different font than the | |
2872 % one used for real math sub/superscripts (8pt vs. 7pt), but let's not | |
2873 % fix it (significant additions to font machinery) until someone notices. | |
2874 % | |
2875 \def\sub{\ifmmode \expandafter\sb \else \expandafter\finishsub\fi} | |
2876 \def\finishsub#1{$\sb{\hbox{\selectfonts\lllsize #1}}$}% | |
2877 % | |
2878 \def\sup{\ifmmode \expandafter\ptexsp \else \expandafter\finishsup\fi} | |
2879 \def\finishsup#1{$\ptexsp{\hbox{\selectfonts\lllsize #1}}$}% | |
2867 | 2880 |
2868 % ctrl is no longer a Texinfo command, but leave this definition for fun. | 2881 % ctrl is no longer a Texinfo command, but leave this definition for fun. |
2869 \def\ctrl #1{{\tt \rawbackslash \hat}#1} | 2882 \def\ctrl #1{{\tt \rawbackslash \hat}#1} |
2870 | 2883 |
2871 % @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}. | 2884 % @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}. |
6333 % | 6346 % |
6334 % ' is active in math mode (mathcode"8000). So reset it, and all our | 6347 % ' is active in math mode (mathcode"8000). So reset it, and all our |
6335 % other math active characters (just in case), to plain's definitions. | 6348 % other math active characters (just in case), to plain's definitions. |
6336 \mathactive | 6349 \mathactive |
6337 % | 6350 % |
6351 % Inverse of the list at the beginning of the file. | |
6338 \let\b=\ptexb | 6352 \let\b=\ptexb |
6339 \let\bullet=\ptexbullet | 6353 \let\bullet=\ptexbullet |
6340 \let\c=\ptexc | 6354 \let\c=\ptexc |
6341 \let\,=\ptexcomma | 6355 \let\,=\ptexcomma |
6342 \let\.=\ptexdot | 6356 \let\.=\ptexdot |
6348 \let\noindent=\ptexnoindent | 6362 \let\noindent=\ptexnoindent |
6349 \let\{=\ptexlbrace | 6363 \let\{=\ptexlbrace |
6350 \let\+=\tabalign | 6364 \let\+=\tabalign |
6351 \let\}=\ptexrbrace | 6365 \let\}=\ptexrbrace |
6352 \let\/=\ptexslash | 6366 \let\/=\ptexslash |
6367 \let\sp=\ptexsp | |
6353 \let\*=\ptexstar | 6368 \let\*=\ptexstar |
6369 %\let\sup=\ptexsup % do not redefine, we want @sup to work in math mode | |
6354 \let\t=\ptext | 6370 \let\t=\ptext |
6355 \expandafter \let\csname top\endcsname=\ptextop % we've made it outer | 6371 \expandafter \let\csname top\endcsname=\ptextop % we've made it outer |
6356 \let\frenchspacing=\plainfrenchspacing | 6372 \let\frenchspacing=\plainfrenchspacing |
6357 % | 6373 % |
6358 \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}% | 6374 \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}% |
7414 % But it is not possible, because Texinfo already has a command @, for a | 7430 % But it is not possible, because Texinfo already has a command @, for a |
7415 % cedilla accent. Documents must use @comma{} instead. | 7431 % cedilla accent. Documents must use @comma{} instead. |
7416 % | 7432 % |
7417 % \anythingelse will almost certainly be an error of some kind. | 7433 % \anythingelse will almost certainly be an error of some kind. |
7418 | 7434 |
7419 | |
7420 % \mbodybackslash is the definition of \ in @macro bodies. | 7435 % \mbodybackslash is the definition of \ in @macro bodies. |
7421 % It maps \foo\ => \csname macarg.foo\endcsname => #N | 7436 % It maps \foo\ => \csname macarg.foo\endcsname => #N |
7422 % where N is the macro parameter number. | 7437 % where N is the macro parameter number. |
7423 % We define \csname macarg.\endcsname to be \realbackslash, so | 7438 % We define \csname macarg.\endcsname to be \realbackslash, so |
7424 % \\ in macro replacement text gets you a backslash. | 7439 % \\ in macro replacement text gets you a backslash. |
7523 % In that case, the hook is \the\toks N-1, and we simply set \toks N-1 to the | 7538 % In that case, the hook is \the\toks N-1, and we simply set \toks N-1 to the |
7524 % argument N value and then \edef the body (nothing else will expand because of | 7539 % argument N value and then \edef the body (nothing else will expand because of |
7525 % the catcode regime underwhich the body was input). | 7540 % the catcode regime underwhich the body was input). |
7526 % | 7541 % |
7527 % If you compile with TeX (not eTeX), and you have macros with 10 or more | 7542 % If you compile with TeX (not eTeX), and you have macros with 10 or more |
7528 % arguments, you need that no macro has more than 256 arguments, otherwise an | 7543 % arguments, no macro can have more than 256 arguments (else error). |
7529 % error is produced. | |
7530 \def\parsemargdef#1;{% | 7544 \def\parsemargdef#1;{% |
7531 \paramno=0\def\paramlist{}% | 7545 \paramno=0\def\paramlist{}% |
7532 \let\hash\relax | 7546 \let\hash\relax |
7533 \let\xeatspaces\relax | 7547 \let\xeatspaces\relax |
7534 \parsemargdefxxx#1,;,% | 7548 \parsemargdefxxx#1,;,% |
9281 \def\UTFviiiTmp{% | 9295 \def\UTFviiiTmp{% |
9282 \xdef~{\noexpand\UTFviiiFourOctets\string~}} | 9296 \xdef~{\noexpand\UTFviiiFourOctets\string~}} |
9283 \UTFviiiLoop | 9297 \UTFviiiLoop |
9284 \endgroup | 9298 \endgroup |
9285 | 9299 |
9300 \def\globallet{\global\let} % save some \expandafter's below | |
9301 | |
9302 % @U{xxxx} to produce U+xxxx, if we support it. | |
9303 \def\U#1{% | |
9304 \expandafter\ifx\csname uni:#1\endcsname \relax | |
9305 \errhelp = \EMsimple | |
9306 \errmessage{Unicode character U+#1 not supported, sorry}% | |
9307 \else | |
9308 \csname uni:#1\endcsname | |
9309 \fi | |
9310 } | |
9311 | |
9286 \begingroup | 9312 \begingroup |
9287 \catcode`\"=12 | 9313 \catcode`\"=12 |
9288 \catcode`\<=12 | 9314 \catcode`\<=12 |
9289 \catcode`\.=12 | 9315 \catcode`\.=12 |
9290 \catcode`\,=12 | 9316 \catcode`\,=12 |
9291 \catcode`\;=12 | 9317 \catcode`\;=12 |
9292 \catcode`\!=12 | 9318 \catcode`\!=12 |
9293 \catcode`\~=13 | 9319 \catcode`\~=13 |
9294 | |
9295 \gdef\DeclareUnicodeCharacter#1#2{% | 9320 \gdef\DeclareUnicodeCharacter#1#2{% |
9296 \countUTFz = "#1\relax | 9321 \countUTFz = "#1\relax |
9297 %\wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}% | 9322 %\wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}% |
9298 \begingroup | 9323 \begingroup |
9299 \parseXMLCharref | 9324 \parseXMLCharref |
9304 \def\UTFviiiFourOctets##1##2##3##4{% | 9329 \def\UTFviiiFourOctets##1##2##3##4{% |
9305 \csname u8:##1\string ##2\string ##3\string ##4\endcsname}% | 9330 \csname u8:##1\string ##2\string ##3\string ##4\endcsname}% |
9306 \expandafter\expandafter\expandafter\expandafter | 9331 \expandafter\expandafter\expandafter\expandafter |
9307 \expandafter\expandafter\expandafter | 9332 \expandafter\expandafter\expandafter |
9308 \gdef\UTFviiiTmp{#2}% | 9333 \gdef\UTFviiiTmp{#2}% |
9334 % define an additional control sequence for this code point. | |
9335 \expandafter\globallet\csname uni:#1\endcsname \UTFviiiTmp | |
9309 \endgroup} | 9336 \endgroup} |
9310 | 9337 |
9311 \gdef\parseXMLCharref{% | 9338 \gdef\parseXMLCharref{% |
9312 \ifnum\countUTFz < "A0\relax | 9339 \ifnum\countUTFz < "A0\relax |
9313 \errhelp = \EMsimple | 9340 \errhelp = \EMsimple |