Mercurial > gnulib
comparison build-aux/texinfo.tex @ 40203:30d91797009f
autoupdate
author | Karl Berry <karl@freefriends.org> |
---|---|
date | Fri, 01 Mar 2019 08:42:42 -0800 |
parents | 24f6637d57d0 |
children | db8428454956 |
comparison
equal
deleted
inserted
replaced
40202:f5325ca01c16 | 40203:30d91797009f |
---|---|
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-02-23.16} | 6 \def\texinfoversion{2019-02-28.20} |
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 |
5214 \def\dosubind#1#2#3{% | 5214 \def\dosubind#1#2#3{% |
5215 \iflinks | 5215 \iflinks |
5216 {% | 5216 {% |
5217 \requireopenindexfile{#1}% | 5217 \requireopenindexfile{#1}% |
5218 % Store the main index entry text (including the third arg). | 5218 % Store the main index entry text (including the third arg). |
5219 \toks0 = {#2}% | |
5220 % If third arg is present, precede it with a space. | 5219 % If third arg is present, precede it with a space. |
5221 \def\thirdarg{#3}% | 5220 \def\thirdarg{#3}% |
5222 \ifx\thirdarg\empty \else | 5221 \ifx\thirdarg\empty |
5223 \toks0 = \expandafter{\the\toks0 \space #3}% | 5222 \def\indextext{#2}% |
5223 \else | |
5224 \def\indextext{#2\space#3}% | |
5224 \fi | 5225 \fi |
5225 % | 5226 % |
5226 \edef\writeto{\csname#1indfile\endcsname}% | 5227 \edef\writeto{\csname#1indfile\endcsname}% |
5227 % | 5228 % |
5228 \safewhatsit\dosubindwrite | 5229 \safewhatsit\dosubindwrite |
5253 {\catcode`\@=0 \catcode`\\=\active | 5254 {\catcode`\@=0 \catcode`\\=\active |
5254 @gdef@useindexbackslash{@def\{{@indexbackslash}}} | 5255 @gdef@useindexbackslash{@def\{{@indexbackslash}}} |
5255 } | 5256 } |
5256 | 5257 |
5257 % Definition for writing index entry text. | 5258 % Definition for writing index entry text. |
5258 \def\sortas#1{\ignorespaces}% | 5259 \def\sortas#1{}% |
5259 | 5260 |
5260 % Definition for writing index entry sort key. Should occur at the at | 5261 % Definition for writing index entry sort key. |
5261 % the beginning of the index entry, like | |
5262 % @cindex @sortas{september} \september | |
5263 % The \ignorespaces takes care of following space, but there's no way | |
5264 % to remove space before it. | |
5265 { | 5262 { |
5266 \catcode`\-=13 | 5263 \catcode`\-=13 |
5267 \gdef\indexwritesortas{% | 5264 \gdef\indexwritesortas{% |
5268 \begingroup | 5265 \begingroup |
5269 \indexnonalnumreappear | 5266 \indexnonalnumreappear |
5295 \let\{=\lbracechar | 5292 \let\{=\lbracechar |
5296 \let\}=\rbracechar | 5293 \let\}=\rbracechar |
5297 \indexnonalnumdisappear | 5294 \indexnonalnumdisappear |
5298 \xdef\indexsortkey{}% | 5295 \xdef\indexsortkey{}% |
5299 \let\sortas=\indexwritesortas | 5296 \let\sortas=\indexwritesortas |
5300 \edef\temp{\the\toks0}% | 5297 \setbox\dummybox = \hbox{\indextext}% Execute any \sortas |
5301 \setbox\dummybox = \hbox{\temp}% Make sure to execute any \sortas | |
5302 \ifx\indexsortkey\empty | 5298 \ifx\indexsortkey\empty |
5303 \xdef\indexsortkey{\temp}% | 5299 \xdef\indexsortkey{\indextext}% |
5304 \ifx\indexsortkey\empty\xdef\indexsortkey{ }\fi | 5300 \ifx\indexsortkey\empty\xdef\indexsortkey{ }\fi |
5305 \fi | 5301 \fi |
5306 }% | 5302 }% |
5307 % | 5303 % |
5308 % Set up the complete index entry, with both the sort key and | 5304 % Set up the complete index entry, with both the sort key and |
5309 % the original text, including any font commands. We write | 5305 % the original text, including any font commands. We write |
5310 % three arguments to \entry to the .?? file (four in the | 5306 % three arguments to \entry to the .?? file (four in the |
5311 % subentry case), texindex reduces to two when writing the .??s | 5307 % subentry case), texindex reduces to two when writing the .??s |
5312 % sorted result. | 5308 % sorted result. |
5309 % | |
5310 % Fully expand the text of the index entry and trim spaces. | |
5311 \edef\indextext{\indextext}% | |
5312 \edef\indextext{\expandafter\eatspaces\expandafter{\indextext}}% | |
5313 \toks0=\expandafter{\indextext}% | |
5313 \edef\temp{% | 5314 \edef\temp{% |
5314 \write\writeto{% | 5315 \write\writeto{% |
5315 \string\entry{\indexsortkey}{\noexpand\folio}{\the\toks0}}% | 5316 \string\entry{\indexsortkey}{\noexpand\folio}{\the\toks0}}% |
5316 }% | 5317 }% |
5317 \temp | 5318 \temp |
5415 \def\kindex {\kyindex} | 5416 \def\kindex {\kyindex} |
5416 \def\cindex {\cpindex} | 5417 \def\cindex {\cpindex} |
5417 \def\vindex {\vrindex} | 5418 \def\vindex {\vrindex} |
5418 \def\tindex {\tpindex} | 5419 \def\tindex {\tpindex} |
5419 \def\pindex {\pgindex} | 5420 \def\pindex {\pgindex} |
5420 | |
5421 \def\cindexsub {\begingroup\obeylines\cindexsub} | |
5422 {\obeylines % | |
5423 \gdef\cindexsub "#1" #2^^M{\endgroup % | |
5424 \dosubind{cp}{#2}{#1}}} | |
5425 | 5421 |
5426 % Define the macros used in formatting output of the sorted index material. | 5422 % Define the macros used in formatting output of the sorted index material. |
5427 | 5423 |
5428 % @printindex causes a particular index (the ??s file) to get printed. | 5424 % @printindex causes a particular index (the ??s file) to get printed. |
5429 % It does not print any chapter heading (usually an @unnumbered). | 5425 % It does not print any chapter heading (usually an @unnumbered). |