Mercurial > gnulib
comparison build-aux/texinfo.tex @ 40207:053dfcf64bef
autoupdate
author | Karl Berry <karl@freefriends.org> |
---|---|
date | Mon, 04 Mar 2019 08:35:35 -0800 |
parents | db8428454956 |
children | c43e83386661 |
comparison
equal
deleted
inserted
replaced
40206:770a5696761e | 40207:053dfcf64bef |
---|---|
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{2019-03-02.16} | 6 \def\texinfoversion{2019-03-03.15} |
7 | 7 |
8 % | 8 % |
9 % Copyright 1985, 1986, 1988, 1990-2019 Free Software Foundation, Inc. | 9 % Copyright 1985, 1986, 1988, 1990-2019 Free Software Foundation, Inc. |
10 % | 10 % |
11 % This texinfo.tex file is free software: you can redistribute it and/or | 11 % This texinfo.tex file is free software: you can redistribute it and/or |
308 \newdimen\txipagewidth \newdimen\txipageheight | 308 \newdimen\txipagewidth \newdimen\txipageheight |
309 | 309 |
310 % Main output routine. | 310 % Main output routine. |
311 % | 311 % |
312 \chardef\PAGE = 255 | 312 \chardef\PAGE = 255 |
313 \output = {\savetopmark\onepageout{\pagecontents\PAGE}} | 313 \newtoks\defaultoutput |
314 \defaultoutput = {\savetopmark\onepageout{\pagecontents\PAGE}} | |
315 \output=\expandafter{\the\defaultoutput} | |
314 | 316 |
315 \newbox\headlinebox | 317 \newbox\headlinebox |
316 \newbox\footlinebox | 318 \newbox\footlinebox |
317 | 319 |
318 % When outputting the double column layout for indices, an output routine | 320 % When outputting the double column layout for indices, an output routine |
3054 \global\def#{\normalhash} | 3056 \global\def#{\normalhash} |
3055 \global\def?{\normalquest} | 3057 \global\def?{\normalquest} |
3056 \global\def/{\normalslash} | 3058 \global\def/{\normalslash} |
3057 } | 3059 } |
3058 | 3060 |
3059 % we put a little stretch before and after the breakable chars, to help | 3061 \def\urefcodeamp{\urefprebreak \&\urefpostbreak} |
3060 % line breaking of long url's. The unequal skips make look better in | 3062 \def\urefcodedot{\urefprebreak .\urefpostbreak} |
3061 % cmtt at least, especially for dots. | 3063 \def\urefcodehash{\urefprebreak \#\urefpostbreak} |
3062 \def\urefprestretchamount{.13em} | 3064 \def\urefcodequest{\urefprebreak ?\urefpostbreak} |
3063 \def\urefpoststretchamount{.1em} | |
3064 \def\urefprestretch{\urefprebreak \hskip0pt plus\urefprestretchamount\relax} | |
3065 \def\urefpoststretch{\urefpostbreak \hskip0pt plus\urefprestretchamount\relax} | |
3066 % | |
3067 \def\urefcodeamp{\urefprestretch \&\urefpoststretch} | |
3068 \def\urefcodedot{\urefprestretch .\urefpoststretch} | |
3069 \def\urefcodehash{\urefprestretch \#\urefpoststretch} | |
3070 \def\urefcodequest{\urefprestretch ?\urefpoststretch} | |
3071 \def\urefcodeslash{\futurelet\next\urefcodeslashfinish} | 3065 \def\urefcodeslash{\futurelet\next\urefcodeslashfinish} |
3072 { | 3066 { |
3073 \catcode`\/=\active | 3067 \catcode`\/=\active |
3074 \global\def\urefcodeslashfinish{% | 3068 \global\def\urefcodeslashfinish{% |
3075 \urefprestretch \slashChar | 3069 \urefprebreak \slashChar |
3076 % Allow line break only after the final / in a sequence of | 3070 % Allow line break only after the final / in a sequence of |
3077 % slashes, to avoid line break between the slashes in http://. | 3071 % slashes, to avoid line break between the slashes in http://. |
3078 \ifx\next/\else \urefpoststretch \fi | 3072 \ifx\next/\else \urefpostbreak \fi |
3079 } | 3073 } |
3080 } | 3074 } |
3081 | 3075 |
3082 % One more complication: by default we'll break after the special | 3076 % By default we'll break after the special characters, but some people like to |
3083 % characters, but some people like to break before the special chars, so | 3077 % break before the special chars, so allow that. Also allow no breaking at |
3084 % allow that. Also allow no breaking at all, for manual control. | 3078 % all, for manual control. |
3085 % | 3079 % |
3086 \parseargdef\urefbreakstyle{% | 3080 \parseargdef\urefbreakstyle{% |
3087 \def\txiarg{#1}% | 3081 \def\txiarg{#1}% |
3088 \ifx\txiarg\wordnone | 3082 \ifx\txiarg\wordnone |
3089 \def\urefprebreak{\nobreak}\def\urefpostbreak{\nobreak} | 3083 \def\urefprebreak{\nobreak}\def\urefpostbreak{\nobreak} |
3090 \else\ifx\txiarg\wordbefore | 3084 \else\ifx\txiarg\wordbefore |
3091 \def\urefprebreak{\allowbreak}\def\urefpostbreak{\nobreak} | 3085 \def\urefprebreak{\urefallowbreak}\def\urefpostbreak{\nobreak} |
3092 \else\ifx\txiarg\wordafter | 3086 \else\ifx\txiarg\wordafter |
3093 \def\urefprebreak{\nobreak}\def\urefpostbreak{\allowbreak} | 3087 \def\urefprebreak{\nobreak}\def\urefpostbreak{\urefallowbreak} |
3094 \else | 3088 \else |
3095 \errhelp = \EMsimple | 3089 \errhelp = \EMsimple |
3096 \errmessage{Unknown @urefbreakstyle setting `\txiarg'}% | 3090 \errmessage{Unknown @urefbreakstyle setting `\txiarg'}% |
3097 \fi\fi\fi | 3091 \fi\fi\fi |
3098 } | 3092 } |
3099 \def\wordafter{after} | 3093 \def\wordafter{after} |
3100 \def\wordbefore{before} | 3094 \def\wordbefore{before} |
3101 \def\wordnone{none} | 3095 \def\wordnone{none} |
3096 | |
3097 % Allow a ragged right output to aid breaking long URL's. Putting stretch in | |
3098 % between characters of the URL doesn't look good. | |
3099 \def\urefallowbreak{% | |
3100 \hskip 0pt plus 1fil\relax | |
3101 \allowbreak | |
3102 \hskip 0pt plus -1fil\relax | |
3103 } | |
3102 | 3104 |
3103 \urefbreakstyle after | 3105 \urefbreakstyle after |
3104 | 3106 |
3105 % @url synonym for @uref, since that's how everyone uses it. | 3107 % @url synonym for @uref, since that's how everyone uses it. |
3106 % | 3108 % |
5220 | 5222 |
5221 | 5223 |
5222 | 5224 |
5223 \let\SETmarginindex=\relax % put index entries in margin (undocumented)? | 5225 \let\SETmarginindex=\relax % put index entries in margin (undocumented)? |
5224 | 5226 |
5225 % Most index entries go through here, but \dosubind is the general case. | |
5226 % #1 is the index name, #2 is the entry text. | 5227 % #1 is the index name, #2 is the entry text. |
5227 \def\doind#1#2{\dosubind{#1}{#2}{}} | 5228 \def\doind#1#2{% |
5228 | |
5229 % There is also \dosubind {index}{topic}{subtopic} | |
5230 % which makes an entry in a two-level index such as the operation index. | |
5231 % TODO: Two-level index? Operation index? | |
5232 | |
5233 % Workhorse for all indexes. | |
5234 % #1 is name of index, #2 is stuff to put there, #3 is subentry -- | |
5235 % empty if called from \doind, as we usually are (the main exception | |
5236 % is with most defuns, which call us directly). | |
5237 % | |
5238 \def\dosubind#1#2#3{% | |
5239 \iflinks | 5229 \iflinks |
5240 {% | 5230 {% |
5231 % | |
5241 \requireopenindexfile{#1}% | 5232 \requireopenindexfile{#1}% |
5242 % Store the main index entry text (including the third arg). | |
5243 % If third arg is present, precede it with a space. | |
5244 \def\thirdarg{#3}% | |
5245 \ifx\thirdarg\empty | |
5246 \def\indextext{#2}% | |
5247 \else | |
5248 \def\indextext{#2\space#3}% | |
5249 \fi | |
5250 % | |
5251 \edef\writeto{\csname#1indfile\endcsname}% | 5233 \edef\writeto{\csname#1indfile\endcsname}% |
5252 % | 5234 % |
5253 \safewhatsit\dosubindwrite | 5235 \def\indextext{#2}% |
5236 \safewhatsit\doindwrite | |
5254 }% | 5237 }% |
5255 \fi | 5238 \fi |
5256 } | 5239 } |
5257 | 5240 |
5258 % Check if an index file has been opened, and if not, open it. | 5241 % Check if an index file has been opened, and if not, open it. |
5352 | 5335 |
5353 \let\subentry\relax | 5336 \let\subentry\relax |
5354 | 5337 |
5355 % Write the entry in \toks0 to the index file. | 5338 % Write the entry in \toks0 to the index file. |
5356 % | 5339 % |
5357 \def\dosubindwrite{% | 5340 \def\doindwrite{% |
5358 % Put the index entry in the margin if desired. | 5341 % Put the index entry in the margin if desired. |
5359 \ifx\SETmarginindex\relax\else | 5342 \ifx\SETmarginindex\relax\else |
5360 \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}% | 5343 \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}% |
5361 \fi | 5344 \fi |
5362 % | 5345 % |
5981 \eject % call the \output just set | 5964 \eject % call the \output just set |
5982 \ifdim\pagetotal=0pt | 5965 \ifdim\pagetotal=0pt |
5983 % Having called \balancecolumns once, we do not | 5966 % Having called \balancecolumns once, we do not |
5984 % want to call it again. Therefore, reset \output to its normal | 5967 % want to call it again. Therefore, reset \output to its normal |
5985 % definition right away. | 5968 % definition right away. |
5986 \global\output = {\onepageout{\pagecontents\PAGE}}% | 5969 \global\output=\expandafter{\the\defaultoutput} |
5987 % | 5970 % |
5988 \endgroup % started in \begindoublecolumns | 5971 \endgroup % started in \begindoublecolumns |
5989 % Leave the double-column material on the current page, no automatic | 5972 % Leave the double-column material on the current page, no automatic |
5990 % page break. | 5973 % page break. |
5991 \box\balancedcolumns | 5974 \box\balancedcolumns |
7372 } | 7355 } |
7373 \let\Eflushright = \afterenvbreak | 7356 \let\Eflushright = \afterenvbreak |
7374 | 7357 |
7375 | 7358 |
7376 % @raggedright does more-or-less normal line breaking but no right | 7359 % @raggedright does more-or-less normal line breaking but no right |
7377 % justification. From plain.tex. Don't stretch around special | 7360 % justification. From plain.tex. |
7378 % characters in urls in this environment, since the stretch at the right | |
7379 % should be enough. | |
7380 \envdef\raggedright{% | 7361 \envdef\raggedright{% |
7381 \rightskip0pt plus2.4em \spaceskip.3333em \xspaceskip.5em\relax | 7362 \rightskip0pt plus2.4em \spaceskip.3333em \xspaceskip.5em\relax |
7382 \def\urefprestretchamount{0pt}% | |
7383 \def\urefpoststretchamount{0pt}% | |
7384 } | 7363 } |
7385 \let\Eraggedright\par | 7364 \let\Eraggedright\par |
7386 | 7365 |
7387 \envdef\raggedleft{% | 7366 \envdef\raggedleft{% |
7388 \parindent=0pt \leftskip0pt plus2em | 7367 \parindent=0pt \leftskip0pt plus2em |
7753 \errmessage{Unknown @txideftypefnnl value `\temp', | 7732 \errmessage{Unknown @txideftypefnnl value `\temp', |
7754 must be on|off}% | 7733 must be on|off}% |
7755 \fi\fi | 7734 \fi\fi |
7756 } | 7735 } |
7757 | 7736 |
7737 % \dosubind {index}{topic}{subtopic} | |
7738 % | |
7739 % If SUBTOPIC is present, precede it with a space, and call \doind. | |
7740 % (At some time during the 20th century, this made a two-level entry in an | |
7741 % index such as the operation index. Nobody seemed to notice the change in | |
7742 % behaviour though.) | |
7743 \def\dosubind#1#2#3{% | |
7744 \def\thirdarg{#3}% | |
7745 \ifx\thirdarg\empty | |
7746 \doind{#1}{#2}% | |
7747 \else | |
7748 \doind{#1}{#2\space#3}% | |
7749 \fi | |
7750 } | |
7751 | |
7758 % Untyped functions: | 7752 % Untyped functions: |
7759 | 7753 |
7760 % @deffn category name args | 7754 % @deffn category name args |
7761 \makedefun{deffn}{\deffngeneral{}} | 7755 \makedefun{deffn}{\deffngeneral{}} |
7762 | 7756 |
7767 \def\defopon#1#2 {\deffngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} } | 7761 \def\defopon#1#2 {\deffngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} } |
7768 | 7762 |
7769 % \deffngeneral {subind}category name args | 7763 % \deffngeneral {subind}category name args |
7770 % | 7764 % |
7771 \def\deffngeneral#1#2 #3 #4\endheader{% | 7765 \def\deffngeneral#1#2 #3 #4\endheader{% |
7772 % Remember that \dosubind{fn}{foo}{} is equivalent to \doind{fn}{foo}. | |
7773 \dosubind{fn}{\code{#3}}{#1}% | 7766 \dosubind{fn}{\code{#3}}{#1}% |
7774 \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}% | 7767 \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}% |
7775 } | 7768 } |
7776 | 7769 |
7777 % Typed functions: | 7770 % Typed functions: |