summaryrefslogtreecommitdiff
path: root/indexing/xindex/latex
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /indexing/xindex/latex
Initial commit
Diffstat (limited to 'indexing/xindex/latex')
-rw-r--r--indexing/xindex/latex/xindex.sty76
1 files changed, 76 insertions, 0 deletions
diff --git a/indexing/xindex/latex/xindex.sty b/indexing/xindex/latex/xindex.sty
new file mode 100644
index 0000000000..65799577dc
--- /dev/null
+++ b/indexing/xindex/latex/xindex.sty
@@ -0,0 +1,76 @@
+%% This is file `xindex.sty',
+%%
+%% Copyright (C) 2019-
+%% Herbert Voss
+%%
+%% It may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3c
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3c or later is part of all distributions of LaTeX
+%% version 2005/12/01 or later.
+%
+% $Id: xindex.sty 836 2018-11-11 20:22:56Z herbert $
+%
+% -------------------------------------
+\ProvidesPackage{xindex}[2018/11/11 v. 0.02 write into an idx file (hv)]
+%
+\RequirePackage{xkeyval}
+
+\newif\if@@imakeidx \@@imakeidxfalse
+
+\DeclareOptionX{imakeidx}{\@@imakeidxtrue}
+\DeclareOptionX*{\PassOptionsToPackage\CurrentOption{imakeidx}}
+\ProcessOptionsX\relax
+
+\@ifpackageloaded{imakeidx}{}{% imakeidx already loaded?? if not then define ...
+ \newif\ifimki@startedidx
+ \newif\ifimki@splitindex
+}
+
+\if@@imakeidx
+ \typeout{xindex: Using package imakeidx}%
+ \RequirePackage{imakeidx}
+ \def\imki@progdefault{xindex}
+ \def\imki@program{xindex}
+%
+ \def\imki@@startidxsplit#1{%
+ \if@filesw
+ \def\index{\@bsphack
+ \@ifnextchar [{\@index}{\@index[\imki@jobname]}}
+ \expandafter\newwrite\csname #1@idxfile\endcsname
+ \immediate\openout \csname #1@idxfile\endcsname #1.idx\relax
+ \def\writeidx##1{\write\expandafter\csname #1@idxfile\endcsname{\noexpand##1}}%
+ \typeout{Writing index file #1.idx}%
+ \fi
+ }
+ \global\imki@startedidxfalse
+ \def\imki@@startidxunique#1{%
+ \if@filesw
+ \ifimki@startedidx\else
+ \newwrite\@indexfile
+ \immediate\openout\@indexfile\imki@jobname.idx%
+ \def\writeidx##1{\write\@indexfile{\noexpand##1}}%
+ \global\imki@startedidxtrue
+ \fi
+ \def\index{\@bsphack
+ \@ifnextchar [{\@index}{\@index[\imki@jobname]}}
+ \expandafter\let\csname #1@idxfile\endcsname\@empty
+ \typeout{Started index file #1}%
+ \fi
+ }
+%
+ \ifimki@splitindex
+ \let\imki@startidx\imki@@startidxunique
+ \else
+ \let\imki@startidx\imki@@startidxsplit
+ \fi
+\else
+ \typeout{xindex: Using package makeidx}%
+ \RequirePackage{makeidx}
+ \def\writeidx#1{\write\@indexfile{\noexpand#1}}
+\fi
+
+\endinput
+