Debian Codegraph @

texmf-dist/tex/latex/lwarp/lwarp-imakeidx.sty

raw
1 %%
2 %% This is file `lwarp-imakeidx.sty',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% lwarp.dtx (with options: `imakeidx')
8 %% This is a generated file.
9 %% Copyright 2016-2026 Brian Dunn
10 %%
11 %% This work may be distributed and/or modified under the
12 %% conditions of the LaTeX Project Public License, either version 1.3
13 %% of this license or (at your option) any later version.
14 %% The latest version of this license is in
15 %% http://www.latex-project.org/lppl.txt
16 %% and version 1.3 or later is part of all distributions of LaTeX
17 %% version 2005/12/01 or later.
18 \LWR@ProvidesPackagePass{imakeidx}[2016/10/15]
19 \catcode`\_=12%
20 \define@key{imki}{name}{\def\imki@name{#1_html}}
21 \catcode`\_=8%
22 \catcode`\_=12%
23
24 \renewcommand*{\printindex}[1][\imki@jobname]{%
25 \LWR@maybe@orignewpage%
26 \LWR@startpars%
27 \ifstrequal{#1}{\imki@jobname}{%
28 \@ifundefined{#1@idxfile}{%
29 \imki@error{#1}%
30 }{%
31 \imki@putindex{#1}%
32 }%
33 }{%
34 \@ifundefined{#1_html@idxfile}{\imki@error{#1_html}}{\imki@putindex{#1_html}}%
35 }%
36 }
37
38 \catcode`\_=8%
39 \VerifyCommand[lwarp][imakeidx]{\@index}{443B697F3326243540BE3FB7665606F6}
40
41 \catcode`\_=12%
42
43 \def\@index[#1]{%
44 \ifstrequal{#1}{\imki@jobname}%
45 {%
46 \@ifundefined{#1@idxfile}%
47 {%
48 \PackageWarning{lwarp-imakeidx}{Undefined index file `#1'}%
49 \begingroup
50 \@sanitize
51 \imki@nowrindex%
52 }%
53 {%
54 \edef\@idxfile{#1}%
55 \begingroup
56 \@sanitize
57 \@wrindex\@idxfile%
58 }%
59 }%
60 {%
61 \@ifundefined{#1_html@idxfile}%
62 {%
63 \PackageWarning{lwarp-imakeidx}{Undefined index file `#1_html'}%
64 \begingroup
65 \@sanitize
66 \imki@nowrindex%
67 }%
68 {%
69 \edef\@idxfile{#1_html}%
70 \begingroup
71 \@sanitize
72 \@wrindex\@idxfile%
73 }%
74 }%
75 }
76
77 \catcode`\_=8%
78 \appto\theindex{%
79 \DeclareCommandCopy{\item}{\LWR@indexitem}%
80 \DeclareCommandCopy{\subitem}{\LWR@indexsubitem}%
81 \DeclareCommandCopy{\subsubitem}{\LWR@indexsubsubitem}%
82 }
83 \VerifyCommand[lwarp][imakeidx]{\imki@wrindexentrysplit}{D8ABE70A4355F52E36723AFAB74F71E7}
84
85 \renewcommand\imki@wrindexentrysplit[3]{%
86 \addtocounter{LWR@autoindex}{1}%
87 \expandafter\protected@write\csname#1@idxfile\endcsname{}%
88 {\string\indexentry{#2}{\arabic{LWR@autoindex}}}%
89 \label{LWRindex-\arabic{LWR@autoindex}}%
90 }
91
92 \VerifyCommand[lwarp][imakeidx]{\imki@wrindexentryunique}{9131E144394D273F316D03FA91BA0E2B}
93
94 \renewcommand\imki@wrindexentryunique[3]{%
95 \addtocounter{LWR@autoindex}{1}%
96 \protected@write\@indexfile{}%
97 {\string\indexentry[#1]{#2}{\arabic{LWR@autoindex}}}%
98 \label{LWRindex-\arabic{LWR@autoindex}}%
99 }
100 \newcommand*{\LWR@imki@setxdydefopts}{%
101 \edef\imki@options{ \space %
102 -M \space \LWR@xindyStyle\space %
103 -L \space \LWR@xindyLanguage\space %
104 -C \space \LWR@xindyCodepage\space %
105 }%
106 }
107 \newcommand*{\LWR@imki@setdefopts}[1]{%
108 \ifblank{#1}{%
109 \edef\imki@options{\space -s \space \LWR@makeindexStyle \space}%
110 \ifdefstring{\imki@progdefault}{xindy}{\LWR@imki@setxdydefopts}{}%
111 \ifdefstring{\imki@progdefault}{texindy}{\LWR@imki@setxdydefopts}{}%
112 \ifdefstring{\imki@progdefault}{truexindy}{\LWR@imki@setxdydefopts}{}%
113 }{%
114 \edef\imki@options{\space #1 \space}%
115 }%
116 }
117 \VerifyCommand[lwarp][imakeidx]{\imki@makeindex}{83AEF6DF7A13F7D0565457DFB83D42B5}
118
119 \xpatchcmd{\imki@makeindex}
120 {\let\imki@options\space}
121 {\LWR@imki@setdefopts{}}%
122 {}
123 {\LWR@patcherror{imakeidx}{makeindex}}
124 \define@key{imki}{options}{\LWR@imki@setdefopts{#1}}
125 \VerifyCommand[lwarp][imakeidx]{\imki@resetdefaults}{3D417615569AC35F199A3FBD03B640E3}
126
127 \xpatchcmd{\imki@resetdefaults}
128 {\def\imki@options{ }}
129 {\LWR@imki@setdefopts{}}
130 {}
131 {\LWR@patcherror{imakeidx}{resetdefaults}}
132 \AtBeginDocument{
133 \renewenvironment*{theindex}{%
134 \imki@maybeaddtotoc
135 \imki@indexlevel{\indexname}
136 \DeclareCommandCopy{\item}{\LWR@indexitem}%
137 \DeclareCommandCopy{\subitem}{\LWR@indexsubitem}%
138 \DeclareCommandCopy{\subsubitem}{\LWR@indexsubsubitem}%
139 }{}
140 }% AtBeginDocument
141 \imki@resetdefaults
142 \ifimki@splitindex
143 \let\imki@startidx\imki@startidxunique
144 \AtBeginDocument{\let\@wrindex\imki@wrindexunique}
145 \let\imki@putindex\imki@putindexunique
146 \let\imki@wrindexentry\imki@wrindexentryunique
147 \let\imki@startidxsplit\@undefined
148 \let\imki@wrindexsplit\@undefined
149 \let\imki@putindexsplit\@undefined
150 \else
151 \let\imki@startidx\imki@startidxsplit
152 \AtBeginDocument{\let\@wrindex\imki@wrindexsplit}
153 \let\imki@putindex\imki@putindexsplit
154 \let\imki@wrindexentry\imki@wrindexentrysplit
155 \let\imki@startidxunique\@undefined
156 \let\imki@wrindexunique\@undefined
157 \let\imki@putindexunique\@undefined
158 \fi
159
160 \endinput
161 %%
162 %% End of file `lwarp-imakeidx.sty'.